A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: arrggg no time! can i set variables across _levels?

  1. #1
    can i set a variable in _level0 onRelease

    and have a movie in another level read this variable???

    for example...
    in _level0 user clicks button_b to go to scene_b
    tell target _level1/movieclip play
    in _level0 set variable "chosen_scene" = "scene_b"


    in _level1 movie clip hits keyframe at the end that says
    tell target _level0 goto "chosen_scene" and play


    this way the button tells the _level1 movie to play and then doesn't go to the next scene until _level1/movieclip is finished.



    help.. it is 12:24 AM and this is due in the morning.

    i thought i had it but now i am confised.... haha


    MORE HOURS IN THE DAY!!!!!!

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    911
    Well it was hard for me to tell what you wanted (its late here too) so Ill just answer the question in your first sentence:

    can i set a variable in _level0 onRelease
    YES...try this:

    Set Variable: "/level0:name"=value

    Hope that helps.

  3. #3
    crap...

    i meant can i set a variable in _level1 from _level0

    i assume it would be

    From inside level0 movie

    Set Variable: "/level1:button_clicked" = button_x

    if so,
    thanks.

  4. #4
    Senior Member
    Join Date
    Jun 2000
    Posts
    911
    Originally posted by kcorcoran
    i assume it would be

    From inside level0 movie

    Set Variable: "/level1:button_clicked" = button_x

    if so,
    thanks.
    Yep thats it exactly.

  5. #5
    ahab,
    hoping you are still awake...

    what is the correct syntax for this....

    in level0 i have

    Set Variable: "_level7:nextscene" = "photo-nav"
    Begin Tell Target ("_level7")
    Go to and Play ("wipe1")
    End Tell Target



    in level1 i have

    Begin Tell Target ("_level0")
    Go to and Play ("nextscene")
    End Tell Target


    the variable "photo-nav" is actually a label in level0 movie and i want level1 to make level0 go to that label.


    my email is
    [email protected]

  6. #6
    Senior Member
    Join Date
    Jun 2000
    Posts
    911
    Whoa!!! This is one confusing set up you got here. I think this should do it:

    Begin Tell Target ("_level0")
    Go to and Play ("level7:nextscene")
    End Tell Target


    Not quite sure though. It gets confusing when you want to use variables from other levels to tell target a different level FROM a completely different OTHER level.

    Hope it helps.


  7. #7
    Senior Member
    Join Date
    Jun 2000
    Posts
    911
    Originally posted by kcorcoran
    ahab,
    hoping you are still awake...

    p.s. I had just turned off my computer and was going to force myself into bed but then I said to myself, "Who am I kidding!?!"...so I fired up the ol' computer and saw your email.

  8. #8
    Senior Member
    Join Date
    Jun 2000
    Posts
    911
    Oh wait a second...in my previous post I think the go to and play SHOULDNT have any quotations...its a variable right?

  9. #9
    yes....

    here is the gist of it....

    click a button in level 0
    set a variable (button pressed)
    play a trasition movie in level 7

    when level 7 transition movie is finished
    tell level 0 to go to the label that corresponds to (button pressed)

    oh man.... this is weak.

    time for sme caffeine.

  10. #10
    Senior Member
    Join Date
    Jun 2000
    Posts
    911
    Well instead of passing variables all over the place try this:

    On the button:

    On (press)
    Set Variable: "nextscene"="label"
    End On

    On last frame of transition movie in level7:

    Tell target (level0)
    Go to and play (nextscene)
    End tell Target

    Try that and tell me if it works.

  11. #11
    ok... here is what i did....

    in level0...

    On (Release)
    Set Variable: "label" = "Photo-Nav"
    Begin Tell Target ("_level7")
    Go to and Play ("wipe1")
    End Tell Target
    End On

    in level 7

    Begin Tell Target ("_level0")
    Go to and Play (_level0:label)
    End Tell Target

    loks like it worked....
    going to do a little testing...

    what a pain in the a$$.

    could have did that hours ago... is it me or is it common to make things a lot more difficult then they need be....


  12. #12
    WOOOOO HOOOOOOOOOOO!!!!

    3am and i got it.... now all i have to do is......

    cut and paste preloaders, and other crap i am to tired to think about....


    THANKS AHAB!!!!!

    get some zzzzzzz

  13. #13
    Senior Member
    Join Date
    Jun 2000
    Posts
    911
    No problem...and I probably should get some zzz too!

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