Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restoring sprites to original positions?

Status
Not open for further replies.

doobious

Technical User
Apr 13, 2001
2
US
I am trying to find a way to restore some draggable sprites to their original position within a shockwave movie. I am making a sort of interactive educational game. There are upwards of 75 sprites that the user soon has dragged all around the screen and I want them to be be returned to their pre-interaction state upon clicking a button.
Is there an easy way to do this?

Anything would help.
 
hi there. Actually this can be done is quite simple way.
First you declare a new property...call it... pOriginalLoc
and assign the original location to that variable.
Write a handler to re-assign the original loc back to the sprite.
example code below. Never tested the code.

-- For the draggable sprite
property pOriginalLoc

on beginSprite me -- On begin sprite, assign the location
pOriginalLoc = sprite(me.spriteNum).loc
end

on backToOriginal me -- being call when button is click
sprite(me.spriteNum).loc = pOriginalLoc
end

-- For the button to restore the original location
on mouseUp me
sendAllSprites(#backToOriginal)
end

Hopes this help.
Final words, if you are serious about getting help on director, you should visit the forum at director-online.com
A lot of expert there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top