View Full Version : GetPersistentData and SetPersistentData?
I notice in the 2.50 firmware it says that these functions were added for flash. As a flash developer I would like a little more info on the usage of the functions. Anyone know more details about them, I am interested in developing software for the device.
Thanks,
Bryan
thor2007
07-24-2007, 00:51
hi,
i will post the content of flash 8 help file:
element.setPersistentData()
Availability
Flash MX 2004.
Usage
element.setPersistentData( name, type, value )
Parameters
name A string that specifies the name to associate with the data. This name is used to retrieve the data.
type A string that defines the type of the data. The allowable values are "integer", "integerArray", "double", "doubleArray", "string", and "byteArray".
value Specifies the value to associate with the object. The data type of value depends on the value of the type parameter. The specified value should be appropriate to the data type specified by the type parameter.
Returns
Nothing.
Description
Method; stores data with an element. The data is available when the FLA file containing the element is reopened. Only symbols and bitmaps support persistent data.
element.getPersistentData()
Availability
Flash MX 2004.
Usage
element.getPersistentData( name )
Parameters
name A string that identifies the data to be returned.
Returns
The data specified by the name parameter, or 0 if the data doesn't exist.
Description
Method; retrieves the value of the data specified by the name parameter. The type of data depends on the type of the data that was stored (see element.setPersistentData()). Only symbols and bitmaps support persistent data.
Example
The following example sets and gets data for the specified element, shows its value in the Output panel, and then removes the data:
// At least one symbol or bitmap is selected in the first layer, first frame.
var elt = fl.getDocumentDOM().getTimeline().layers[0].frames[0].elements[0];
elt.setPersistentData("myData","integer", 12);
if (elt.hasPersistentData("myData")){
fl.trace("myData = "+ elt.getPersistentData("myData"));
elt.removePersistentData( "myData" );
fl.trace("myData = "+ elt.getPersistentData("myData"));
}
greets
Thanks a bunch. Have you tested it on the D2?
I stumbled on this function earlier but wasn't sure it was the right one because the iRiver Clix uses fscommand2("SetPersistentData").
I will give this a shot when I get home from work.
thor2007
07-24-2007, 12:54
sry... i don't have used this function yet on the d2.
greets
I couldn't get these to work.
fscommand2("SetPersistentData", "myData=10");
Seems to create a file in the flash directory.
The file has foreign characters as the name and the content. Not sure if this is the "persistent data" but it still doesn't seem to work. Also the file is way too large, around 200 megs.
Any help would be appreciated.
its korean because its a korean pmp. also, i dont believe its actuall 200mb because the player doesnt actually show that its using that much space.
vBulletin® v3.7.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.