SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Enthusiast kunondrum's Avatar
    Join Date
    Apr 2005
    Location
    Dearborn, MI
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Flash buttons open in new window

    Hey Guys-

    Im having a problem my flash(cs4/as3) buttons opening a new window rather then opening in the same window. I know i have to use some variation of "_self" to do this but im getting compilation errors. I thought if you dont specify then it should default to the main window. Ive listed my code below to give a better picture. Thank you in advance.

    -----
    stop();
    import flash.events.MouseEvent;

    var fathersbio:URLRequest = new URLRequest("bio.html");
    var kids:URLRequest = new URLRequest("children.html");
    var friends:URLRequest = new URLRequest("friends.html");
    var famnews:URLRequest = new URLRequest("famnews.html");
    var photos:URLRequest = new URLRequest("photos.html");
    var contactus:URLRequest = new URLRequest("contact.html");


    b1btn.addEventListener(MouseEvent.CLICK, bClick);
    b2btn.addEventListener(MouseEvent.CLICK, cClick);
    b3btn.addEventListener(MouseEvent.CLICK, dClick);
    b4btn.addEventListener(MouseEvent.CLICK, eClick);
    b5btn.addEventListener(MouseEvent.CLICK, fClick);
    b6btn.addEventListener(MouseEvent.CLICK, gClick);

    function bClick(event:MouseEvent):void{
    navigateToURL(fathersbio);
    }

    function cClick(event:MouseEvent):void{
    navigateToURL(kids);
    }

    function dClick(event:MouseEvent):void{
    navigateToURL(friends);
    }

    function eClick(event:MouseEvent):void{
    navigateToURL(famnews);
    }

    function fClick(event:MouseEvent):void{
    navigateToURL(photos);
    }

    function gClick(event:MouseEvent):void{
    navigateToURL(contactus);
    }
    Kunondrum

  2. #2
    Is Still Alive silver trophybronze trophy RetroNetro's Avatar
    Join Date
    Jul 2003
    Location
    Texas
    Posts
    6,883
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Try this:
    Code Actionscript:
    var fathersbio:URLRequest = new URLRequest("bio.html"), "_self");


Bookmarks

Posting Permissions

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