A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: this is probably REALLY simple

  1. #1
    Junior Member
    Join Date
    Dec 2000
    Posts
    14
    ok...here's the problem...

    i have a mc that is 89 frames long. at intervals throughout the mc, i have if/else statements that, depending on the value of a variable (rotCond), it will freeze that mc in a particular place. that code for the if/else statements is as follows (i think that's where the problem is)

    if (rotCond = 1) {
    gotoAndPlay ("about");
    } else {
    continue;
    }

    'about' is a label in the mc that takes it out of the loop that it starts in and changes it to something else, but whenever i run the movie, the mc hits the first statement and jumps right out of the loop to the 'about' label, even though there is an action in the first frame of the mc that sets rotCond to 0. and the loop goes back to frame 2, so rotCond is only set to zero once, jsut to establish the variable.
    anyone got an answer to this one?

  2. #2
    Senior Member
    Join Date
    Nov 2000
    Location
    Jerusalem, Isreal
    Posts
    254
    you're right - very simple yet annoying:
    if (rotCond == 1) {
    gotoAndPlay ("about");
    } else {
    continue;
    }

    pay attention to the == operator used to comper vars whereas = operator is to declare a var's value.
    cheers!


  3. #3
    Senior Member Leo Lima's Avatar
    Join Date
    Jul 2000
    Location
    São Paulo, Brazil
    Posts
    745
    Just a simple question...
    Do you really need that continue; in the else.
    If I get it right, continue is for use in for/while loops, and more often when you have code below it...
    I guess the code you wanna is just
    Code:
    if (rotCond == 1) { 
    gotoAndPlay ("about");
    Remember the less code the less processing time.

    Regards,
    Leo Lima

  4. #4
    Junior Member
    Join Date
    Dec 2000
    Posts
    14
    it worked...thanks a lot

    details, details, details

    heh

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