Advertisement
RandomGamer22

Saving Data with Haxe/Openfl

Apr 10th, 2016
1,065
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 0.45 KB | None | 0 0
  1. package;
  2.  
  3. import openfl.display.Sprite;
  4. import openfl.net.SharedObject;
  5.  
  6.  
  7. class Main extends Sprite
  8. {
  9.     var object:SharedObject;
  10.     var DataName = "Score";
  11.     var Data_Value = 13;
  12.     public function new()
  13.     {
  14.         super();
  15.         object = SharedObject.getLocal("File Name"); //Creates the File and saves it to local machine
  16.         potato.data.DataName = Data_Value; //DataName the name of the Data
  17.         potato.flush(); //Writes the Data to the file
  18.        
  19.        
  20.     }
  21.  
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement