Reputation: 43
I have a mini game (ad for a website). I have them winning after "x" score and the page in flash goes from the game (frame 1) to the win test page (frame 2). Instead of it advancing to the next frame, I want once the score reaches "x" to go straight to a website / signup page.
I have components in the game calling out to outside as3 pages.....
if(_root.score > 50){
_root.gotoAndStop(2);
trace("You Won!" ); }
I have tried to add this line of code in.....
navigateToURL(new URLRequest("http://www.website.com"), "_blank");
Upvotes: 0
Views: 1205
Reputation: 15213
You need to import the Class first:
import flash.net.navigateToURL;
import flash.net.URLRequest; // You need this one too.
This is ActionScript 3. In ActionScript 2 you need to change navigateToURL(new URLRequest(..))
to getURL(..)
.
Seeing your code (_root
) made me think you are using ActionScript 2.
Upvotes: 2