Guest lapointe2041 Posted May 21, 2009 Report Share Posted May 21, 2009 First, I would like to say that hate actionscript 3.0!!! I need to make a URLrequest with a Mouse Event and I can not for the life of me figure it out!! Here is my current code: web_btn.addEventListener(MouseEvent.CLICK,webClick); function webClick (e:MouseEvent) { new URLRequest("http://www.google.com"); } What needs to be fixed? THANKS!!! Quote Link to comment Share on other sites More sharing options...
Guest flamedude Posted May 25, 2009 Report Share Posted May 25, 2009 web_btn.addEventListener(MouseEvent.CLICK,webClick); function webClick (e:MouseEvent) { var link:String = "http://www.google.com"; var request:URLRequest = new URLRequest(link); navigateToURL(request); } That should do it for you. I know it looks more complicated than the getURL method though. If you want the getURL back again go to Senoculars website and you can download some classes that get some of the old easier AS2 coding methods back into your AS3 projects. Don't give up on the AS3 though, it does seem extremely daunting during your first few experiences with it but it is totally worth learning it. I kept delaying it for a long time but I finally got pushed to use it and it really has grown on me. Some things now take 3 times as much code to do (like the URLRequest) and other things are now 3 times quicker like XML integration so its sort of 2 steps backwards 3 steps forwards. Event handling may seem like a new and bizarre way of doing things but it really is a godsend in covering every possible situation and if you are smart you can use the same functions to handle almost every button and interaction in your flash. Never give up! Trust your instincts! - peppy hare Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.