13.08.2012 Views

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

ACTIONSCRIPT 3 Developer’s Guide en

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ACTIONSCRIPT</strong> 3.0 DEVELOPER’S GUIDE<br />

Working with the file system<br />

You can also perform a random-access write to the file. For example, you could parse the id3Title variable to <strong>en</strong>sure<br />

that it is correctly capitalized (using methods of the String class), and th<strong>en</strong> write a modified string, called newTitle,<br />

to the file, as in the following:<br />

fileStr.position = file.l<strong>en</strong>gth - 125; // 128 - 3<br />

fileStr.writeMultiByte(newTitle, "iso-8859-1");<br />

To conform with the ID3 version 1 standard, the l<strong>en</strong>gth of the newTitle string should be 30 characters, padded at the<br />

<strong>en</strong>d with the character code 0 (String.fromCharCode(0)).<br />

Last updated 6/6/2012<br />

699

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!