Quick ActionScript 3 url question

Discussion in 'Graphics & Multimedia' started by Masteroa, Jun 10, 2010.

  1. #1
    Hey, I'm currently using the piece of ActionScript below to open a link when pressing a button. The problem is the link is opening in a new tab/window. What do I need to do so flash opens the site in the same window (the flash application will be placed on a website)?

    Netherlands.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    function mouseDownHandler(event:MouseEvent):void {
        navigateToURL(new URLRequest("index.php/destinations/netherlands"));
    }
    Code (markup):
     
    Masteroa, Jun 10, 2010 IP
  2. midwestkel

    midwestkel Greenhorn

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    This is how it should be:

    
    Netherlands.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
    function mouseDownHandler(event:MouseEvent):void {
        navigateToURL(new URLRequest("index.php/destinations/netherlands"), "_self");
    }
    
    Code (markup):
    See where I added ,"_self"

    If that doesn't work how you want it then change self to parent.
     
    midwestkel, Jun 11, 2010 IP