A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Buttons in a movie controlling the main scene

  1. #1
    Junior Member
    Join Date
    Mar 2002
    Posts
    13
    Hi I thought this should be easy maybe I am doing somthign wrong, I have the main scene which I want to jump to different frames when a user clicks a nav item.

    I thought it may be easier to put the nav items in their own movie just to keep them together so I did and that is included on the main scene at frame 1 where the main movie stops and waits.

    Now the problem I have is that the buttons don't work when they are in their own movie, the on click event doesn't follow through.

    on (press) {
    gotoAndStop ("Scene 1", 5);
    }

    Which in my mind should work but it doesn't what am I doing wrong should I not have the buttons in their own movie?

  2. #2
    AKA [ Paul Bainbridge] webdreamer's Avatar
    Join Date
    Aug 2001
    Location
    Glasgow, Scotland, UK
    Posts
    3,320
    Insted of directing the buttons to scenes try using frame lables, i mean in the first frame of every scene give it a frame lable and direct your buttons to that.
    That should do it.

  3. #3
    Senior Member
    Join Date
    May 2001
    Posts
    225
    labels are one way, but just so you know why it isn't working for you - your button action is relative, in other words you are telling it to move to frame 5 of the movie clip. you need to tell it to break out of the movie clip first so use

    on (press) {
    _root.gotoAndStop (5);
    }

    the _root bit means the main timeline. at the same time you may wish to go to frame 5 of your movie clip with buttons on your main timeline. in this case you name your movie clip, for example 'fruit' and use this code

    on (press) {
    _root.fruit.gotoAndStop (5);
    }




  4. #4
    Junior Member
    Join Date
    Mar 2002
    Posts
    13
    Excellent thanks so much works a treat.

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