Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-20-2006, 04:48 AM
Junior Member
 
Join Date: May 2006
Posts: 4
Default Can't get Actionscript variable

I have an swf (one frame only) with a text input box which has the contents assigned to a variable named "phrases".
I have used the following actionscript to link to a ffish script called "savePhrases", to try and save the variable to a file.

newBtn.onRelease =function(){fscommand ("ffish_run","savePhrases");}

The ffish script is as follows:

//savePhrases
var hp=FlashPlayer.getVariable("_root.phrases");
var filter = "Phrases(*.txt)|*.txt|";
var filename = Dialogs.fileSave(filter, ".txt");
if (filename)
{
file_stream = new FileStream(filename,"w");
trace(file_stream);
file_stream.write(hp+"xxxxx");

file_stream.close();

}//end of if(filename)
return true;

The button works fine and will open the save dialogue. It will save to file the "xxxxx" (put there as a test) but will do nothing with the variable. There are no error messages, so it seems the variable is recognised but its contents are not used.
What am I doing wrong??
Reply With Quote
  #2 (permalink)  
Old 05-20-2006, 07:42 AM
Junior Member
 
Join Date: May 2006
Posts: 4
Default Re:Can't get Actionscript variable

Success.
I think the problem was in where I placed the fscommand. I had it as its own function instead of putting it into the onRelease function of the save button.
Anyway it works now as good as gold.
Great prog.
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 03:43 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.