Read & Write To An Xml File Or Database
I'm working on a new project & I need to develope a flash UI that can read from an xml, txt or database (any external input method) then have that data display in the flash interface. 1 example would be to have combo boxes that read from the database & display the info. Another would be to have simple input fields to enter in the data desired. Then when the user seclects their choices & hits the submit btn that data then gets sent off to a different xml, txt, or database.
So the question is dose anyone know where to find a good tutorial that would explain how to do any or all of these options?
Thanks
FlashKit > Flash Help > Flash MX
Posted on: 06-09-2004, 01:50 PM
View Complete Forum Thread with Replies
Sponsored Links:
How Can My Swf Read/write To A Mysql Database
i did a little actionscript until now, but here's a problem I don't have ANY clue: is there a possibility for my swf to read data out of a mysql-database?
???
and, 2nd problem: can the swf write to a mysql-database? Or do I have to post the data to a php-file and insert it from there?
I still work with flashMX, may be in MX2004 it is easy?
thank you for any idea
hrrrst
View Replies !
View Related
Flash Read/write To Database
Hi i recently have been experimenting with php and flash and mysql data base's.
I would like to do more stuff with this but i dont want to waste my time learning things that arnt the best. So im a bit confused as far as what these are , are they means to flash editing the database ?
ive heard of flash remoting , cold fusion,amfp, php , actionscript server or sumthing, so many things .....are they different ways of writing to the data base ? im confused. what I really need to know is, whats the easiest and fastest way to read and write databases ? eg shortest code and easiest to understand and the least stuffing around. Thanks!
View Replies !
View Related
[FMX] Creating A Simple Read & Write Database In Flash?
Hi everyone. I'm new here, nice to meet everyone ^^. I have some big problems(to me T^T) that I really need some advice about.
I'm working on this flash game right now and I need to implement a simple players database...
It needs to be both read and writable . Meaning, when the player register to save his character information , he needs to key in his email and a password and create an account. The account shall store that player's life amount, ammunition etc . All the infos are stored on an external file and retrieved again when the player logins to the game with the email as his login ID. Security issues are not the biggest concern here because its not exactly meant to be an online game and I don't think hacking would be something I need to worry about ^^'''
I've tried Xml with AS, but I realised that, that alone canot allow me to write the player's info into the xml file.
I'm not exactly an mySQL idiot...but I really have very(x2) rusty and limited knowledge of it. All the server topics confuses me and I've had no experience with Microsoft Access. I know neither Php nor ASP =(but they shouldnt be too hard to learn i hope>.<
I hope I've been clear in explaining. Sorry to trouble you folks here but can anyone suggest how I should go about this project? what are the programs necessary? Thanks in advance >.<
*prays someone replys soon*
View Replies !
View Related
[FMX] Creating A Simple Read & Write Database In Flash?
Hi everyone. I'm new here, nice to meet everyone ^^. I have some big problems(to me T^T) that I really need some advice about.
I'm working on this flash game right now and I need to implement a simple players database...
It needs to be both read and writable . Meaning, when the player register to save his character information , he needs to key in his email and a password and create an account. The account shall store that player's life amount, ammunition etc . All the infos are stored on an external file and retrieved again when the player logins to the game with the email as his login ID. Security issues are not the biggest concern here because its not exactly meant to be an online game and I don't think hacking would be something I need to worry about ^^'''
I've tried Xml with AS, but I realised that, that alone canot allow me to write the player's info into the xml file.
I'm not exactly an mySQL idiot...but I really have very(x2) rusty and limited knowledge of it. All the server topics confuses me and I've had no experience with Microsoft Access. I know neither Php nor ASP =(but they shouldnt be too hard to learn i hope>.<
I hope I've been clear in explaining. Sorry to trouble you folks here but can anyone suggest how I should go about this project? what are the programs necessary? Thanks in advance >.<
*prays someone replys soon*
View Replies !
View Related
Read And Write File
Hi,
I have a flash application runing localy to a PC, using the browser.
I want to read and write a text file on this PC in the same directory as the flash file one.
I don't want to use cookie as the text file.
I know how to read the file with "loadVariables()" but I don't know how to write.
How can I do it ?
Thank's
Michel
View Replies !
View Related
Can I Use Txt File To Read/write Values From It ?
Hi,
is it possible to use txt file to read values from it and to write new values in it.
I want to create presentation on CD which my users will use to read values about some products and later I will use data of products for calculation of price (depending of product, quantity and discount).
Also can I write cookies from Flash so that I store user info on their computers ?
Thanks,
Oliver
http://www.smarttrain.de
View Replies !
View Related
Read/write From A Text File
hi
i have a text file which has two columns each seperated by a tab spacing.i want to read those contents and put in two arrays ,first array holding the first column value and 2nd having the 2nd column of the file.after that i want to write back the array contents back to the file in the same format.how to do it?
bye
geethanandh
View Replies !
View Related
Read/write To Text File
I am unable to find any Flash functions that are able to read and write text data to a text file on the user's computer.
I am assuming that this is possible, either through javascript or maybe a flash MX function, but I would ideally like to use it in Flash 5.0, so the javascript option may be better, anyone got any code for this?
View Replies !
View Related
Read & Write To File Question
hi... was looking for some info on how to "open" a txt file from flash and to be able to write to it... and then reaccess it with the file modified... (read and write and erase some parts of it if necesary).
reading from a file is no problem.. the point is i cant find info on how to write on the txt file (without usting php or any other of that kind).
Is there a "simple" solution to that ?
tnx in advance for the help.
View Replies !
View Related
Read And Write To External File
I have a game where i would like to save a score to a local text document that stores highest scores. i would like to then be able to read from this file to display a high score table. Any ideas where i can start with this?
thank you
View Replies !
View Related
Read And Write To File From Flash. AS Only
Hey guys.. i have a question.
using the stand alone flash player, is there a way to read and write to a file using just actionscript? no using server side scripting at all. i would like to develop an exe file that will allow me to do this from within my company so that there is no use for accessing the internet or installing any programs. I need to be able to access and write to a drive.
if any one knows how this could be achieved... even a glimpse at all as to how this could be done.. or what i should start researching, would be very appreciated.
thanks for your time.
View Replies !
View Related
Read/Write To External File From Flash...
OK. I posted a query on this board on the 4th and have had no solutions posted.
So here's my new idea!
Is it possible to write to read and write to a text file from Flash?
I don't mean that I want to display any of the text from the file, but instead I want to make it a binary variable for input - like an "ON" / "OFF" switch for a light.
I'd like to have one movie level write to the text file either a 1 or a 0, depending on which frame it's on.
Then I need to have another movie level check that level and input the 1 or 0 in an "if" / "else" statement that would lead it to one action if the other movie is in the 1 position and another action if in the 0 postion.
Any ideas? Can this be done?!
View Replies !
View Related
How Can I Read / Write Data To A Local File?
I would like to read and write data to a local file on the PC running the flash movie so I can keep track of high scores etc. I don't want to read and write the data to a web server. Can this be done with actionScript? I will learn XML if this is the only way to do it. Can anyone help me?
View Replies !
View Related
Write Failed - File In Use Or Read Only Error
I have a 50kb file with code that pulls in outside swfs containing flvs. I went to save my file, and windows gave me a write failed, make sure the file is not in use or a read only error. So, panicked, I clicked save as. This deleted the file from the directory and left the program only in memory. I then tried to save it to a different hard drive, different folders, etc. And nothing worked. The folder that I was working in also had the same error when I tried to rename it. Only when I closed flash, could I rename the file. This error has been reproduced several times...and on different machines. What's going on?
View Replies !
View Related
Read / Write To External Text File From Flash
Hi pieps,
I hope someone can help me out here.
I am trying to make a banner that shows percentages from a external text file. The percentages are showing the interest on a morgage for 1 year, 5 years 10 years. So the banner is showing more then one percentage.
I have come so far that the banner is showing the percentages from a external text file. I added the %-sign in the action script.
All working fine until now....
Now what I want is to ba able to change the percentages through the banner. So I was thinking of a hidden button on the banner that brings you to a password field. If correct password, leads you to a input box (or 3 input boxes). Here you can insert the new percentages and then click on GO!
The flash movie should then 'talk' to a php-script that writes the new percentages to the external text file where the flash movie is reading the percentages from. So the next time someone will view the banner, they will see the new percentages.
But you know how a external text file, where flash reads it's info, looks like.... percentageOneYear=2&percentageFiveYear3&.... etc.
How does the php-file know how to change only the right number?
Can anyone help me with that last part (php part).
That would be very helpfull.
Maby my way is not the best or the easyest, so help on more then only the technical level would be more then welcome.
View Replies !
View Related
Read And Then RE-WRITE XML...
I have the following bringing XML into Flash...
ActionScript Code:
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML;
var newValue:Number;
xmlLoader.addEventListener(Event.COMPLETE, loadXML);
function loadXML(e:Event):void
{
xmlData = new XML(e.target.data);
newValue = xmlData.dummyData.text() * 10;
}
xmlLoader.load(new URLRequest("data.xml"));
Once loaded, the XML value is updated (this will be alot of values eventually but to keep it initially simple ive just used one), I now need to update this value to the server, ie re-write the XML file...
I know this can be done with PHP, however I wouldn't know where to start with either script
Any help or links to resources (Ive looked around but couldn't find anything for AS3 on this) would be very helpful...
View Replies !
View Related
Read And Write XML
Hi,
I need to populate variables in my flash application from an XML file. I also need to add a save function so that all the values, changed or not, can be writen back to the XML file. I have found many tutorials on reading XML with acionscript, but non on writing to an XML document, is this possible?
Thanks for your advice.
View Replies !
View Related
Read / Write .txt?
Hello all,
I know flash isn't as powerful in terms of programming compared to the C++/JAVA/etc., but is it possible for flash to create a new .txt file on a local folder? All I'm trying to accomplish is a .swf or .exe if published to be able to read a simple ASCI .txt file, edit, and create more .txt files.
I know flash can create a local "cookie" but I want something that can be tangible for others to simply grab the .txt from the local folder and use it as they wish simply from using flash.
If possible (that flash can write/edit .txt), say I loaded up a .txt to a dynamic text field named :: "my_Text"
if I were to write in another dynamic field named "my_NextText" would I be able to append the "my_Text" to "my_NextText"? To a local folder?
Thanks,
kpxnamja
View Replies !
View Related
Read Write To Txt Thru Flash
Hey dear frnds, can some one help to me to use file handling in Flash 5/Mx........ iwant to know how to read/write into a file on local system (n even i need help to write it on lan on a perticular IP... that i might try myself) but i realy want this mail me at itz_jais@yahoo.com
View Replies !
View Related
External Xml Read/Write
How is it possible to write or read specific nodes of an external xml without updating the whole external file?I have an external xml in witch i keep product info.But the problem is that when i want to change a product's price for example, I have to rewrite the whole external xml. The way i'm doing it is the following.
First i take a copy of the external xml and keep it inside my program.
var file:File = File.documentsDirectory.resolvePath("xml/myXML.xml");
stream = new FileStream();
stream.open(file,FileMode.UPDATE);
all_data = new XML(stream.readUTFBytes(stream.bytesAvailable));
stream.close();
Then when i want to save any changes i've made to my xml i call a function
public function saveData():void{
var file:File = File.documentsDirectory.resolvePath("xml/myXML.xml");
stream = new FileStream();
stream.open(file,FileMode.WRITE);
stream.writeUTFBytes(all_data.toXMLString());
stream.close();
}
But my xml is really big the proccess of writing any changes is really stupid.How is it possible to write to specific places of the external xml, or see it as an xml and not as a bunch of bytes.
View Replies !
View Related
Read/Write XML Data
I have an XML file with data like this:
<email plays="6">user@domain.com</email>
I need Flash to update the XML file for how many times the user@domain.com played. So if they played the game 4 times, then "plays" in the XML file should be changed to "2". I know, in order for Flash to change the XML, Flash requires a server side script.
What I need is to figure out how to export the data from Flash to PHP. I also need a PHP script, since I can't find anything short and sweet that just writes a small amount of data to XML.
Also, I'd like to figure out how this whole thing would work with multiple users using the same XML and Flash file. What happens when 2 users are trying to write the XML at the same time or one is trying to read it while another is writing it?
View Replies !
View Related
Read/Write INI Files
I am trying to find out how to read/write ini files. The only info I have found so far is with the use of fscommand which doesn't seem to work. Can someone point me to some useful reading material?
example below that is not working:
function writeValue(resultvar, file, section, variable, value)
{
fscommand("Arg", resultvar);
fscommand("Arg", file);
fscommand("Arg", section);
fscommand("Arg", variable);
fscommand("Arg", value);
fscommand("INIFile.SetVal", "");
}
var resultvar = "_level0.rc";
var file = "c:\alert.ini";
var section = "section1";
writeValue(resultvar, file, section, "road1", "1");
writeValue(resultvar, file, section, "road2", "0");
writeValue(resultvar, file, section, "road3", "0");
Thanks
Andrew
View Replies !
View Related
Can I Write/read A Cookie From Swf
I need to track, record, and report a user's progress as they use a Flash-based course so I want to write a cookie (or just a text file) and then load it (loadvars?) the next time they run the course so they can see where they left off, which sections they have completed, etc.
Background:
Potential complication - this course will run from CD ROM - (maybe without having done an install).
This might be running as an .exe, not a .swf in a browser, so if I rely on a 'cookie' tactic, I wonder if it needs to run within a browser to know where the user's cookies are stored. The ideal would be to just write a data file to specified folder 'progress.txt' that I can reload with loadvars.
View Replies !
View Related
Read And Write Variables Via Javascript
ok here is the prob: i can write variables into my html-code with a javascript function, but how can i get the variables out of it into the my swf?
this is my javascript, so how can i get the variable "this.varTest = 0" into my swf-file?
<SCRIPT language=JavaScript>
<!--
this.varTest = 0
function setVar(aw) {
alert('aw= ' + aw);
this.varTest = aw;
//alert(this.varTest);
}
function MM_callJS(jsStr) { //v2.0
return eval(jsStr)
}
//-->
</script>
thanks, s1
View Replies !
View Related
[fla5] Read And Write Cookie?
hi all
i need to make a movie that will go to a different frame
on each day, there are ten frames so i was thinking
save a cookie that contains information on the day name and frame number
then check if the current day matches the cookie's day
if not goto the cookie's frame value + 1
if the frame number = 10
then goto frame 1
then finally save the cookie with current day and frame values
does this sound ok??
is this possible using flash 5?
this is for our intranet which runs on lotus notes
so i don't have access to php or asp or anything
so basically i can only work with flash 5
and maybe some html or javascript
can flash 5 read cookie values?
or maybe i don't need to use a cookie
any advice or suggestions
thanks
View Replies !
View Related
Read And Write To Floppy Disk
Hi
Is it possible to use Flash to create, write to / overwrite and append a txt.file. I can get it to read in no problem - but unable to create it initially. If this is possible the next problem is saving it to a specific location - ideally a users floopy disk. Obviously this has security implications etc and i suspect it is a no-no, but i need to check first before telling my client that. They do not want a database system to store anything but all of the uses will have their own floppies with their info stored on it - I know - dont ask.
A step further - ideally they actually would want to output/create from flash a word doc or pdf file - again storing info that could be read back in? - have never seen anything like this - is the creation of these document types even feasible from Flash? never mind retreival of the data?
Thanks for any help in advance. Tom
View Replies !
View Related
Read & Write Swf Metadata Serverside
Is it possible to read & write SEO Metadata (RDF format) included in swf header, in a compiled swf, on serverside?
So far I only found how to set metadata at compile time.
"Polar SWF MetaData" does about what I need, but it is a Windows tool and won't work on Linux server.
View Replies !
View Related
Need Ez Way To Read/write Files. New 2 Forum
Hi, I'm trying to make a simple Flash file editor, but I've been away from MX for a while, and I'm very rusty.
I want to be able to browse a server directory , a subdirectory of where the .swf resides, and display a list of file names. From there, I want to be able to open the file and have its contents appear in a text box.
I can't figure out a simple way to do either the list, or the opening of the files. God, please don't make me build a perl/xml file parser, I'm too out of practice.
Please send any good ideas or monetary donations to:
Poor man walking.
danb@jobhq.ca
Thanks for any help you can give.
View Replies !
View Related
[fla5] Read And Write Cookie?
hi all
i need to make a movie that will go to a different frame
on each day, there are ten frames so i was thinking
save a cookie that contains information on the day name and frame number
then check if the current day matches the cookie's day
if not goto the cookie's frame value + 1
if the frame number = 10
then goto frame 1
then finally save the cookie with current day and frame values
does this sound ok??
is this possible using flash 5?
this is for our intranet which runs on lotus notes
so i don't have access to php or asp or anything
so basically i can only work with flash 5
and maybe some html or javascript
can flash 5 read cookie values?
or maybe i don't need to use a cookie
any advice or suggestions
thanks
View Replies !
View Related
Database Write AND Recieve?
Hi.
I´m using flash to create a registration form. The problem is that I want the asp-page to respond with the new ID of the new registred person.
And this I have solved with the response.write function, but I can´t get flash to read it.
This is the situation.
1) Frame1 has a registration form (as a mc) with several different variables.
2) A button passes those variables to the asp-page, and writes the variables to a database. (Works perfectly)
on (press) {
set("iSuccess", 0);
loadVariables("http://localhost/Nymedlemdatabas.asp", "", "GET");
set("Submit", true);
set("y", 0);
}
3) The asp-page then responses with a respons.write (NewID) (Works perfectly in the browser window).
4) The flash movie jumps to next frame labled "Success" where I want it to say "A new member has been registred. His MembersID is: [ t e x t b o x ]
5) In that Textbox I want the NewID-variable to be shown. But nothing. Zip. Nada.
Anyone see some logical misunderstandings from my side?
View Replies !
View Related
Write It, Load It, Read It -- Dynamic Text
I have 2 dynamic text boxes and a save button on a movie called inputform.
the variable names for these 2 text boxes are:
lastname
age
the instance name of the button is save.
When a user finishes typing their lastname and age, and after they click the save button, I want the values to be stored in a text file.
On another movie clip called resultform, I also have 2 dynamic text boxes. I want the values of these 2 text boxes to populate with the values inputed from the inputform (of which are now stored in a text file)
I am using FlashMX...can you help me with the coding please?
View Replies !
View Related
Read / Write Text Files Tutorial?
Hi There--
This appears pretty basic, but I've been searching tutorials for a while and haven't been able to figure this out.
I'm on Flash MX. I want to make a simple form that my client can use that will write text to a text file.
I would like to read the text file into a dynamic text field. I would like to not make the text a variable because I'd like to use the same text as a server side include into a straight html file as well.
Perhaps the form could write two documents? One that has the variable and one that doesn't? Could it write an xml document that could be read by both the html page and the flash page?
I don't want the client to have to type the file more than once.
I'm also confused about whether I need to use PHP or XML or both.
This _has_ to be possible. I'm guessing that the reason that I haven't been able to find any tutorials on it is because it's so obvious to everybody else.
Any help will be greatly appreciated and you'll have terrific luck for a week if you do.
Thanks,
Lee
View Replies !
View Related
Read, Write, Create, Delete To .txt Files
Dream FX Media repled to one of my posts:
To store and retrieve data from a txt file you will have to use file permissions.
To my knowledge, you can only read, write, create, and delete, and add to a .txt file but not rewrite over existing data.
If your intentions are to rewrite content stored I would reccomend using a database (mySQL) to allow for that flexability.
But what I want to know now is how do you read, write, create, and delete, and add to a .txt file but not rewrite over existing data.
thanx
View Replies !
View Related
Amfphp Tutorial Problem - Can Read But Can't Write
I can't get the tutorial's bulletinboard sample code to work. It reads from http://www.amfphp.org/amfphp/gateway.php just fine. I can page through all the messages. But I can't post new messages.
The Netconnection Debugger (details below) helpfully tells me the doPost call returns "fail".
I can write new messages on the Flash bb imbedded in the tutorial page.
In the Flash Player Settings Manager Global Security Settings I added a path to the swf file in the "Always trust files in these locations" list.
I am obviously overlooking some security setting. Help would be much appreciated.
-------------
DebugId: "0"
EventType: "Call"
MethodName: "BulletinBoard.doPost"
MovieUrl: "file:///C<blah blah>/sample code/BulletinBoard-flash8.swf"
Protocol: "http"
Source: "Client"
Time: 1140584600487
Date (object #1)
....."Tue Feb 21 23:03:20 GMT-0600 2006"
Parameters (object #2)
.....[0] (object #3)
..........email: "@"
..........message: "yo"
..........name: "me"
..........theurl: "http://"
DebugId: "0"
EventType: "Result"
MovieUrl: "file:///C<blah blah>/sample code/BulletinBoard-flash8.swf"
Protocol: "http"
Source: "Client"
Time: 1140584601034
Date (object #1)
....."Tue Feb 21 23:03:21 GMT-0600 2006"
Result (object #2)
.....status: "fail"
View Replies !
View Related
Flash Standalone To Read/write Text Files?
Hi: I have a flash form that I want my customers to install or use from a cd. I need them to be able to type in their personal information and for this to become permanent and read by the flash form every time it loads. I also need to save the input of this invoice each time it is printed on the local client computer. No web connectivity is present. Can I use flash as an interface to do this? What scripting language can I use to communicate with flash...read and write text files, and enable flash to display the results of a query to this text database (which would populate the records of an old invoice)? I tried this first using an access standalone app which crashed 40 % of the systems. I would like to use flash as the interface, but I am not sure how to do this without using html. Again, this needs to be a standalone distributable application. Any suggestions of samples of similar text file database manipulation with flash?
View Replies !
View Related
Very Simple Read Write Variable Actionscript/php Wanted
Heya, I want to be able to read write varibles to a text file on a server from actionscript. Apparently you can use a php script for processing? or something like that. Can anyone help?
As an example, I want a user to fill in a form and have the variable appended to the end of a list of variables... or something like that.
Thankyou in advance.
View Replies !
View Related
Can Read/write Shared Object Locally, But Never In A Browser..
Ok, I've googled till my fingers bled, and I'm still stumped. Have you
all seen anything like this?
I've got the following code:
------------------------------------------------------
var so:SharedObject = SharedObject.getLocal("status");
if (! so.data.seenIt){
so.data.seenIt = true;
so.flush();
}else{
this.gotoAndPlay('end');
}
------------------------------------------------------
Its only purpose is to skip an intro animation if a user has already
seen it.
This code works flawlessly on the local system in flash player. It
fails every time in IE7 and Firefox. It fails when published to a
remote server, and when loading a plain old html file from disk with the
flash file in it.
My flash plugin has its settings to allow 100k of shared objects, and it
claims to be using about 3k.
I've tried ...getLocal("status", "/"); though I shouldn't have to, and:
if(so.data.seenIt == undefined){
same symptoms resulted.
Thanks!
View Replies !
View Related
Drag And Drop Elements And Write Coordinates To Database
Dears friends,
i have goal to score. i need help
the goal is to drag and drop an element to a scene. and later write the coordinates of the element to the database.
so when the user returns and logs in they can continue to decorate the scene from where they left...
i am writing in php mysql.
any quick help will be very usefull.
write the coordinates of the element to the database.
cheers.
thnx a billion
View Replies !
View Related
ReferenceError: Error #1074: Illegal Write To Read-only Property Array
I'm really sorry if this ends up a no brainer. I'm new to both AS3 and OOP and have spent the last 4 hours getting nowhere.
the code is being used as a document class in an fla (nothing else in the fla yet).
the boiled down code is:
package
{
import flash.display.Sprite;
public class SimpleMenu extends Sprite
{
public var btnData:Array;
public function SimpleMenu():void;
{
btnData:Array=new Array("Home","About us","Projects","Clients","Press","Brochure");
trace (btnData);
}
}
}
the output says:
ReferenceError: Error #1074: Illegal write to read-only property Array on global.
at SimpleMenu$cinit()
at global$init()
I've tried every way round that I can think off including the stupid ones.
I've googled it but the errors reported there seem much more complex.
View Replies !
View Related
Read Coordinates From A Database
(MX 2004)
is it possible to create a movie that read coordinates from a database to position 'x' amount movie clips onto stage ?
if it is, where could i find a tutorial on how to do this. i'm not a flash tech. Any help is good
cheers
View Replies !
View Related
|