onClick buttons in Actionscript 3
Actions are no longer applied directly to buttons in Actionscript 3. Instead all code can be placed on the main timeline. For a basic getURL you first createa function, then you add an Event Listener to the button instance. Code below:
———————————————–
function gotoPage(event:MouseEvent):void
{
var targetURL:URLRequest = new URLRequest(”http://www.sitedesignmagazine.com/”);
navigateToURL(targetURL,’_self’);
}
skip_btn.addEventListener(MouseEvent.CLICK,gotoPage);
———————————————–
Replace skip_btn with the instance name of your own button.
NOTE: For some reason WordPress converts my quotes (both single and double) to smart quotes or whatever. You will need to change those when you paste or you’ll get syntax errors.
August 1st, 2009 at 6:19 pm
I was just googling around about this when I stumbled on your blog post. I’m simply visiting to say that I really enjoyed seeing this post, it’s very clear and well written. Are you planning topost more on this? It looks like there’s more material here for future posts.
August 14th, 2009 at 1:24 pm
This is a great blog post. . It’s really nice and informative. Thanks so much.
January 10th, 2010 at 7:46 pm
thanks for sharing .