views:

231

answers:

3

May not have asked question correctly so I’m asking again. I’m using Flash AS3 with code in actions layer.

Main movieclip onstage is : design_mc. Within it is a movieclip already in place onstage with an instance name clipart_mc.

Now I’m also loading a ListBox to the stage and each time a selection is made from listbox myLoader9 is used to load selected .swf into design_mc.clipArt_mc.

Now within each of the .swf files loaded into design_mc.clipArt_mc there is a mc I’d like to color transform called color_mc.

So now the listbox is onstage and I make a selection that places heart.swf inside of design_mc.clipArt_mc. I want to access heart.swf so I did this:

var child:DisplayObject = myLoader9.content.contentLoaderInfo.content.color_mc;
var colorTrans3:ColorTransform = new ColorTransform();
var trans3:Transform = new Transform(child);

I still can not get to heart.swf. Can anyone help please?

Anne

A: 

I'm working with Embedded SWFs here, but I think it's the same. I can get my MovieClip from the Loader "content" property. Like this:

var myMC:MovieClip = MovieClip(myLoader9.content);

Try this way, instead of using "content.contentLoaderInfo.content".

:)

André Gil
Thanks for answering, loader not working . Tried instead: var child:DisplayObject = MovieClip(parent).design_mc.clipArt_mc;This is the path to the holding clip. Good because I can apply color to the entire embedded swf inside clipart_mc which for some of the embedded swf is ok. Not good for the flower.swf. I only want to color the layer in this swf that holds color_mc which are flower petals . So when I plug in: var child:DisplayObject = MovieClip(parent).design_mc.clipArt_mc.color_mc; I get error #2007 saying displayObject must be non-null.
anne
A: 

I got it. I gave the loader a name:

myLoader9.name = "currentClip";

Then I can target in main movie using:

var child:DisplayObject = MovieClip(parent).design_mc.clipArt_mc.getChildByName("currentClip").content.color_mc;
anne
A: 

Thank you, I get it now.

Anne

Anne