0 comments
11/14 2008

Learning ActionScript 3

I’ve been wanting to learn actionscript 3 for awhile now… bought the books last year… they’ve collected some dust to say the least… but now my own site is becoming antiquated and I need to catch up with the latest technology…. so I now have a real motivator…. lol.

In any case, I found that ActionScript 3 is a bit of a learning curve thus far… a few more lines of code to make things work and the “Script Assist” panel might as well be in Japanese…. but I am making headway. So for those of you who are trying to learn and are having issues with making a button work… here’s the code :). Hopefully it saves you some time.

ActionScript 2.0 Code

::::::::::::::::::::::::::::::::::::::::::
kadavy_btn.onRelease = function() {
getURL(“http://www.kadavy.us”);
};

ActionScript 3.0 Code
::::::::::::::::::::::::::::::::::::::::::
kadavy_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
navigateToURL(new URLRequest(“http://www.kadavy.us/”));
}

(the button on the stage has the instance name “kadavy_btn”)

Good Times… Good Times….

Troy Kadavy
92 West