rcanu
rcanu

Reputation: 91

Saving a file in ActionScript 3.0 using FileReference

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.

Upvotes: 2

Views: 3423

Answers (1)

The_asMan
The_asMan

Reputation: 6403

Change your compiler settings to version 10

default is 9

Upvotes: 3

Related Questions