stage.addEventListener vs mc.addEventListener
Hi
Can someone please explain the difference between stage.addEventListener and mc.addEventListener
I made a code and added the function by saying stage.addEventListener(Event.ENTER_FRAME, func);
in my function I wrote for example
function func(e:Event):void{
mc.x +=10;
}
and so on
now I want to add the listener to a certain movieclip so i changed it to mc.addEventListener(Event.ENTER_FRAME, func); but that doesnt work
for this one I tried changing the code to
function func(e:Event):void{
e.target.x +=10;
}
so I can use this function on multiple movieclips instead of only the one called 'mc'
what am I doing wrong?
Thanks!
Last edited by flip-Ed; 02-09-2012 at 04:00 PM.
|