A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: gotoAndPlay

  1. #1
    Member
    Join Date
    Aug 2001
    Location
    Connecticut
    Posts
    31

    gotoAndPlay

    I'm using Flash MX 2004 on a PC. Haven't used Flash since v5 so everything is different. I'm trying to get a submit button when clicked goes to a frame within a movieclip and I don't know the updated ActionScript programming to make it do that. (The submit button in not active, all it is doing is going to a frame that says "username and password did not match.") Any help on this would be much appreciated. THANKS!!

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    on(release){
    movieClipName.gotoAndPlay(5);
    }

    ...but its recommended to always use framelabels instead of framenumbers.

    on(release){
    movieClipName.gotoAndPlay("myFrameLabel");
    }

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Member
    Join Date
    Aug 2001
    Location
    Connecticut
    Posts
    31
    Here's my code I'm using but I'm getting an error:
    stop();
    on(release){
    lounge_content.gotoAndPlay("all_drinks");
    }

    This is the error I get:

    **Error** Symbol=drinks_menu, layer=actions, frame=86:Line 2: Mouse events are permitted only for button instances
    on(release){

  4. #4
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    You have to paste the code on the button, not in a frame.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  5. #5
    Member
    Join Date
    Aug 2001
    Location
    Connecticut
    Posts
    31

    gotoAndPlay

    That's what I thought too, but when I get into the button timeline it says in the action window 'Current selection can not have actions applied to it' What's up with that?

  6. #6
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Right-click the button on stage, and select Actions. That will bring up the Actions button window, where you should add your script.

  7. #7
    Member
    Join Date
    Aug 2001
    Location
    Connecticut
    Posts
    31
    Alright, sorry to be a royal pain, but I desperately need this to work. My button is in a movie clip. When in the button timeline, I right click the button and these are the options I have:
    Cut, Copy, Paste, Select All, Deselect All, Free Transform, Arrange, Break Apart, Distribute to Layers, Covert to Symbol, Timeline Effects, Check Spelling. I'm not sure if I'm right clicking the button in the right area.

  8. #8
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    I'm still on MX only, not on MX2004, and can't open a MX2004 .fla.
    So save a copy of your MX2004 .fla in a MX only format, using Save As... (under File) and changing the Document Type in the Save As... window. Attach your new MX .fla here.

  9. #9
    Member
    Join Date
    Aug 2001
    Location
    Connecticut
    Posts
    31

    gotoAndPlay

    I'm uploading the .fla file to my server. You can access it here:
    http://207.76.73.31/ideaz_help.htm

    Thanks for taking a look at it - our programmers have their hands tied and it's on my plate.

  10. #10
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Nice try but I get the Unexpected file format error!
    Did you save a copy in a MX only format, as I requested above?

    If so are you on MAC?

  11. #11
    Member
    Join Date
    Aug 2001
    Location
    Connecticut
    Posts
    31

    gotoAndPlay

    try again, it just finished uploading (there are 2 formats). I'm on a PC laptop

  12. #12
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Ok! Second one works for me! Downloaded! Doesn't mean I'll find out the problem, but will have a look in a few minutes... Got to finish another thread off first!

  13. #13
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Ok! well it's not frame 87 but 86, and your code should be...
    code:

    on(release){
    _root.recipes.gotoAndPlay("all_drinks");
    }



    Next problem is also that there's no frame labeled "all_drinks" on frame 225 of your "recipes" (that's the instance name, not "lounge_content"!) clip. But if you label that frame with "all_drinks", it should work fine...

    I've tested it with other labeled frames in the "recipes" clip and it works fine!
    Last edited by oldnewbie; 10-06-2004 at 02:24 AM.

  14. #14
    Member
    Join Date
    Aug 2001
    Location
    Connecticut
    Posts
    31

    gotoAndPlay

    oldnewbie -

    I got it to work using your advice! I can't tell you how much time you've saved me. You and the staff at Flashkit have been awesome and I've used this site many times in the past and have had found answers to my questions. I hope you know your worth.

  15. #15
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397

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