Jump to content

Using public variables across keyframes - simple


fry2010

Recommended Posts

Hi its been a while since I tried my hand at AS3.

 

What I want to build is a questionaire. Not a basic questionaire, more like a decision tool. The user will answer one question at a time. When they give an answer they click the 'next' button which takes the timeline to the next question.

 

What I would like to know is how can I use a variable accross different keyframes?

 

Basically I am sending a request to a .php file from flash, which then checks to see if their email address is already stored in mysql. Now I also want to store their email address locally in flash so that I can use it thoughout the keyframes.

 

Lets say I have a keyframe on the timeline called 'question_1'. Here I have got the users email address and stored it as 'email_add'.

In the next keyframe called 'question_2' I want to use this email, so can I just do 'question_1.email_add' ?

 

The tutorial I am reading is http://www.gotoandlearn.com/play.php?id=50

 

Any help or guidance appreciated.

I thought I would just update this question and explain what I mean a little better....

 

 

1) The user enters their email in a text field

2) Keyframe 1 grabs this via the variable email_text = emailText.text

3) The user is then taken to keyframe 2

4) In keyframe 2 I want to use the variable email_text

5) Do I access this variable like keyframe_1.email_text ?

 

 

Basically I just want to use a variable created in the beggining keyframe and use for all keyframes.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.