A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: gotoAndPlay question

  1. #1
    Senior Member tu_dor's Avatar
    Join Date
    Jan 2004
    Posts
    209

    gotoAndPlay question

    To go to another scene I use this:
    gotoAndPlay("scene", frame);

    How do I make the movie go to a scene that is a variable?

  2. #2
    Milk n' 2 shugaz Paleez. Sven Texas's Avatar
    Join Date
    Mar 2003
    Location
    Leeds, UK
    Posts
    158
    try
    var mySceneVariable = "EndCredits"
    gotoAndPlay([mySceneVariable], frame);

    I think

  3. #3
    Senior Member tu_dor's Avatar
    Join Date
    Jan 2004
    Posts
    209
    I've tried that and it doesn't work!
    Can anyone help me with this?

  4. #4
    Milk n' 2 shugaz Paleez. Sven Texas's Avatar
    Join Date
    Mar 2003
    Location
    Leeds, UK
    Posts
    158
    hmmmm ought to work...

    have you tried running a trace on the variable? it's possible that it isn't containing the correct data?

  5. #5
    Senior Member tu_dor's Avatar
    Join Date
    Jan 2004
    Posts
    209
    What's a trace?
    And what version of Flash are you using?

  6. #6
    Milk n' 2 shugaz Paleez. Sven Texas's Avatar
    Join Date
    Mar 2003
    Location
    Leeds, UK
    Posts
    158
    look up "Using the Debugger" in the flash help section.

    If you're doing anything with actionscript and you're not familiar with flash's debugging tools you've got a lot of headaches coming your way.

    I'm using Flash MX but the syntax for what you're looking for has been static since flash 5 I think. possibly even longer.

  7. #7
    Senior Member tu_dor's Avatar
    Join Date
    Jan 2004
    Posts
    209
    Thank you, but I solved it myself:
    First I declare a variable:
    code:
    scene = "\"illustration\", 1";


    Then the button does this:
    code:
    on (release) {
    gotoAndPlay(scene);
    }


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