Results 1 to 2 of 2

Thread: problems with linking buttons

  1. #1
    Join Date
    Nov 2011
    Posts
    24
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default problems with linking buttons

    Hello. This problem is very complex so I'll going to do my best in explain my question. How do I link a button thats embedded in frame 2 (music page timeline) to a frame in the main timeline ( frame 3= biography page)? Both pages are on the same scene with link buttons embedded in each page independent timeline.

  2. #2
    Join Date
    Oct 2006
    Location
    New York, NY, USA
    Posts
    258
    Thanks
    42
    Thanked 24 Times in 24 Posts

    Default sample AS 3.0 code

    I guess you are talking about buttons inside MovieClip symbols (which have independent timelines). I think it would make more sense to have Flash navigation buttons outside of MovieClip.

    The following code is not mine, but it is a good navigation example.

    Code:
    Scene 1
       Actions for Frame 1
          var myURL:URLRequest = new URLRequest("swfs/intro.swf");
          var myLoader:Loader = new Loader();
          myLoader.load(myURL);
          target_mc.addChild(myLoader);
       Actions for Frame 2
          stop();
          home_btn.addEventListener(MouseEvent.CLICK, goHome);
          function goHome(e:MouseEvent):void
          {
             gotoAndStop("$home");
             myURL = new URLRequest("swfs/intro.swf");
             myLoader.load(myURL);
          }
          web_btn.addEventListener(MouseEvent.CLICK, goWeb);
          function goWeb(e:MouseEvent):void
          {
             gotoAndStop("$w1");
             myURL = new URLRequest("swfs/w1.swf");
             myLoader.load(myURL);
          }
          print_btn.addEventListener(MouseEvent.CLICK, goPrint);
          function goPrint(e:MouseEvent):void
          {
             gotoAndStop("$p1");
             myURL = new URLRequest("swfs/p1.swf");
             myLoader.load(myURL);
          }
       Actions for Frame 5
          w1.addEventListener(MouseEvent.CLICK, loadWeb);
          w2.addEventListener(MouseEvent.CLICK, loadWeb);
          w3.addEventListener(MouseEvent.CLICK, loadWeb);
          function loadWeb(e:MouseEvent):void
          {
             gotoAndStop("$"+e.currentTarget.name);
             myURL = new URLRequest("swfs/"+e.currentTarget.name+".swf");
             myLoader.load(myURL);
          }
       Actions for Frame 20
          p1.addEventListener(MouseEvent.CLICK, loadPrint);
          p2.addEventListener(MouseEvent.CLICK, loadPrint);
          function loadPrint(e:MouseEvent):void
          {
             gotoAndStop("$"+e.currentTarget.name);
             myURL = new URLRequest("swfs/"+e.currentTarget.name+".swf");
             myLoader.load(myURL);
          }
       painting, ‹web_btn›
       home, ‹home_btn›
       design, ‹print_btn›
       INTRO, (Arial-Black, 24 pts)
       WEB DESIGN, (Arial-Black, 24 pts)
       PRINT DESIGN, (Arial-Black, 24 pts)
       1, ‹w1›
       2, ‹w2›
       3, ‹w3›
       1, ‹p1›
       2, ‹p2›
       inv, ‹target_mc›
    Last edited by auntnini; 12-04-2011 at 09:15 PM. Reason: add screen shot

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
  •