A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: ON A DEADLINE: if troubles

  1. #1
    The Mayberry Flasher OpieNC's Avatar
    Join Date
    Oct 2000
    Posts
    388
    I am making a calendar. I am drawing a LOT of variables from a text file. one of those variables happens to be 1x1t

    the trouble is, my if statement is not working. I have the variable 1x1t set equal to 1 in my text file. my if statement looks like this:

    if (1 == "1x1t") {
    tellTarget ("_root.1x1") {
    gotoAndStop (2);
    }
    }

    I made sure I had my instance named and everything, so that isn't the problem. Yet still, the targeted movie clip does not go to frame 2.

    if anyone could tell me why the if loop isn't working, that would be GREAT! especially since I have to have it done in less than 10 hours.

  2. #2
    Member
    Join Date
    Aug 2000
    Posts
    40

    Check your structure

    For a start, instance names cannot begin with a number, and variable names cannot begin with a number

    Also - in your if conditional you put quote marks around your variable name, so it is now a string literal - eg actionscript is taking the literal interpretation of 1x1t - so does 1 exactly equal 1x1t? No. Just take the quote marks off it and rename your movie instance and variable name and it will work.

    If you're using Flash 5 get rid of the old syntax style and use

    if( 1 == variablename) {
    _root.instancename. gotoAndStop(2);
    }

    instead.

    // if (1 == "1x1t") {
    // tellTarget ("_root.1x1") {
    // gotoAndStop (2);
    // }
    // }
    [Edited by juztyn on 06-26-2002 at 03:40 AM]

  3. #3
    The Mayberry Flasher OpieNC's Avatar
    Join Date
    Oct 2000
    Posts
    388
    thanks a ton!

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