3 Replies Latest reply on May 4, 2007 2:29 PM by kristiehewlett

    loop and more

    kristiehewlett
      game can be downloaded from https://lamp.cpcc.edu/~klh46d02/kris

      Question 1 of 3

      Frame 10:I have 8 items, and when they are all moved to _x = 800,one at a
      time onrelease, I want the timeline to move to frame 11.
      Below I have the script I wrote so far, that isn't working. Please tell me
      how to write this script correctly. How can I make it loop?
      l01-l08 are the descriptions on the right of the page.

      if ((_root.l01._x == 800) && (_root.l02._x == 800) && (_root.l03._x ==
      800) && (_root.l04._x == 800) && (_root.l05._x == 800) && (_root.l06._x ==
      800) && (_root.l07._x == 800) && (_root.l08._x == 800))
      {
      gotoAndPlay(11);
      }
        • 1. Re: loop and more
          Rothrock Level 5
          You need to rethink how you approach this. Basically everytime you put an item at 800 (I assume there is some snapping or guiding since nobody will be able to hit exactly 800 eight times in a row) you want to check if all the items have been put there. Instead of checking the items, just keep a count of how many items are at 800. If items can be moved off 800 you need to then subtract one everytime one that was there is removed.

          The code below is something I just made up of the top of my head and I haven't included a way to help folks hit 800 or what happens if they try and drag things off the stage, etc. But it should give you the general idea.
          • 2. Re: loop and more
            Rothrock Level 5
            Whoops. I think I got a curly brace in the wrong spot. I think this is more likely what needs to happen.
            • 3. Re: loop and more
              kristiehewlett Level 1
              I do certainly appreciate your help!