Um Design
10-28-2005, 09:52 PM
Yesterday I have tried 100 times to insert script to move, lets say to move one circle, I have named circle "Hero". This is the script for Flash 8:
_root.onEnterFrame = function ()
{
moveHero(5);
}
function moveHero(speed)
{
//check if key is down
if( Key.isDown(Key.UP))
{
_root.hero._y -=speed;
}
else if( Key.isDown(Key.LEFT))
{
_root.hero._x -=speed;
}
else if( Key.isDown(Key.DOWN))
{
_root.hero._y +=speed;
}
else if( Key.isDown(Key.RIGHT))
{
_root.hero._x +=speed;
}
}
Now, the question is how to insert code (Actionscript), I mean how to replace this actionscript that my cirlcle (Hero) move in Flash Lite 1.1.?
Thanks in advance
_root.onEnterFrame = function ()
{
moveHero(5);
}
function moveHero(speed)
{
//check if key is down
if( Key.isDown(Key.UP))
{
_root.hero._y -=speed;
}
else if( Key.isDown(Key.LEFT))
{
_root.hero._x -=speed;
}
else if( Key.isDown(Key.DOWN))
{
_root.hero._y +=speed;
}
else if( Key.isDown(Key.RIGHT))
{
_root.hero._x +=speed;
}
}
Now, the question is how to insert code (Actionscript), I mean how to replace this actionscript that my cirlcle (Hero) move in Flash Lite 1.1.?
Thanks in advance