Ultrashock Forums > Flash > ActionScript
AS3 - navigateToURL help please!

You are currently viewing our website as a guest which gives you limited access to forums, files and other resources.

Click here to join now for free, and start interacting with our members, download files and much more!

Click here if you are looking for our Flash files and other professional assets.
 
Post Reply | View first unread | Rate Thread Search this Thread | Thread Tools | Display Modes

#1
Bookmark and Share!
AS3 - navigateToURL help please!
Old 2009-07-03

Hello,

I'm trying to load another html page (what.html) when my swf gets to a point in the timeline. I'm using the following code on the frame where I want the new page to load but nothing happens:

Code:
var url:String = "what.html";
var request:URLRequest = new URLRequest(url);
try {
  navigateToURL(request, "_self");
} catch (e:Error) {
  trace("Error occurred!");
}
When I view in the Flash player a new browser window pops up but when I view in a web browser nothing happens...

As far as I can tell from searching around this is the correct code, but should I be using it differently?

Thanks
postbit arrow 1 comment | 169 views postbit arrow Reply: with Quote   
Registered User
tom121 is offline
seperator
Posts: 2
2009-07-03
tom121 lives in United Kingdom
seperator

Ultrashock Member Comments:
Isocase's Avatar Isocase Isocase is offline Isocase lives in United States 2009-07-03 #2 Old  
You can always use the ExternalInterface class to check stuff in the browser. In your try statement just add:
Code:
ExternalInterface.call("alert", request.url);
You should receive a javascript alert with the url that you are trying to get to. If you don't get the alert then you know Flash isn't making it to the code.
Reply With Quote  
Thread Tools
Display Modes Rate This Thread
Rate This Thread: