A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Action script help

Hybrid View

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    16
    I want to make it so you need a key to open a door. So I am using a variable. D will equal 0 when you get the key it will equal 1. So I am trying to make so if d=0 it will go to one place and if d=1 it willgo to another place. I'm not sure how to do this so can somebody please tell me how. Thanx.

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    If you only have two alternatives you can make it very easy. Like...


    if (d == 0) {
    gotoAndPlay("myFrameLabel");
    } else {
    gotoAndPlay("myOtherLabel");
    }

  3. #3
    Junior Member
    Join Date
    Jun 2002
    Posts
    16

    Thanks

    Thanks but for other times what if I had more than 2 alternatives. How would I do that?

  4. #4
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Then you make a new If statement for all the alternatives.


    if (d == 0) {
    gotoAndPlay("myFrameLabel");
    }
    if (d == 1) {
    gotoAndPlay("myFrameOtherLabel");
    }

    ...and so on.

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