A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Variables to control a movie Question!

  1. #1
    Junior Member
    Join Date
    Jan 2001
    Posts
    25

    Variables to control a movie Question!

    Lets see how to make this simple....

    I have 8 content plates, lets call them "states", as well as 8 navs at the top. These navs "call" the 8 various "states"

    The goal is to have the current "state" slide out to the left and a new "state" slide in from the right when a nav is hit. This would apply to all navs / states.

    One way to do it would be to do the 8 x 8 possible combinations of tweening between states possible- this is archaic [64 different ones!]

    Instead I know there must be a way to do using variables. For example when "state 3" is up and you hit the 5th nav, some sort of Actionscript would querry which state is up [3], command that specific state [3] to slide left, and slide the newly selected state [5] in from thr right.

    I know this sounds simple but I have done some AScript before I keep hitting walls here.

    Can anyone be specific and provide details on a way to do this? I have been using if then statements and it is not working for me [if state=3 then gotoAndPlay("3out") etc...]

    Please help! any ideas are welcome
    Jason

  2. #2
    Senior Member
    Join Date
    Sep 2000
    Location
    San Francisco
    Posts
    196
    maybe you are using the wrong operator in your if statement?

    1 equals sign is the assignment operator, 2 equals signs is a equality operator. you want to use == in an if stament like this:
    if(state==3){
    // do something
    }

  3. #3
    Junior Member
    Join Date
    Jan 2001
    Posts
    25

    Thanks Dev Flasher

    I will try out that solution. As you can see I have done some AS before but am not completely proficient. "Equality Operator" lesson learned!

    Just a quick question before I start into it again... With the 8 possible states of the site is an "if then' scenario the best way to go about it, in the sense that there will be 8 if statements for each button...? There might be a more streamlined approach.... although if I can use if then it might be simpler for my puny AS brain

    Thanks
    Jason

  4. #4
    Junior Member
    Join Date
    Jan 2001
    Posts
    25

    Did IT!

    Thanks so Much!!

    it worked with the if then's fine. Here is a simple test movie I was using and it works! instead of 8 there are only 3 in this movie but it will work the same....

    Thanks again DevFlasher!
    Jason
    Attached Files Attached Files

  5. #5
    Senior Member
    Join Date
    Sep 2000
    Location
    San Francisco
    Posts
    196
    Your Welcome. For simplicities sake your method of doing this will work fine.
    ~Dev

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