William,

It is possible that your trace is done while your load is not.
Because Flash is a-synchroon.


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of William
Adams
Sent: vrijdag 12 december 2008 20:27
To: Flash Coders List
Subject: [Flashcoders] getting the width of a movieclip

Given the code:

var firstImage:Loader = new Loader();
var empty_mc:MovieClip=new MovieClip();
var url:URLRequest = new URLRequest();

addChild(empty_mc);
url = new URLRequest("test.jpg");
firstImage.load(url);
firstImage.x = 10;
firstImage.y = 10;
empty_mc.addChild(firstImage);

why does

trace (empty_mc.width);

yield 0?

and what do I have to do to get the image centered along the lines of:

empty_mc.x = 70-(empty_mc.width/2);

Thanks!

William


-- 
William Adams
senior graphic designer
Fry Communications


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.176 / Virus Database: 270.9.17/1845 - Release Date: 12-12-2008
9:02

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to