views:

26

answers:

2

Hi,

I'm loading an swf say "test.swf" which gets loaded in imageLoader , so I can get its content by :

imageLoader.content

So if I wanted one of the movieClips inside it I would do this :

imageLoader.content.testMovie.transform.colorTransform = someTransformation;

But when I do this, since the movie is not loaded the file is not compiled and gives me an error your referring to something that is not there. How else am I supposed to reference a content that will be loaded later?

A: 

You can't reference something that hasn't loaded. If you want to apply a transform you can do that on the parent clip but this might not be what you are after.

danjp
+1  A: 

Wait till it is loaded. Listen to its complete event and access content from there.

imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoad);
function onLoad(e:Event):void
{
  MovieClip(imageLoader.content).testMovie.transform.colorTransform = someTransformation;
}

If testMovie is yet another dynamically loaded SWF, wait till it is loaded - listen to the complete event dispatched by testMovie.contentLoaderInfo.

Even better, if you have access to the loaded SWF, dispatch a custom event from there when testMovie is loaded and listen to it from the main SWF.

Amarghosh