highway81
05-14-2008, 10:51 PM
hey,
i have just started studying actionscript 3 at college and need some help migrating some script from 2 to 3. any help would be greatly appreciated:
ryu_mc.step=15;
ryu_mc.attack = false;
ryu_mc.stance= 1;
ryu_mc.crouch=false;
this.onEnterFrame = function()
{
if(ryu_mc.attack==false)
{
if (Key.isDown (Key.RIGHT) )
{
ryu_mc._xscale = 100;
ryu_mc.stance=1;
ryu_mc._x+=ryu_mc.step;
ryu_mc.gotoAndStop("walking");
}
else if (Key.isDown (Key.LEFT) )
{
ryu_mc._xscale = -100;
ryu_mc.stance=0;
ryu_mc._x-=ryu_mc.step;
ryu_mc.gotoAndStop("walking");
}
}
}
it is simply script in AS2 to ajke a character move left and right on the key getting pressed. any help igrating this to AS3 would be appreciated.
thanks
i have just started studying actionscript 3 at college and need some help migrating some script from 2 to 3. any help would be greatly appreciated:
ryu_mc.step=15;
ryu_mc.attack = false;
ryu_mc.stance= 1;
ryu_mc.crouch=false;
this.onEnterFrame = function()
{
if(ryu_mc.attack==false)
{
if (Key.isDown (Key.RIGHT) )
{
ryu_mc._xscale = 100;
ryu_mc.stance=1;
ryu_mc._x+=ryu_mc.step;
ryu_mc.gotoAndStop("walking");
}
else if (Key.isDown (Key.LEFT) )
{
ryu_mc._xscale = -100;
ryu_mc.stance=0;
ryu_mc._x-=ryu_mc.step;
ryu_mc.gotoAndStop("walking");
}
}
}
it is simply script in AS2 to ajke a character move left and right on the key getting pressed. any help igrating this to AS3 would be appreciated.
thanks