View Full Version : A way to get/save x/y coordinates
12-19-2010, 04: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.
12-19-2010, 06: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.
12-20-2010, 12:17 AM
Thank you, just the information I was looking for.
vBulletin® v3.8.5, Copyright ©2000-2014, Jelsoft Enterprises Ltd.