A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Button in MC won't go to scene

  1. #1
    Member
    Join Date
    Sep 2006
    Location
    Montreal
    Posts
    46

    Button in MC won't go to scene

    Hi,

    I tried searching for this, but the search keeps bringing up a blank page.

    I have a a movie and to keep it simple lets say I have 2 scenes:

    Main and Location (Location has a frame label on the first frame called "Local")

    In the main timeline I have a movie clip which contains a button. All I want to do, it when you press that button the Movie will go to the "Location" scene.

    I've tried the following, but none have worked.

    on (release) {
    gotoAndPlay("Location", 1);
    }


    on (release) {
    gotoAndPlay("Location", "Local");
    }

    on (release) {
    _root.gotoAndPlay("Location", 1);
    }

    on (release) {
    _root.Location.gotoAndPlay(1);
    }

    on (release) {
    _level0.gotoAndPlay("Location", 1);
    }

    on (release) {
    _level0.gotoAndPlay("Location", "Local");
    }

    I've run out of ideas. I've tried every combination of the above that I can think of and none have worked.

    Can anyone help?

  2. #2
    Member
    Join Date
    Sep 2006
    Location
    Montreal
    Posts
    46
    Ok, the search is working now.

    As far as I can tell F8 doesn't handle scenes as well as older versions (weird). So.. I've decided to scrap the scenes and just put everything in the main timeline with lables. That seems to work fine.

    Why have scenes if they are nearly useless?

  3. #3
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    good question! the commonly used workaround is to put a frame label on the first frame of each scene named the same as the scene itself.
    Evolve Designs Interactive Media
    the natural selection

  4. #4
    Member
    Join Date
    Sep 2006
    Location
    Montreal
    Posts
    46
    Tried it. Didn't work.

  5. #5
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    Labeling a scene frame does work.. if you can't get it working it's a scope issue. If the first frame of the Location scene has a frame label of 'Location' and you're calling it from inside a movieclip on the the main timeline, then the code below will do that.

    on (release) {
    _parent.gotoAndPlay("Location");
    }
    Evolve Designs Interactive Media
    the natural selection

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