A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: ActionScript 3 Link to same window

  1. #1
    Registered User
    Join Date
    Sep 2012
    Posts
    1

    ActionScript 3 Link to same window

    This shouldn't be as difficult as it is...

    Basically, I'm trying to build a navbar with flash. It's all together, but I can't get the link to open in a new window instead of the same window.

    I followed a guide on making the code, and then I added in "_self" to get it to open in the same window. But I get a syntax error.

    "Scene 1, Layer 'Actions', Frame 1, Line 8 1137: Incorrect number of arguments. Expected no more than 1."
    I take it this means I'm not allowed to have more than one parameter for the navigateToURL function...
    But I don't know where else to put it. It's exactly what it looks like I should do.

    Can anyone see the error of my ways?

    Code:
    import flash.events.MouseEvent;
    import flash.net.URLRequest;
    
    home_btn.addEventListener(MouseEvent.CLICK,gotoHome);
    
    function gotoHome(event:MouseEvent):void{
    	navigateToURL(new URLRequest("http://www.skillunionclan.gridhost.co.uk", "_self"));
    }
    T

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    navigateToURL(new URLRequest("http://www.skillunionclan.gridhost.co.uk"), "_self");

    URLRequest has only one Argument.
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Senior Member
    Join Date
    Jun 2008
    Posts
    549
    try using "_blank" to open in a new window instead of using "_self"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center