Why doesnt this work?
I have created a Variable called savedFrame and then If its undefined it automatically turns into the green skin.
I open my Skin's menu, and press the Blue Skin button and it changes the data of the main character to the blue frame, and on the blue frame it tells it to save the data of savedFrame to the current frame, but when I reload the game; it isn't loading the blue skin...
Any help to where im going wrong ? Here are some code snippets (where, and how I'm using them)
ROOT FRAME
var savedFrame:Number = _root.so.data.savedFrame(); //Create savedFrame variable and link it to Save Data
//
if(so.data.savedFrame != undefined) {
_root.so.data.savedFrame = _root.char.mainchar.gotoAndStop("greenchar"); //If savedFrame unknown, auto change to green skin.
}
else{
_root.char.mainchar.gotoAndStop(_root.so.data.savedFrame); //If savedFrame not undefined, use savedFrame's data.
//
}
BLUE SKIN BUY BUTTON
on(release){
gotoAndStop(1);//Closes Skin Menu
_root.so.data.savedFrame = _root.char.mainchar.gotoAndStop("bluechar");//Changes savedFrame Data to Blue Skin frame.
}
ON MAINCHAR BLUE SKIN FRAME
var so:SharedObject = SharedObject.getLocal("PHONEGAME");
_root.so.data.savedFrame = _currentframe();//Save current frame as savedFrame's data.
THANKS TO ANYONE WHO CAN HELP ME
"Don't quote me boy cause' I ain't said shit" - Eazy-E