2 Replies Latest reply on Nov 21, 2007 5:15 AM by Tal_CS

    sprite disappear after #seconds

    loeil-reve
      hello
      i am a beginner on director and I need some help
      how can I make a sprite dissapear after a specific time ..
      the idea is to make the sprite invisible, then it comes visible when we choose the right answer but after that I want this sprite to disappear after a while. how can I?
      i would be very grateful if you can help
      thanks
        • 1. Re: sprite disappear after #seconds
          Level 7
          in a frame script use something like this, which will ask you how many
          seconds you wish to wait:

          -------------------------------------------------------------
          property DelayTime
          global TimeChange

          property DelayTime
          global TimeChange

          on getPropertyDescriptionList me
          description = [:]
          addProp description, #DelayTime, [#comment: "Enter delay time
          (seconds)", #format: #float, #default: 30.0, #range: [#min: 0.001, #max:
          60.000]]
          return description
          end getPropertyDescriptionList


          on exitFrame me
          TimeChange = ((the ticks) + (DelayTime*60))
          end
          -------------------------------------------------------------

          Then in the sprite's script you can use something like this:

          -------------------------------------------------------------
          on exitFrame me

          global TimeChange

          if (the ticks)<TimeChange then
          sprite(the CurrentSpriteNum).visible = true
          else
          sprite(the CurrentSpriteNum).visible = false
          end if

          end

          -------------------------------------------------------------

          You'll need a "go to the frame" command somewhere to keep the play head
          from advancing past your disired point, of course.
          • 2. Re: sprite disappear after #seconds
            Tal_CS
            I use another technique, by creating New Timeouts. I suggest you lookup there reference for the keyword "Timeout".