Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-30-2008, 06:23 PM
Junior Member
 
Join Date: Apr 2008
Posts: 1
Default new File() creates folder

Using AS3:

var file:SWFKit.File = new SWFKit.File("log.txt");

When this file doesn't exist, this will create a folder with the name "log.txt", instead of an empty file with that name. Is this the usual behavior?
Reply With Quote
  #2 (permalink)  
Old 05-01-2008, 08:50 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: new File() creates folder

If you want to create a file to write, please use the following code
Code:
var file = new SWFKit.FileStream("log.txt", "w");
file.write("sample\r\n");
The "File" object is used to get the attributes of an existent disk file. If the specified file does not exist, it will create a new folder, because in fact the "File" object and the "Folder" object are the same object.
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 05:11 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.