开发者

Trouble using Loader, can't access properties of loaded swf

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 s开发者_Go百科o 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


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".

:)


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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜