Saving a file in ActionScript 3.0 using FileReference

3.4k Views Asked by At

Hi there I have a game in actionscript 3.0

I have been browsing the internet, I have found something like this

var file:FileReference = new FileReference();
file.addEventListener(Event.SELECT, _onRefSelect);
file.addEventListener(Event.CANCEL, _onRefCancel);

var ba:ByteArray = new ByteArray();
ba.writeUTFBytes(xmlUsers);

//save into drive
file.save( ba, "myXML.xml" ); 

But I get this error:

Call to a possibly undefined method save through a reference with static type flash.net:FileReference.

1

There are 1 best solutions below

1
On BEST ANSWER

Change your compiler settings to version 10

default is 9