Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411423 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 18, 2024, 08:39:49 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Saving and loading text files in haxe - flash target
Pages: [1]
Print
Author Topic: Saving and loading text files in haxe - flash target  (Read 1910 times)
Noogai03
Level 6
*


WHOOPWHOOPWHOOPWHOOP


View Profile WWW
« on: April 12, 2014, 12:24:10 AM »

I've been trying to make an in-game level editor for my HaxeFlixel game, but I'm having some difficulty just saving and loading a text file!

It would be easy if I was using the windows or neko targets because there's a whole package, sys.io, with things like File.loadContents to do that for me, except those packages are disabled for the flash target for some reason -_-
It would be nice if I could just use the Windows target to compile to, except it seems so utterly hideous to use, with random compiler errors that disappear when I recompile, and things like FlxCamera.buffer (which I would really like to have for a mirror effect) just don't seem to exist in it...

So I'm trying to use the flash target. There seem to be various methods of LOADING text files - URLLoaders and Assets.getText being the easiest looking ones - but I can't find any way of WRITING the text file again when I've finished editing...

This is probably a stupid question; I came to Haxe from C# and virtually no knowledge of AS3 so I don't know these things, and google has been useless for once   Sad

EDIT: FileReference looks like it might be good. Am I looking in the right direction?

EDIT #2: FileReference seems to work. It's probably really hacky and I have no idea what this will do to my embedded assets but it seems to work for now...
For anyone reading this, this is the article that cracked it for me.
« Last Edit: April 12, 2014, 04:51:37 AM by Noogai03 » Logged

So long and thanks for all the pi
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic