1 Reply Latest reply on May 10, 2006 5:18 AM by Dawntay

    Two things: How to remove sprites & prevent click

      I'm making a game and have run into two issues I just can't quite figure out.

      So the first one is:
      I have Flash animation sprites moving across the screen so the animations are undependent of the frames (its all just on one looping frame), I got that but on the mouseDown I want the sprites to be removed from the screen. Also to make things a little more complicated it would be nice to have after a click I'll switch the member to a new flash animation of the death for a set time then remove the sprite.

      And My second: I have a character shooting a gun then reloading, how do I prevent any mouse clicks while the reload animation is playing then allow clicks afterward. I've tried an if then with timer stuff but I just can't figure it out.

      Any help or links to something that would help is apreciated. Also I'm using Director MX (not 2004) if that makes much of a difference.

        • 1. Re: Two things: How to remove sprites & prevent click
          dont blame me if this dosnt work but here we go.

          Im assuming you want the sprite to dissapeer when its cliked as aposed to just any old click not that is make much diffrance.

          attach this script to your sprite.

          property spriteNum

          on mousedown me
          sprite(spritenum).visible = false

          to change a sprite on click.

          property spriteNum

          on mousedown me
          sprite(spritenum).member = member(5) --(or any other member that takes your fancy)

          if your wanting to do this on any click its much the same

          attach this to your famescript or any sprite for that matter

          on mousedown
          sprite(1).member = member(5)

          to point out the obvious you will have to change the (1) to what ever sprite number you are wanting to change or make invisible.

          as for your second part this is probably not the most glemorus way of doing it but it dose work

          global mytimer

          on mouseUp me
          if mytimer < the ticks then
          beep() --or what ever else you want to do
          mytimer = the ticks + (10*60) -- add a ten second delay
          end if

          hope this helps