A Flash Developer Resource Site

Results 1 to 20 of 20

Thread: gotoAndPlay problems

  1. #1
    Professional Air Guitarist Frag's Avatar
    Join Date
    Dec 2002
    Location
    Brain, Body, Clothes, Computer Chair, Room, House, Neighborhood, City, State, Country, Continent, World, Galaxy, Universe, and on?
    Posts
    811

    gotoAndPlay problems

    I've asked about this several times, but no one seems to know the answer. I'm re-writing this to get my thread on the top .

    I have a movie clip that is mentally retarded. There is a button inside of the movie clip that has this action:

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

    This "special" button decides that it's not going to go to and play scene "lvl1" frame 1, but play the movie clip it is in.

    Any idea why this happens???

    -thanks again,
    Last edited by Frag; 12-15-2002 at 09:39 PM.

  2. #2
    :: rolla :: bluedot's Avatar
    Join Date
    Mar 2001
    Location
    home
    Posts
    273
    use this code
    Code:
    on (release) {
    _root.gotoAndPlay ("lvl1", 1);
    }
    -jake

  3. #3
    Professional Air Guitarist Frag's Avatar
    Join Date
    Dec 2002
    Location
    Brain, Body, Clothes, Computer Chair, Room, House, Neighborhood, City, State, Country, Continent, World, Galaxy, Universe, and on?
    Posts
    811
    thanks for responding, but it didn't work

  4. #4
    :: rolla :: bluedot's Avatar
    Join Date
    Mar 2001
    Location
    home
    Posts
    273
    what happens when you do that?

  5. #5
    :: rolla :: bluedot's Avatar
    Join Date
    Mar 2001
    Location
    home
    Posts
    273
    post your .fla, and ill have it fixed in a jiffy.

  6. #6
    Professional Air Guitarist Frag's Avatar
    Join Date
    Dec 2002
    Location
    Brain, Body, Clothes, Computer Chair, Room, House, Neighborhood, City, State, Country, Continent, World, Galaxy, Universe, and on?
    Posts
    811
    nothing at all.

  7. #7
    :: rolla :: bluedot's Avatar
    Join Date
    Mar 2001
    Location
    home
    Posts
    273
    post the .fla file

  8. #8
    Professional Air Guitarist Frag's Avatar
    Join Date
    Dec 2002
    Location
    Brain, Body, Clothes, Computer Chair, Room, House, Neighborhood, City, State, Country, Continent, World, Galaxy, Universe, and on?
    Posts
    811
    I would bit its too big

  9. #9
    Professional Air Guitarist Frag's Avatar
    Join Date
    Dec 2002
    Location
    Brain, Body, Clothes, Computer Chair, Room, House, Neighborhood, City, State, Country, Continent, World, Galaxy, Universe, and on?
    Posts
    811
    but*

  10. #10
    :: rolla :: bluedot's Avatar
    Join Date
    Mar 2001
    Location
    home
    Posts
    273
    sometimes its better to give the frame a label. label the frame "one" and make your code this

    Code:
    on (release) {
    _root.gotoAndPlay ("lvl1", "one");
    }
    -jake

  11. #11
    Professional Air Guitarist Frag's Avatar
    Join Date
    Dec 2002
    Location
    Brain, Body, Clothes, Computer Chair, Room, House, Neighborhood, City, State, Country, Continent, World, Galaxy, Universe, and on?
    Posts
    811

  12. #12
    :: rolla :: bluedot's Avatar
    Join Date
    Mar 2001
    Location
    home
    Posts
    273
    is it the advance button?



    i g2g, ill finish this with ya tommorow

    -jake

  13. #13
    Professional Air Guitarist Frag's Avatar
    Join Date
    Dec 2002
    Location
    Brain, Body, Clothes, Computer Chair, Room, House, Neighborhood, City, State, Country, Continent, World, Galaxy, Universe, and on?
    Posts
    811
    ypu have to lose... its the restart button

  14. #14
    Young Senior Member mayhem_sci's Avatar
    Join Date
    Jun 2002
    Location
    Singapore
    Posts
    282
    u can do the following: instead of posting your fla with your game, experiment with a simple movie to test whether gotoAndPlay a certain scene works. if it doesnt, meaning you have recreated the problem in a simpler scenario, post that fla. or, instead of gotoAndPlay scene, you can gotoAndPlay the frame number. i tested with your swf and it works. the thing with scenes is that even if its the first frame of a different scene, it's frame number still follows from the frame number of the prev scene, so it will always work. i used gotoAndPlay(30) in your swf, it works, but i suspect the number can be smaller.

  15. #15
    :: rolla :: bluedot's Avatar
    Join Date
    Mar 2001
    Location
    home
    Posts
    273
    is "lvl1" frame 1, the very beginning of the movie?? if so, why refer to the scene?? you could just have it like restart everything, i think that would be easier.

    _root.gotoAndPlay(1);

    i dunno how that could mess up?? unless its not getting through to the root timeline, which i dont see how it couldnt???

    -jake

  16. #16
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,786
    you must use framelabels in this situation...

    Code:
    //assuming the first frame of scene lvl1 is labled lvl1
    _root.gotoAndPlay("lvl1");

  17. #17
    Professional Air Guitarist Frag's Avatar
    Join Date
    Dec 2002
    Location
    Brain, Body, Clothes, Computer Chair, Room, House, Neighborhood, City, State, Country, Continent, World, Galaxy, Universe, and on?
    Posts
    811
    actually i just used:

    _root.gotoAndPlay(22)
    // where 22 is the frame number for the entire movie

    and it worked!!

  18. #18
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    Ha, I been testing this same thing myself. using _root.gotoAndPlay(??). It's really much more dependable than even frame labels. all ya got to do is be able to count.

  19. #19
    Developer
    Join Date
    Sep 2001
    Location
    The Bluegrass State Will Flash For Food ™
    Posts
    3,786
    Originally posted by iaskwhy
    Ha, I been testing this same thing myself. using _root.gotoAndPlay(??). It's really much more dependable than even frame labels. all ya got to do is be able to count.
    buut if you add one frame to the beginning of your movie you have to update all of your framenumber references... it's okay for the less complex things but framelables will be better in the long run and/or when updating or enhancing the movie...

  20. #20
    Registered User Ask The Geezer's Avatar
    Join Date
    Jul 2002
    Location
    Out In The Pasture
    Posts
    20,488
    I know, nothing is perfect, but I don't often add frames to the main timeline. Using root frame numbers works first time, every time. In the long run, I'll probably save more time doing it that way than trying to hunt down why my frame label isn't working.

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