Link to home
Start Free TrialLog in
Avatar of Donzella
DonzellaFlag for United States of America

asked on

Flash cs3 - using loadClip to load image into empty clip and I want to know the _width of the clip after the image is loaded

I have an empty movieclip that I am loading an image into dynamically. I am using a listener to know when the image is loaded completely and then I want to know the width and height of that clip AFTER the image is loaded. My problem is, everything I try the clip still stays it is 0px wide and 0px high even after the image is loaded. Does loading an image into the clip not change it's dimensions? Is there anyway to tell what size the image is inside the clip after it's loaded? Thank you.
var mcLoader:MovieClipLoader = new MovieClipLoader();
		var mclListener:Object = new Object();
		mclListener.onLoadComplete = function(target_mc:MovieClip, status:Number):Void {
			trace(_root.ThumbClip._width + ' x ' + _root.ThumbClip._height);
		};
		mcLoader.addListener(mclListener);
		mcLoader.loadClip('http://' + _root.t, _root.ThumbClip);

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of CyanBlue
CyanBlue
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Donzella

ASKER

Wow, that's totally non-intuitive if you ask me. But it worked using init so thanks a ton.
Well...  See it this way...  onLoadComplete means that Flash Player has finished download the file but it still is in raw format that you cannot really do anything with it... and onLoadInit means that Flash Player has created appropriate stuff inside of it so that it is ready for us to be used however we want...  Then, it all makes sense...  However the word 'complete' pretty much means other stuff...  ;)

CyanBlue
Ya, I guess I understand their setup there but I am a .NET developer and init is the beginning and complete is the end.

I do appreciate your advice. The app is now done and live.