Thursday, January 17, 2008

Hyperlinking in Actionscript 3, a little more.

Oops. I looked over my last post and realized I had forgotten something. This is starting to become a habit. If you look at the last post, I had a line that went...

navigateToURL(myRequest);

This line should read...

navigateToURL(myRequest, "_self");

The extra argument, "_self" is the same as the _self target in an HTML hyperlink. It tells the browser to load the new page in the current browser window and not pop open a new one.

In Actionscript 2, the function...

getURL("http://www.adobe.com");

... did not need a target "window" argument if you wanted "_self". It was assumed.

In Actionscript 3 "_blank" is the assumed target window, so if you are like me and are running Firefox with popup windows turned off... absolutely nothing happens. No link. No warning. Nothing. Don't forget to add a target.

For even more information on navigateToURL(), here's a link to the livedocs help file at Adobe.


--Rich

No comments:

Post a Comment