Corsaair / redtamarin

AS3 running on the command line / server side
http://redtamarin.com
Other
119 stars 23 forks source link

FileStream #127

Open devlfm opened 6 years ago

devlfm commented 6 years ago

Hi,

I'm trying to use this to run server side, I need to load files, parse them and save/return a json.

I was trying to use FileStream like the example says here: http://docs.redtamarin.com/0.4.1T111/flash/filesystem/FileStream.html

but, as soon I import flash.filesystem.* and use File or FileStream, I get error "VerifyError: Error #1014".

Also, the method fileStream.readMultiByte(file.size, File.systemCharset); is not available :(

All I can do is "trace" ^^

I'm on windows x64, using flashbuilder. I was thinking on using my parser.abc on a linux server.

Any help is very welcome

zwetan commented 6 years ago

That's normal, the class FileStream etc. in package flash.filesystem.* are not available yet (as they depends on Event).

When this class will be available the method public function readMultiByte( length:uint, charSet:String ):String will only support "utf-8" for the charSet parameter.

In the mean time you can use the C functions in the package C.stdio.* to manipulate file streams: eg. fopen(), fdopen(), fwrite(), fread(), fclose(), etc.

or you can also use the FileSystem class in package shell.* to read and write files:

zwetan commented 6 years ago

as a side note, the Flash API are coming in the next few releases with events and everything there are not just there yet

devlfm commented 6 years ago

Hmm I'll give it a try! thank you @zwetan

devlfm commented 6 years ago

I was able to use FileSystem, but as soon I needed to import from flash the packages: import flash.utils.ByteArray; import flash.utils.CompressionAlgorithm; got the same error ^^

I'll wait for the flash packages then..

Thank you again

zwetan commented 6 years ago

you gonna have to provide more details, do you compile an .abc first ? which redshell are you using? did you try with redshell_dd ?

devlfm commented 6 years ago

Hi, I did not compiled .abc first, it is required?

I followed the tutorial of windows with flashbuilder

zwetan commented 6 years ago

no it's not required, but describe how you use it? I mean there is many ways so tell me about your setup