A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: conditions and variables

  1. #1
    Join Date
    Feb 2008

    conditions and variables


    I'm working under as2 with variables in a web site navigation, i want to create a condition, a simple condition, for frame controling but i'm not sure how to code it.

    I have the content_fade_out variable, whenever a user clicks a navigation button, the variable should be checked to see wich movie clip to play. I know i can do it with an if but, if i do it with a "if" I would need add 5 ifs to each button, while i think somethin like this can be done:

    variable value = Y
    y = 0
    y = 1

    and so on, I'm just not sure how to set the variable value condition.

    Thanks forward for who shows up in help =)

  2. #2
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    British Columbia
    I suggest this. put your 5 if statements at the end of the fade out transition, then simply fill the variable on the button.

    So if you have a contact button, in it's code you would just set the variable to 'contact'

    this.contactBtn.onRelease = function(){
    //goto the transition thing
    whereTo = "contact";

    then on the final frmae of the transition you'd having something like

    if(whereTo == "contact){
    //load up the contact stuff
    if(whereTo == "something).....
    Evolve Designs Interactive Media
    the natural selection

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