Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-14-2005, 02:43 PM
Member
 
Join Date: Apr 2005
Location: Antwerp, Belgium
Posts: 40
Default current path of application

I want to update a text file located in the same folder as my project.
The path to the file is relative, e.g. "/xml/myfile.xml"

But I suppose that a relative path does not work with FileStream(fn, data) ... so how to convert the relative path to an absolute one?


This is what I'll have already:

var fn = FlashPlayer.getVariable("_level0.fn")
var data = FlashPlayer.getVariable("_level0.data")

trace(fn) //this returns "/xml/settings.xml"

//so here we need a conversion from relative to absolute path, right? :-\

var file_stream = new FileStream(fn,"w");
file_stream.write(data);


tnx,
Gert
Reply With Quote
  #2 (permalink)  
Old 04-14-2005, 02:59 PM
Member
 
Join Date: Apr 2005
Location: Antwerp, Belgium
Posts: 40
Default Re:current path of application

hm, I did find the answer myselve ...
this was the command I was looking for: getAppDir();

so here's the working code:


var path = getAppDir();

var fn = FlashPlayer.getVariable("_level0.SwfKit.updateFile .fn")
var data = FlashPlayer.getVariable("_level0.SwfKit.updateFile .data")
trace(data)
trace(path + fn)

var file_stream = new FileStream(path + fn, "w");
file_stream.write(data);
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:52 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.