RandomGamer22

Saving Data with Haxe/Openfl

Apr 10th, 2016
511
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×