Results 1 to 1 of 1
-
October 15th, 2008, 05:09 PM #11,463Recent Coda Convert
postsacting on child movie clip (again with the starting over)
Once more, lost in translation from AS2 to AS3:
In AS2 i can write a function that will affect the child mc of a parent mc. I can change the name of parent mc's, and using "this" I can still affect the child:
and so on.Code://I've been using Fuse for stuff... function changeColor(fillColor){ this.childMC.colorTo(fillColor); } parent1.onRollOver=function(){ changeColor("0x000000") } parent2.onRollOver=function(){ changeColor("0xFFFFFF") }
Now, I've learned some AS3 stuff, about using switch statements to call a function on multiple targets:
but how to access the child mc within? Nothing I've tried works.Code://as3, function showCover(e:Event):void{ var target:DisplayObject=e.currentTarget as DisplayObject; switch(target){ case btn1: loadImage("sw_covers/episodeI.jpg"); break; case btn2: loadImage("sw_covers/episodeII.jpg"); break; } }
thanks for helping out an old-time-noob.

Reply With Quote

Bookmarks