Writing To XML Files With PHP
XML is really cool, I'm amazed at how easy it is to use and what it can achieve. But now I'm wondering about what the easiest method of adding data into an XML file via PHP is. I'm somewhat proficient with PHP (and MySQL), just not too much. For instance we have an XML file like so.
Code: <news> <item> <heading>This is the heading!</heading> <content>Content! Blah blah blah blah blah blah blah!</content> </item> <item> <heading>This is the heading!</heading> <content>Content! Blah blah blah blah blah blah blah!</content> </item> <item> <heading>This is the heading!</heading> <content>Content! Blah blah blah blah blah blah blah!</content> </item> </news> So how would we go about adding item elements (of course containing headings and content) into our XML file via PHP? Are there any good libraries that do that or built in functions?
KirupaForum > Development > Server-Side (PHP, SQL, ASP.NET, etc.)
Posted on: 03-06-2005, 08:45 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Reading From Files, Manipulating Strings, Writing To Files....
Thanks for your time, if you know anything please help me with the following:
1) I have my movie www.web.com/web.swf that reads the contents of the file www.web.com/news.txt. The file is supposed to contain different notes referring to updates of a site (just an example)
2) Flash loads the text in a variable, right? How can i split it, considering i use as a splitting string something like "|splithere|"
3) How can i hold each update-note in a variable, like when i`m duplicating movie clipes, for example update1 should be held in u1, update 2 in u2 and so on... (or as visual basic used - i`m and ex vb'er - u(1) u(2) and so on)
Writing To Files
G'Day all,
I was wondering if there was any way to be able to write to a file in flash?? I am trying to write an application in flash for our office that will work on both mac and pc, and to do this i would like to write to a common file. Can anyone help??
Writing To Txt Files
HI everyone,
I have a flash file.in my flash file i have a variable called 'total';
which increments by 1 each time some 1 gets a question right. and decrements everytime someone gets a question wrong.
I want the score value & the players name to be save to a txt file on the clients pc.(a cookie) when the game is finished.
can some 1 tell me how to do this? OR do this using php or something...
this is the code for my last question in the quiz.
Code:
on (release) {
score = score+1;
gotoAndPlay("Scene 2", 1);
}
I want that variable score & name to be written to a txt file.
and also when the score & name has been saved to a text file. how do i call this information into a dynamic text box in flash.
Can some 1 else me please
Thanks
Writing To XML Files
Hey! I've seen the tutorial on how to read from XML files and I was thinking. Can you write to XML files too with flash? If so, can anyone here tell me how?
Writing Files?
So has anyone ever came across a solution for being able to write files (probably xml files) to the drive? someway through flash/javascript/VBscript?? I am thinking there isn't but thought I would ask. thanks. Also without any server capabilities ( such as PHP )..
Writing To Files
How do I get flash to write data to a text file or database file when a button is clicked, including the url of the current page. Thanks.
Writing To Text Files And PPC
hello all,
i need to know if u can write to text files i.e save a text field to file...is the a command like load variables?
I need this to work in flash 4 as i am working in the pocket pc flash environment....
Also anyone doing dev on the pocket pc flash? interested to know u...
maybe we can exchange stories...
Alvin.
Writing To Files In Flash5
Is there a way to write to a .txt file on a server from within Flash? I know I could call a perl script, or asp or whatever with the variables, but I want to do it without leaving the flash page... no new pages, etc...
Once the user clicks the Send or Save or Next button, (etc), then the flash program opens a text file, writes the vars and closes it... can you do that in Flash 5?
FMX Writing Text Files?
I was just getting ready to buy flash jesters jsave and netcheck, when I saw the flashmx announcement. WIll MX proivide the facilities to do these things from a flash projector?
1. check for internet connection.
2. write a text file.
I am building a desktop app that will load data from our live site and display it, but I need to be able to write to a text file on the hard drive so I can show the latest possible info (written to text file at time of last connection) if they are not currently connected. Hope some one can/will answer this... trying to save $300 (money is short here as everywhere).
Thanks in advance
Felix_Man
Writing Text Files
I'm doing a project where by it would be extremely helpful if options that a person selects in a flash movie file could be saved into a .txt file (...or possibly a cookie if necessary) so that when the movie is closed and then reopened, the previously set options are used to dictate variable settings.
If anyone knows how to write variables to a file, it would be very much appreciated?
Writing XML Files Via A Projector
Is there any way to write text or xml documents via a flash projecter. I know they took out the functions, but i am curious as to if any have found a workaround. Any and all help is greatly appreaciated.
thanks,
Nick
Reading/Writing Files In AS?
I'm using Flash MX 2004....I just need to know how to read and write to files. Are there functions that can do this?
Writing Files In Flash
hi all,
i want to know if i can write a "save.txt" which contains data from flash, and i dont wanna use PHP, ASP, CGI, PERL etc. Can shared OBJECT save data as a physical txt file? Does FSCOMMAND save work for MX?
I wanna know in simple terms whether writing data is possible with AS alone?
Writing Xml Files From Flash
Does anyone know any way of writing xml files out from Flash, so that I can produce xml documents on the fly?
I know that you can't do this directly with actionscript and Flash but if anyone knows of any workarounds I would be very very grateful!!
Cheers, Jimmy.
Writing To Text Files
hi,
i'm tryin to make a survey and i want to write the collected information into a text file and save the text file. After that i want to load from the text file and display the results in a certain way...
can anyone help me?
Writing External Files With AS
hello. i would like to ask everyone how to write files through actionscript. i know how to do it with coordination with php, but im tryin to make an offline application where i can save or edit txt files (or xml) without installing a server for php. if there is a php standalone that can operate quickly, that might work. or a javascript code that writes on files might work too.
Writing And Reading XML Files
I know that I can read data from a XML but I want to know if I can write in the XML file using only Flash not a 3th party program.And also if the files can pe stored on a local hard drive.If this is possible please give and address to a tutorial where I can used it.
Thanks a lot.
Reading And Writing To Files
i am trying to read and write to a file and would like some help please.
i have created a game and would like to store the high scores in a text file on the local computer.
i have an input text field where the player can enter the name, i would like to send this to a text file.
i also need to be able to read from this text file to compare the scores
and need to create the text file if there isn't one on the computer.
this is what i have typed so far:
var my_lv:LoadVars = new LoadVars();
my_lv.playerName = playerName.text;
my_lv.playerScore = Score;
my_lv.load("setscore.cfm", "_self", "POST");
i don't know if this is right, i have not had to do this kind of thing before and would really appreciate any help.
thank you in advance!
Writing Files With A Projector
Is there any way to write text or xml documents via a flash projecter. I know they took out the functions, but i am curious as to if any have found a workaround. Any and all help is greatly appreaciated.
thanks,
Nick
Writing To External .txt Files
How do you write to external .txt files so that you can read from them like this;
Code:
on (release) {
loadText = new loadVars();
loadText.load("hiscore.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
scoreBox.html = true;
scoreBox.htmlText = this.hiScore;
}
};
}
then there would be a text file called hiscore.txt and it would have
Code:
hiScore; 28000
for example
Writing Text Files
right i am current a relitive noob to flash, i know motion and shape tweens and not much action script, infact virtually nothing..
i want to place all the info from a text box, then pressing submit place this into a text file. is there a way to do this without using a external script php/asp/cfm/perl
Writing Files With A Projector
Is there any way to write text or xml documents via a flash projecter. I know they took out the functions, but i am curious as to if any have found a workaround. Any and all help is greatly appreaciated.
thanks,
Nick
Writing To External .txt Files
How do you write to external .txt files so that you can read from them like this;
Code:
on (release) {
loadText = new loadVars();
loadText.load("hiscore.txt");
loadText.onLoad = function(success) {
if (success) {
// trace(success);
scoreBox.html = true;
scoreBox.htmlText = this.hiScore;
}
};
}
then there would be a text file called hiscore.txt and it would have
Code:
hiScore; 28000
for example
Writing Text Files
right i am current a relitive noob to flash, i know motion and shape tweens and not much action script, infact virtually nothing..
i want to place all the info from a text box, then pressing submit place this into a text file. is there a way to do this without using a external script php/asp/cfm/perl
WRITING External Text Files
There is loads of useful stuff about how to load vars into a Flash movie from an external text file, but I can't seem to find out how to WRITE me a text file in the FIRST place.
grrr..
any help appreciated.
Writing To External Files, Many Ways
Friends,
I need to write an external file from the Flash 6 player. I have looked at the shared objects stuff, but I can't be sure of the path (cross platform). I would like to avoid the PHP option, as this would be a SWF not running on a web server and I would have to send all requests to the same server, then retreive a result from that server by another app. I have toyed with using flash to send variables to JavaScript to then send to a Java applet, but I am hoping there is a 3rd party application which can help me.
Does anyone know of a 3rd party app that can either read info from a SWF in realtime or parse a SWF and retreive information. Mind you, all this must occur on the client without any web server interaction.
Any thoughts? I don't mind these apps costing money.
Actionscript Reading/Writing Files
I am creating an application which depending on a text file goes to a different frame. I need it to poll a text file every 20 secs (got a timer function wroking fine). I know how to read from a file as long as it is written a certain way, I just need to make this file empty once I have read the contents (i.e write over the file). Does anyone have any ideas on if this is possible just using flash and a text file,
Thanks,
Laura
[Help] Writing Remote Flash Files.
I would like to write a remote text file/files on a server. Say when someone presses a button the files will be written from a text box to a txt file. Is this possible? If so how? Thanks.
Writing To Files Directly From Flash
Hey
My flash movie has an admin version - which is identical to the original, except that the text boxes are editable (ie input boxes.) A submit button sends all the variables to a php pop-up which has an "ok" button which, upon clicking, writes the data to a file.
I was wondering if I could get Flash to do this directly (without using php?) - it would be nice for the admin guy not to leave the Flash movie.
I'd really apreciate clarification on this...
The two versoins are:
http://emma.dar.cam.ac.uk/~cdj21/smr...x.php?swf=main
http://emma.dar.cam.ac.uk/~cdj21/smr....php?swf=input
Cheers,
Chris
Reading And Writing On-line Files.
Is there any way in action script to read or write a file on the internet. Like the game reads a txt file on the internet that says:
_root.fred = 1
_root.guy._y = _root.grey
And then have those changes take place in the game your playing?
Or writing a file on the internet.
And how do I protect my swf files on the internet? Sometimes when I download something it won't let me import it to flash player because it says its protected.
Flash Writing Data Files
Hi all,
Wonder if you could help:
We have a potential kiosk project where we wanting to create an interface running on a touch screen which captures user data.
Now the machine will be running locally (2 machines infact) and we werewondering what the best approach would be to get flash to write to a text file (collecting user feedback) Think if it like a quick simple poll where users literally pick froma selection if 4 items and the data is stored.
The kiosk would be running IIS (handy) as I feel that Flash needs this to be able to write to a file using its local web server services.
I also see the flash runing as an exe maybe - with an FS command to get it to Full screen and run from startup - so the machine could be switched on and it automartically runs.
Anyone have any suggestions?
Writing And Reading Text Files
hi all,
Im roshan, a very fond enthusiast of flash and flashkit, I have a problem.I will start with an example,. I have a fill in text boxes. I want data from these text boxes to be written to a file, any text file. and I want my program to fetch these data and display them accordingly. I can retrieve them through XML. But how is the writing process done? How do i write to XML? Please help me out. Basicly Im doing a saving and retrieving flash program. Like a mini personal account database.
regards,
roshan
Writing Links In External XML Files
I'm pretty sure this has been asked before but I looked through the forums and didn't find the answer so here goes.
I'm trying to make a very basic news page with external content in xml. The xml content is formatted using css. Its almost entirely based on the Loading External XML formatted Content into Flash MX 2004 tutorial from actionscripts.org. Everything works fine but how do I create a link (href) in the external xml file. My xml knowledge is very basic so I feel like there's just something I'm missing.
Any help would be greatly appreciated. Thanks.
Reading And Writing To Text Files...
Hi,
I'm looking for a really good loadVars tutorial with examples of where and how I can load text files into input text fields, any ideas?
I can't seem to get data out of the file and onto the stage using the new method?!?!?!
Writing To External Text Files
I have an external file highscores.txt, which my game opens. It finds the 3 variables in it and compares them to the score that the user got and determines if they beat it or not. If they beat the high score, I want it to re-write the variables in the file, which are "name", "seconds", and "minutes". Here is how I open the file and get the data.
Quote:
loadText = new LoadVars();
loadText.load("highscore.txt");
loadText.onLoad = function() {
name.text = this.name;
seconds.text = this.seconds;
minutes.text = this.minutes;
highseconds = this.seconds;
highminutes = this.minutes;
};
Can somebody tell me how I can write in the file using flash? Thanks!
Writing Text Files From Flash
Is it possible to write a text file locally from Flash MX (which is running locally?) without using any server-side script; can MX write our text files independently?
Keypress In Flash MX 2004, Writing To Files
Does anyone know how to do either of these? I need to figure out a way for a button to check for someone to push the "c" key.
I also want to figure out how you can have flash write to a text file, if possible.
Thanks for any replies,
Spidy
Writing Code For A Container Swf File That Contains Other Swf Files
Since I have gotten no responses from the last message I will rephrase my question. I want to create a container that contains multiple swf files so that the swf files play one right after the other. Can someone steer me in the direction as to the Actionscript I may want to write for such a task?
URGENT: Flash And Vista -- Writing To Files
Hi -
I have a SWF that is being delivered with a separate application via CD. When the application opens the first time, it queries the OS for the locale (since Flash can't do that anymore), and writes a text file that reads: Country=xxx (where xxx is the name of the country). My SWF loads that text file in and uses the variable to display the pieces of the animation that pertain to the user's country.
The SWF is in helpflash. The text file is in helpxmlmenu. The ActionScript uses a relative path to load the text file. This works great in Windows XP. But in Vista, because these files are all in the "Program Files" directory, the application doesn't have admin privileges, so it can't write to the text file.
I was thinking about hard-coding the path to the Application Data folder, but since Vista could be installed on C: or D:, that won't work. Is there a way to query what the Windows installation drive is? Or can Flash query for registry entries?
I'm using Flash 8, AS 2.0.
Any other ideas? I'm desperate here -- the software's supposed to release in 2 weeks!
Thanks.
Miriam
Flash Publishing - Writing Over Older Files?
Wondering if anyone can offer suggestions on what I'm missing. I create a wonderful flash file.. with or without video. I publish the files and upload to the web. Everything works beautifully. However if ever I need to make changes (which is all the time) to the file, I go in and 'publish' again over the same files and upload to the net, I get a blank screne every single time. Before publishing, I test the movie and it appears to run wonderfully. I test the html file and it appears to run wonderfully. However when I upload to the net, I get 'nothing'.. nada.. zippo... I end up having to save the .fla file under an entirely new name and upload.. I would like to keep the same html page, but can't.. can anyone offer ideas on what may cause this? I'm running Flash 8 Pro and using Dreamweaver 8 to upload. Thanks ever so much!!
A Good Tutorial On Writing .as Files And Packages In 2.0
Was wondering if anyone could point me in the direction of a good tutorial on how to write and import from packages strictly from .as files written in actionscript 2.0
I googled but couldn't find anything of any serious use.
User Login - Writing Local Files From CD-ROM.
I'm working on a program that is going on CD and the web. The client wants to be able to have users enter a name and password, have the info saved locally and save some user data locally that can be accessed later. I looking for the best way to do this.
I've looked into using Shared Objects as well as using Third Party software like SWF Studio.
Does anyone have any ideas on the best way to handle this? I do not think the Shared Object will accomplish what I need to and I really prefer not using Third Party software. There is always the idea of using Director but I really do not want to do that either. The web version should be rather simple using Flash/PHP/XML or MySQL but I'm lost for the local CD version. Ideas?
Any help is greatly appreciated.
Reading And Writing 2 Text Files In Flash
my problem goes like this
i need to know how to read in a text file and then out put it
kind of like this
infile.open my_file.txt
infile >> name // name is a variable
and then later
outfile.open my_file.txt
outfile >> name
so basicly i need basic text input output
any ideas sug.
email twistis1@optonline.net
im wendys freak --- aol
thanks
Writing Files From Within Flash (local, Not Http)
Is it possible to generate a text document from Flash? I am trying to figure out how I can put a string into a new text document that resides local to the SWF. I know there are differences in security when you are local vs. http, so if anyone knows of a way, i'd greatly appreciate a point in the right direction.
Cookies work when you're using the same machine, but i'd like to use a text file to save some settings for use with a USB Flash drive or CD.
[CS3] [AS2] Creation, Loading, And Writing Variables To Text Files
I'm designing a Character Generator that needs to be able to retain the data, and notify the administration when a new character file has been created. So far, text seems to be the best way to go. Is it possible for Flash to create a new text file, populate it with variables and then later read from it?
Page 2 - Writing Files From Within Flash (local, Not Http)
Quote: Originally Posted by Tann San Heya, I think it will only execute .bat and .exe files. Other file types get opened by whatever the OS has setup to execute that file although as you've noticed some don't seem to work at all e.g. somefile.lnk
I think you might just have to get used to the brief flicker of the command prompt. Before they restricted most chars in the fscommands file path arg I would of recommended:
saveData.bat > NUL
which would usually hide all batch file output and probably the command prompt along with that.
ah. I'll probably switch to another language to make the exe. One that can definitely run as hidden or minimized on its own. Thanks for the help, this thing is looking good!
Importing Files/ Opening Files In Files/ Adding Files Into Scenes.
Alright Here is the deal.
I got some movies, which are seperate FLA. files, and I want to eventually add all these 4 seperate files, into scenes in one main FLA. file. How do I do this so that I have the symbols ect. I am pretty sure you can't just copy/paste.
Which FLASH** guru out there can lead me in the right direction?
greatly appreciated...
*g.guru.
Writing To Txt
Is it possible to write to a text file using mx? and nothing else.
|