Hello everyone,
It has been a long time since I have worked with Flash, the last time was when AS 3.0 first came out and I am trying to remember how to write some simple actionscript 3.0 code, but it does not seem to be working. And I was hoping someone could help me with it.
I have a symbol, which is a button, named map_btn and when the mouse is over map_btn, I want it to play from scene 59.
And when the mouse clicks on map_btn , I want maps.google.com to open in the browser.
Here is the code I have so far, can someone tell me how to properly write what I explained above and what I am doing wrong in what I wrote below?
The stop is because there is an intro video before.
stop();
/*onHover actions*/
map_btn.addEventListener(MouseEvent.MOUSE_OVER, mapsHover);
function mapsHover():void
{
maps_btn.gotoAndPlay(59);
}
/* onClick actions */
var url:String = 'http://maps.google.com';
map_btn.addEventListener(MouseEvent.CLICK, goToMaps);
function goToMaps():void
{
var request:URLRequest = new URLRequest(url);
try {
navigateToURL(request, '_blank');
} catch (e:Error) {
trace('An error occurred');
}
}
I would really appreciate any help with this.
Thanks in Advance & Best Regards,
Team 1504