A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Variables across scenes and how to call them

  1. #1
    Help Seeker
    Join Date
    Jun 2000
    Location
    NY
    Posts
    94
    A user clicks on a button in the Movie scene. In that button's action: IF the variable "access" = "True", it will proceed to the GetURL action. ELSE (if variable is not "True" OR DOESN'T EXIST) it plays the PasswordReq scene and requests the password. Then IF that password is 4 chars long, it will set "access" = "True" ELSE set "access" = "False".

    -----------------------------------------------------------
    Scene Name: Movie (a button's actionscript is the following)

    On (Release)
    If (access = "True")
    Get URL ("http://blah blah blah")
    Else
    Go to and Play (PasswordReq, 1)
    End If
    End On

    --------------------------------------------------------

    Scene Name: PasswordReq (password form with 1 textfield named password and a submit button)

    For the Submit button, here's the action:
    On (Release)
    If (Length (password) = 4)
    Set Variable: "access" = "True"
    Else
    Set Variable: "access" = "False"
    End If
    End On
    --------------------------------------------------------

    --> Now I have a feeling I have the button's IF statement wrong (MOVIE scene). How do I check if a variable named "access" (set in another scene) was set to "True" or not? Will it work if the variable "access" was not declared/set yet? Where are these variables stored and can they span scenes? Thank you guys in advance!
    [Edited by rh71 on 11-26-2000 at 04:07 PM]

  2. #2
    Senior Member
    Join Date
    Aug 2000
    Posts
    2,235
    Have you tried access eq "true"
    If you set a variable in the main timeline it will be effective across all scenes.
    Use 'Trace' action and verify in test movie to see if your vars are in order. You can also make a text field to monitor them. Just name the field after the variable.

  3. #3
    Help Seeker
    Join Date
    Jun 2000
    Location
    NY
    Posts
    94
    you are the man... the 'eq' instead of '=' did it for me. Thanks!

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Posts
    2,235
    eq for string literal and = for expression.

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