ActionScript 2.0 :: Refreshing Mc After Writing To Text File
Oct 29, 2006
I have a simple mc which loads in a textfile consisting of a header and body. After editing, the file is overwritten and saved. All this works fine, only problem is, as soon as the "save file" is finished, and i reload it using one of the buttons, it doesnt get refreshed with the new data.[code]
I am working on a survey project where I want a user's answers to get logged to a text file. I used the code from this post to make a php script in an attempt to do this: [URL]
I modified it as follows:
var urlLDR:URLLoader=new URLLoader(); var urlR:URLRequest = new URLRequest( "filewriter.php" ); var urlVar:URLVariables = new URLVariables();
[Code]....
When I run my movie, it does not invoke the PHP script. why it is not working? Are there alternative methods to logging this data to a text file?
I'm trying to find a way to write to a text file from as2. I don't want to use any php or asp because my app needs to run without an internet connection. As3 has FileReference.save() and judging by the amount of searching I've done, as2 doesn't have that simple of a solution. Does anyone have a way even if its hacky to write to a txt file from as2?
Is there a way where I can write to a text file from flash using Actionscript? I want to save some values from a variable and reload that values when i run flash again.
Is there a way to do file reading and writing in flash, like using actionscript 2.0? Just like how we do it in C++. Like read variables or a string from a .txt file and write in it.
I'm using flash and php to write or overwrite a text file (an xml file). I have text strings that contain the xml data, which then get parsed by the php file.
It works fine. However, I notice that the header in the XML file <?xml version='1.0' encoding='utf-8'?> get's replaced with <?xml version='1.0' encoding='utf-8'?>
I have a simple form in Flash. I need to write the data from the input text fields to a local text file. I need the text file to append after each submission of the form to include all entries. Sounds simple?
I am having a problem getting Flash to work with PHP as I need Flash to read and write to a text file on a server to store simple name/score data for a games hi score table. I can read from the text file into Flash easily enough but also need to write to the file when a new high score is reached, so I need to use PHP to do that. I can send the data from flash to the php file via POST but so far it is not working. The PHP file is confirmed as working as I added an echo to the file which displayed a message so I could check that the server was running PHP - the files were also uploaded to a remote server so I could test them properly. Flash code is as follows:
//php filewriter var myLV = new LoadVars(); function sendData() { //sets up variable 'hsdata' to send to php myLV.hsdata = myText; myLV.send("hiscores.php"); }
I believe this sends the variable 'myText' to the php file as a variable called 'hsdata' which I want the php file to write into a text file. The mytext variable is just a long string that has all the scores and names in the hiscore. OK, XML would be better way of doing this but for speed I just want to get basic functionality working, so storing a simple text sting is adequate for now. The PHP code that reads the Flash 'hsdata' variable and writes it to the text file 'scores.txt' follows:
I am trying to write a class file using a .as file instead of writing code into the script tab of a .fla file.When I write stage.addChild(img); I get an error that stage is null. When I take out stage, and just write addChild(img); the code runs fine, but nothing appears on stage. Do I need to do something to set a stage active?
Is this because I don't have a Main class? My class is named after the file and I don't have a file named Main.Here is the code. As it is, it runs and I get the two trace outputs, but no graphic on my screen.
package { import flash.display.DisplayObject; import flash.display.Sprite; import flash.display.Loader; import flash.events.*; import flash.net.*; public class HelloWorldImage extends Sprite { private var background:DisplayObject, foreground:DisplayObject; private var url:String = "hw_jpg.jpg"; private var loader:Loader = new Loader( ); public function
I'm having a problem refreshing an xml file. I am bringing it in through an HTTP service component and putting it into a bindable array _cattArr, that I am using as the dataprovider for a grid.When someone adds an item to the datagrid, it saves to the same xml file. Then I close the window, reopen it and don't see the item that has been added.It is writing to the xml file, because when I restart the flex app, the item has been added, it's just not refreshing it. I have tried to resend the httpservice, but still no luck. What is the correct process for doing this?
Alright. I've made a tool in flash that calculates the value of money in comparison to the value of goods avaliable. however, the values that my program is supposed to calculate wont update when variables are changed, how do i fix this?
[code]...
As a brief explanation, I have 4 sets of buttons (the code for the first two sets is in there), They Create goods that are used to back paper currency (amtGood and amtMon are the amount of goods and money). To calculate the dollar value of goods, the total money is devided by the total amount of goods. However it won't calculate anything but the original 10/10
I'm trying to make an AIR app that keeps loads a number from a webpage that is updated every 20 seconds. Basically it's a tiny app that will say how many calls are on hold.I've worked with some Actionscript 2.0, but 3.0 seems much more difficult to me.I used the following code to load the number from the url into a text box. I tried to use a timer to reload it and just can't get it right, and am not sure really what the best way to do it would be.
when i update the text files and press refresh on my website, the old text shows up in the dynamic text field, i have to actually close the browser and open the site again to see the new text, is there a way to have the text refresh using the refresh button?
I am wondering if it is possible to use random file access for reading and writing data to file in Actionscipt 3.0 similar to that what is in Visual Basic?
I do understand the differance between ssas and as3. Not all, but all most everything I see written in SSAS can be writen into a external AS3 file. This leads me to quite a few questions I'm hoping you kind people can shed some light on for me.
1) What is the advantage of writing a SSAS file over an external AS3 file?
2) Can I write an .asc file in AS3 or do I have to use AS1? Please understand I'm using tuts from fmsguru.com and the books "Learning Flash Media Server" (pdf) and "Programming Flash Communication Server". I'm not a javascript programmer so nothing I do in AS1 seems to make any sence while everything I do in AS3 does. It may not seem like it to you people that are programmers, but to those of us that aren't, AS1 and AS3 are miles apart.
3) kind of off topic, but a security question. I'm not a "hacker" and don't like the jerks that are. My question is on external AS / SSAS files and swf files. When my fla is compiled into a swf does my external AS files remain external? I assume they do, but then what is the threat of the swf being decompiled? In most projects I would do I could care less if somebody had access to my fla as long as they don't have my actionscript files.
I don't know. Maybe on questions one and two I'm getting confused becasue I'm using out dated material. Again I assume that even though fms was built off of the javascript engine it should be able to read and execute my AS3 file. Other wise what was the point of the evolution of actionscript into a fully functional programming language?
I have an menu for user to populate it. Then when the user finish, I would like to store his Order into an XML database. I do not know how to write to XML file in Flash.
I am using an include file, and I've noticed that sometimes the the fla file does not refresh new changes to my include file. When exporting with "Ctrl, Enter" Is Flash loading the include file from the cache?
i load in xml file so i can read the data. i've figured out how to add, delete and modify data. but the problem is, is that even when i do that it only does it within flash it doesn't make the changes to the actual file.so i want someone to help me do this. so please help i've been at this for week and its time i ask you nice and incredibly smart people.
here is my file, its clean and organized as its something i whipped up for the sake of figuring this out.i found this, people say it allows you to save the xml data, which would work, if i have to delete a file i can do that, i know how to do that. the script i found to do this is below incase it helps you guys to help me.
is it possible to post to php in an .exe file instead of a .swf displayed inside a browser? If so, how? I figured if you just created the .exe on the server with the .php file in the same folder it would read it and work fine.
I have successfully read an XML file into my script and used the data.Very handy.Now, I want to be able to create an XML file and save it.I have seen in the documentation how to add a child and so on - so I think I can manage that bit.I assume that I can save a file (locally) - but how? I have not been able to find a 'save'.
I have looked far and wide but I can't find any resources on how to write to CSV files from flash AS3. I know that flash cannot write to it alone. I have used PHP before to write to a txt file but now I need to open a csv and insert/edit entries that are already in it.
I've got all these flash books, yet not one of them tells me if it's possible to write to a txt file. They show how to read from a txt file using loadVariables(), but not the reverse.
Well I've been trying for about 2-3 days with no success. I am using the POST method and its not working. I have gotten it to work before.... but I do not have the old files anymore. There is a text box on the stage with the instance name: textTxt the fla fla Code:
Code: var variables:URLVariables; var fLoader:URLLoader; var fData:URLRequest;
Anyone know of any code I can add to my project to keep a log of how many times a button is pressed? Ideally it would write to the disk with date/time stamp.