A Flash Developer Resource Site

Results 1 to 18 of 18

Thread: write textfiles from swf to local HD

  1. #1
    383,890,620 polygons nGFX's Avatar
    Join Date
    Oct 2002
    Location
    Germany / Ruhrgebiet
    Posts
    901

    write textfiles from swf to local HD

    (yet again another useless headline)

    anyway.

    have you ever thought "man would i like to write this text to my local disc?"

    i have! the last time i needed such a function i worked on cauldron and had to find a way to write the map.xml to disc.
    fscommand did not work anymore, trace wasn't the best choice either ... and doing copy&paste from a flash textbox with about 140k of xml ... nah ...

    a couple of days ago i started writing on another game engine/editor and had the same problem : how to get the text/xml from my editor to disk WITHOUT using a webserver and php/asp, trace or whatever ...

    so i wrote a vb wrapper around the flashplayer, added a "write", "append" and "setfile" fscommand and voila -> nGFX FlashPlayer+ was born.

    i thought it might be usefull for some of you, too.

    download and doc can be found here

    so have fun

    <olli/>

    ps: i may add some other usefull commands sooner or later, so add suggestions.
    pps: for those who think that this is to usefull to be freeware: send me 100bucks ...

  2. #2
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    I thought at first it was just a childish crush, that I'd get over it. But no, it's more than that. I love you.

    Cool as ever mate.

    Squize.

  3. #3
    You can also use just plain ole vbscript. Open the file object and write files.

    And if your running the file locally you can rename the .html file to .hta and it wont give you any security messages. Pretty cool, just used this in one of my latest projects =)

    Nugget

  4. #4
    Innovation = Cool Tyg's Avatar
    Join Date
    Feb 2003
    Posts
    339

    shared object

    i was wondering why you wouldn't just use a shared object

    myObject = SharedObject.getLocal("my_stuff_i_want_to_save_loc al");

    myObject.data.mytext = mytext.text;

    to save myObject.flush();

    or it saves automatically when exiting the swf

    theese are built in to actionscript

  5. #5
    Senior Member random10122's Avatar
    Join Date
    Mar 2002
    Location
    Sheffield, UK
    Posts
    1,747
    Because then it cant be save anywhere as, say, a .as file which can then be immediatly included into a project i guess...

    Nice idea mate, wish i had thought of it sooner!

    fracture2 - the sequel
    fracture - retro shooter
    blog - games, design and the rest

    "2D is a format, not a limitation" -Luis Barriga

  6. #6
    Yes we can tomsamson's Avatar
    Join Date
    Sep 2001
    Location
    Team Titan Secret Lair
    Posts
    4,666
    cool one,ngfx,what´s next? saving images and xml?
    i have quite some trouble this week,but i´ll work on my ed this weekend again

  7. #7
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    What would be truely fantastic from a map editor point of view would be a wrapper that could take a tile sheet and cut it up into tiles and then place each one into a movie clip.

    I don't know how feasable that would be, I know you can do it with Lingo, but VB ?

    Squize.

  8. #8
    Yes we can tomsamson's Avatar
    Join Date
    Sep 2001
    Location
    Team Titan Secret Lair
    Posts
    4,666
    you mean you import a big bitmap and the let the app cut it into tiles in theileheight and width you want?

  9. #9
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Yep!

    I find it a million times easier to just have one tilesheet / bitmap. Of course you'd need a way to convert your png / gif bitmap into a (temp) jpeg so it could be loaded externally.

    I did start to write a convertor for Tile Studio but the way it stores the map data is terrible ( It doesn't store them in the same order as on your tile sheet but in the order they are used in your map,so for every alteration your tiles are numbered differently ).

    I keep meaning to crack and write a map editor in Director that'll do all the cool stuff that I miss but I can't see it happening.

    Squize.

  10. #10
    Yes we can tomsamson's Avatar
    Join Date
    Sep 2001
    Location
    Team Titan Secret Lair
    Posts
    4,666
    after thinking about it,yeah,that would be quite a cool feature for a mapeditor.
    i´d like to have that feature for both directions:
    1.:having a library of tilegraphics,you can "draw" tiles on a tilemap,then let the app produce one bitmap of the current screen
    2.:import a big bitmap and break that up into tiles.

    you don´t need director for that,you can do that using flash,too.
    i used to extend my editor with each game i made with it,its a lot of work to do that (but to whom am i saying that )

  11. #11
    Senior Member random10122's Avatar
    Join Date
    Mar 2002
    Location
    Sheffield, UK
    Posts
    1,747
    After playing with it for a bit, ive decided it definatly needs to remember the last SWF file you used and the file you want the output to go to... otherwise its just as much hassle setting that everytime as it is copying and pasting the output by hand!

    fracture2 - the sequel
    fracture - retro shooter
    blog - games, design and the rest

    "2D is a format, not a limitation" -Luis Barriga

  12. #12
    Vox adityadennis's Avatar
    Join Date
    Apr 2001
    Posts
    751
    These links never work for me. I'll try again later

  13. #13
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    i think they did that "manipulating an image" thing over at www.bit-101.com with a php backend. you supply any image and it does funky things with it. it's one of the examples, can't remember which one though. sorry
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  14. #14
    Hype over content... Squize's Avatar
    Join Date
    Apr 2001
    Location
    Lost forever in a happy crowd...
    Posts
    5,926
    Yeah I've seen some stunning image effects with a PHP backend.

    That'd be great for your on-line editor but one for actual development you'd need to set up a local web server / PHP.

    Imaging Lingo is just perfect for that kind of thing anyway and I would have thought it would have been easier to do it in shockwave (?).

    Sorry nGFX for taking this thread off on a tangent.

    Squize.

  15. #15
    Phantom Flasher... Markp.com's Avatar
    Join Date
    May 2000
    Posts
    16,034
    Sorry, haven't got time to read the above, but the standalone flash player has an undocumented save feature to save to a text file, its in the fscommands, flashguru.co.uk had some info on it a while back.

    There is also an alternative standalone flash player with advanced functions like save and joystick controls, but I can't remember what the hell its called.

    They were advertising on FK so I think it will be reviewed somewhere

    Mark

  16. #16
    Yes we can tomsamson's Avatar
    Join Date
    Sep 2001
    Location
    Team Titan Secret Lair
    Posts
    4,666
    the save as txt file feature has been removed in the flash mx player.
    the different player which has extra functionailty markp spoke about is actually an app called flash studio pro which works similar to the thingy ngfx made (allows extra functionailty by using custom fs commands),it wraps your swf into an exe,adds the player to it and the extra commands functionality.its quite powerful but no freeware

  17. #17
    383,890,620 polygons nGFX's Avatar
    Join Date
    Oct 2002
    Location
    Germany / Ruhrgebiet
    Posts
    901
    thanx,

    and special thanx to Squize

    @random10122:
    added, upload around 1200h cet

    @Squize:
    What would be truely fantastic from a map editor point of view would be a wrapper that could take a tile sheet and cut it up into tiles and then place each one into a movie clip.
    it could be done, you'll have to readi the swf sdk ... do some programming and ...
    but i wrote a piece of software called "cut-it" 3 or 4 years ago to cut a bmp into pieces, but the output was bmp, too. i wrote a "grid-o-mat" which allowed you to create x*y tiles or tiles with x*y size.

    i wonder where i saved the project ...

    the other simple way to make this would be to create a mask for the large image and move the image around.
    but i guess it would be slow for scrolling.

    @tomsamson:
    i'm waiting ... but i just started to make my skins "dynamic" so no preview, too.


    info:
    i just had a look at "flash studio pro" it's fantastic but most of the things are pretty useless when you just want to dump some text out ... and 159$ for writing xml?

    anyway, i still hope you find it somewhat usefull <olli/>

  18. #18
    383,890,620 polygons nGFX's Avatar
    Join Date
    Oct 2002
    Location
    Germany / Ruhrgebiet
    Posts
    901
    save settings implemented

    <olli/>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center