PDA

View Full Version : A way to get/save x/y coordinates


Navy_Spitfire
12-19-2010, 03:09 PM
I was wondering if there is a specific way to get or save the x/y coordinates of a movieclip at a given time, ie- at 5 seconds the game saves the locations of the player, so if they die, they are sent back to the saved coordinate.

Heloed
12-19-2010, 05:03 PM
Do you want it saved within a session or saved so it can be recalled even if the game is closed and reopened?

Within a session is simply storing the point (http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/geom/Point.html) as a variable. If you want to save more than one then just create an array and .push each new point into the array when you want a 'save'.

If you want it saved saved you should look into shared objects (http://www.republicofcode.com/tutorials/flash/as3sharedobject/). They are fairly simple and are a must-have for most actual flash games.

Navy_Spitfire
12-19-2010, 11:17 PM
Thank you, just the information I was looking for.