I have to learn as3, but don’t plan on sticking with it past this one particular job where I am being forced to use it. I just need to know how to do a couple simple things to get around. I just want to write my code in the timeline for simplicity. I have no interest in messing around with classes.
In as2 I would write into the timeline of a movieclip representing a bad guy in a videogame somthing like:
onEnterFrame=function(){
_root.badguy(this)
}
then on the _root:
function badguy(name){
name._x+=10
}
I know how to do this:
addEventListener(Event.ENTER_FRAME, badguy);
function badguy(ev:Event) {
badguy1.x+=2;
}
but this is not helpful in most situations. I want to write it the way I did before. How do I do this?
also, how do I reference the _root?
i tried going into the badguy movie clip and adding a listener and then writing _parent.badguy() for the function to call, but that failed to work.