1 Reply Latest reply on Aug 30, 2006 12:03 PM by Peter Lorent

    Problem with Particles

      I'm creating an animation where the user can drag charged particles to a ruler...if they're the same sign, they repel each other...if opposite signs, they attract each other...
      Here's a list of things I want to have happen but am having problems with....
      1. Particles pause for a second before beginning movement
      2. Particles stop moving when they come in contact with each other
      3. Particles delete themselves after a few seconds of contact
      4. Particles delete themselves when they run off stage

      there's also an Energy Bar that I haven't really dealt with yet...I'd like to get this straightened out first...

      I've attached the .fla...
        • 1. Re: Problem with Particles
          Peter Lorent Level 2
          Had a look at the code and, well it would take me quite some time to answer your questions using that code. So I typed up an example that uses functions to perform the actions you need. Basically I use objects to describe the particles and then pass the objects around using (properties of) the object as parameters for the functions. I've commented the code.
          In my fla I have a mc in the library called particle and it consists of a layer with a circle and a layer with a dynamic text field (instance name = particle_txt). I've put two instances of the particle mc on the stage (_y=40) -> instance names: particle_clip1 and particle_clip2. Attach the code on a seperate layer. Test movie and drag the two particles downwards (just like in your movie, only I didn't use a hitTest_mc). Hope this helps.