| Package | net.flashpunk.utils |
| Class | public class Data |
| Inheritance | Data Object |
| Property | Defined By | ||
|---|---|---|---|
| id : String [static]
If you want to share data between different SWFs on the same host, use this id. | Data | ||
| Method | Defined By | ||
|---|---|---|---|
load(file:String):void [static]
Overwrites the current data with the file. | Data | ||
readBool(name:String, defaultValue:Boolean = true):Boolean [static]
Reads a Boolean from the current data. | Data | ||
readInt(name:String, defaultValue:int = 0):int [static]
Reads an int from the current data. | Data | ||
readString(name:String, defaultValue:String):String [static]
Reads a String from the current data. | Data | ||
readUint(name:String, defaultValue:uint = 0):uint [static]
Reads a uint from the current data. | Data | ||
save(file:String):void [static]
Overwrites the file with the current data. | Data | ||
writeBool(name:String, value:Boolean = true):void [static]
Writes a Boolean to the current data. | Data | ||
writeInt(name:String, value:int = 0):void [static]
Writes an int to the current data. | Data | ||
writeString(name:String, value:String):void [static]
Writes a String to the current data. | Data | ||
writeUint(name:String, value:uint = 0):void [static]
Writes a uint to the current data. | Data | ||
| id | property |
public static var id:StringIf you want to share data between different SWFs on the same host, use this id.
| load | () | method |
public static function load(file:String):voidOverwrites the current data with the file.
Parameters
file:String — The filename to load.
|
| readBool | () | method |
public static function readBool(name:String, defaultValue:Boolean = true):BooleanReads a Boolean from the current data.
Parameters
name:String — Property to read.
| |
defaultValue:Boolean (default = true) — Default value.
|
Boolean — The property value, or defaultValue if the property is not assigned.
|
| readInt | () | method |
public static function readInt(name:String, defaultValue:int = 0):intReads an int from the current data.
Parameters
name:String — Property to read.
| |
defaultValue:int (default = 0) — Default value.
|
int — The property value, or defaultValue if the property is not assigned.
|
| readString | () | method |
public static function readString(name:String, defaultValue:String):StringReads a String from the current data.
Parameters
name:String — Property to read.
| |
defaultValue:String — Default value.
|
String — The property value, or defaultValue if the property is not assigned.
|
| readUint | () | method |
public static function readUint(name:String, defaultValue:uint = 0):uintReads a uint from the current data.
Parameters
name:String — Property to read.
| |
defaultValue:uint (default = 0) — Default value.
|
uint — The property value, or defaultValue if the property is not assigned.
|
| save | () | method |
public static function save(file:String):voidOverwrites the file with the current data. The current data will not be saved until this function is called.
Parameters
file:String — The filename to save.
|
| writeBool | () | method |
public static function writeBool(name:String, value:Boolean = true):voidWrites a Boolean to the current data.
Parameters
name:String — Property to write.
| |
value:Boolean (default = true) — Value to write.
|
| writeInt | () | method |
public static function writeInt(name:String, value:int = 0):voidWrites an int to the current data.
Parameters
name:String — Property to write.
| |
value:int (default = 0) — Value to write.
|
| writeString | () | method |
public static function writeString(name:String, value:String):voidWrites a String to the current data.
Parameters
name:String — Property to write.
| |
value:String — Value to write.
|
| writeUint | () | method |
public static function writeUint(name:String, value:uint = 0):voidWrites a uint to the current data.
Parameters
name:String — Property to write.
| |
value:uint (default = 0) — Value to write.
|