Question : please change this AS2 to AS3? thank you!

Hi,

I have seen this tutorial; http://www.webdesign.org/web/photoshop/web-layout/create-a-glossy-animated-navigation-bar-using-photoshop-and-flash.9785.html the file is downloadable there.

but i am trying to work in actionscript three - is it possible to convert the code below?

this bit of code was attached to a mc. In the as3 i guess i will just name the mc and call a fuction in the actions? I am a bit of a beginner.

Thank you very much

Code Snippet:
1:
2:
3:
4:
5:
speed = .9;
setInterval(CursorMovement,30);
function CursorMovement() {
	arrow._x = speed*(arrow._x-_xmouse)+_xmouse;
}
Open in New Window Select All

Answer : please change this AS2 to AS3? thank you!

Hi Kikisu,

I'd like to help that way, but I just don't have the time for that.  

Your initial question asked about modifying that little chunk of code.  If you replaced that chunk with what I gave you then everything should work.  Just put the declaration inside the function:

function CursorMovement(evt:Event):void
{
      var speed:Number = .9
      arrow.x = speed*(arrow.x-_xmouse)+_xmouse;
}

What errors are you getting after this?
I'm stepping out and won't be seeing anything for 8 hours or so ...
good luck.


Random Solutions  
 
programming4us programming4us