dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Using "if"

  1. #1
    Junior Member
    Join Date
    May 2002
    Posts
    1
    Hi. I have trouble using the if statement. I think that this is because I am not sure how to make a valid condition.

    Here is an example of what im trying to do. Supose I have a variable and I say: variable = "hello". Then I make a button. On the button i say, on release:
    if (variable="hello") {gotoandplay (2);}}.
    But it will not go to scene 2. Like I said, i dont know much about setting or reading conditions, or whatever. I'm new at this stuff. I'm working for an info tech project for school and I need to know how to do it by monday. If someone can help me I'd be very thankful.

    alex

  2. #2
    Junior Member
    Join Date
    Jan 2002
    Posts
    29
    try this out:
    Code:
    if (variable == "hello") {
      gotoAndPlay (2);
    }
    notice the double equal sign, used to check equality, as opposed to the single equal sign, which is used to assign a value to a variable.

    let me know if this helps

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