Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Reading From Txt Or Csv File



i'm using ftooltext to create files and i'm wondering whether any of the other ftools or any other program are able to read the words inside a .txt (or .csv) and store the variable in flash 5.

Basically, there already exists a text file with a words in it and when I run the flash program, I want to store each word from the text file as a value of a variable in the flash program. Is this possible and how would I do this?

Thanks very much!

dartagnan



ActionScript.org Forums > Flash General Questions > Other Flash General Questions
Posted on: 07-10-2003, 04:58 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Flash File Reading A Swf File
I was wondering if there was a way to make a flash file obtain data from another swf file. What I have is a swf that contains a datagrid and I want to make a flash file that can read the swf and find the number stored in a given cell.

Thank you.

Reading File Dimensions (wxh) Of A Swf File
Hello All,
I am uploading some banners to my server on an application, I am using ASPUpload.
Everything works fine, I am using the component properties: File.ImageType, File.ImageWidth, and File.ImageHeight.
My problem is that this properties only support file types:GIF, JPEG, BMP and PNG.
I am using also Flash banners on the site (SWF)...
How can I determine the banner dimensions (width and height in pixels) after uploading the .swf file?
Thanks in advance?

Reading From File
Can somebody help me in code to read a file and put them in variables. Right now I can do that by creating Dynamic text boxes. When I use "loadVariables()" it loads in the dynamic text box variable only not in frame variables.

Your help will be appriciated.

Reading From A File
Hi there,

How can I read a variable that is on a text file.
Thnks.

Example.
1. I´ve got the text file myfile.txt
2. There is a variable in that text file called myvar, and it looks like this ---> myvar=This is a text test.
3. I want to put the value of that variable into a dinamic text variable inside the flash code.
4. Did I make myself clear?
5. Thnks a lot...

Reading A PHP File
Hi, i do flash games for a virtual pet site and as a sucrity thing the PHP coder wnats me to make it so when it sends the score flash will take a code from a PHP file. This is what coder says:

[Sunday September 15 03:01 PM] _Tommy _: You get the text from flashsc.php
put that text into a variable
lets call the variable... skvar
you then send the score to
flashsc.php?page=submit&sk2=[skvar]&score=[scorevar]
So can someone please help? And go easy, im not exectly the best actionscripter ever

Reading From A .txt File
Does anyone know how to display a "+" sign within a .txt file to be displayed in a textfield within flash?

Reading .txt File
Hey,

I want to make an app that reads special lines (SO NO VARS) from a .txt file...

So the code loads the first line of the .txt file, loads sum code depending on what stands on that line, and then moves to the other line untill it has completed all lines...

READING # Of File
I'm trying to get flash to read the number of images files in a specific folder on the server. Anyone have any ideas where to start?

Reading A File. Help
I was wondering if there was a way for flash to read the contents of a text file and throw it into a specific text box.

Quick example: Say I had a complete flash web site and wanted to update the "terms and conditions" for the site. Well could I have the terms and cons in a text file and have flash import contents of the file into the movie. That way I would only have to update the text file and not have to completey re-save and upload the complete movie.

Thanks for your replies.

Reading Xml File Name
i am reading in many different xml files. the names will be similar, but not the same. How do i get flash to get the file name dynamically at run time? Any suggestions or refers to a site somewhere would be wonderful

Reading File With PHP
Hi all, I have the following PHP script that receives two parameters: folder name and file name.

On the Flash side, I verified that the arguments are being passed correctly. I also made sure the path to the file on the server is correct. On the PHP side though, I noticed that the variables receive no value and the function
returns "undefined". What am I doing wrong? :(








Attach Code

$a = $_POST['a'];
$b = $_POST['b'];

$fp = fopen("Temp/".$a."/".$b, "rb") or die("Temp/".$a."/".$b);
$contents = fread($fp, filesize("Temp/".$a."/".$b));
fclose($fp);

echo "&data = ".$contents;

Reading .as File
I'm designing a Flash website for very low bandwidth in order to do that i want to keep the actionscript in a .as file. Since the scroll bars used in different sections use the same ActionScript coding I want to maintain a single .as file from which will be loaded into each scroll bar, but the dynamic textbox inside each section has a different name. Therefore how can i achieve what is wanted when each dynamic textbox (where the text needs scrolling) has a different variable name ?

Reading Text File
I am able to read a text file using actionscripting in a Flash 5 movie. I am looping the movie so it will continuously check the text file to see if it has been updated. This file will actually be updated about 10 to 15 times an hour and I need to be able to display the updates to people who keep the browser window open. Netscape loads the new text file everytime it loops, meaning that the browser displays the updated text file info when the file is changed. Internet Explorer - on the other hand - never shows the updated text file.

Any ideas how to get IE5 to check for the updated text file in a Flash movie and automatically display the changes?

Thanks a million for any ideas you may have!

Reading In A Text File
how can you load a text file into a dynamic text box from a button being clicked?

External File Reading Help
i just wanted to know if there is anyway in flash you can read a text file without having all that assigninments of variables? I am making a word count program, where given a text file i want flash to count the words, the only thing thats stopping me is the fact that i have to put "text=" in any text file i want to word count.

Reading A Text File
In order to keep my swf files down as low as possible (for low bandwidth users), is it possible to load or "read" text or html files into a swf?

Thanks.

Reading From A Text File
i have the file tickerheads.txt placed in the C:
It reads as follows

-----

item1=This is the first item of news 2002
item2=This is the second item of news 2002
item3=This is the third item of news 2002
item4=This is the fourth item of news 2002
item5=This is the fifth item of news 2002

-----

When I run my movie with the following actions attached to it and all the relevant dynamic text boxes with their variables named as above with the following line-

loadVariablesNum("C:\tickerheads.txt", 0);

---
The movie runs and yet the text doesnt load into the boxes! Anyone any ideas?

Thanks

Reading From Text File
Dear Friends

I want flash to read from a text file, so i did it, and it read from the text file, but when i published the movie, i found that flash had taken the text from the text file and included it in flash, i need flash to always read from that text file, so that when i change the text file, the new information automatically comes to flash. How to do that?

Thanks

LoadVariables Reading From A ASP File
LoadVariables will load a normal .txt file fine, but if its a serverside scripted file which is outputting exactly the same stuff, then LoadVariables just wont load it.... at all!

Why?

here is the ASP file: http://www.tns.co.uk/dev/t/inc/ticker.asp

here is the SWF file: http://www.tns.co.uk/dev/t/inc/ticker.swf

this is the code i am using to load the variables from the ASP file:

loadVariablesNum("ticker.asp", 0);
if (aaa ne "")
{
gotoAndPlay(9);
}

this is inside a loop, so it will keep running until the variable aaa equals something... if i change ticker.asp to ticker.txt it works fine, but it wont read the scripted file at all!

Why oh why oh why?? Is this a limitation of flash or am I doing something wrong? If someone could help this would be much appreciated because Im really starting to tear my hair out abotu this!

Help With Reading Through Text File
I have a MC called BioInfo and my text files are in side it. What I'm trying to do is read through the txt file and display the variables accordingly. For example,

name1=Jim&title1=Suprv&text1=blablablah...name2=Ri ck&title2=Manaager&text2=blablablah...name3=Bob&ti tle3=Flunky&text3=blablablah...

now I have some code I found that I want to use on a button, but I'm sure I am missing some and would really like to get it working. I would appreciate any help.


Code:
on(release){
BioInfo.name.text = eval("name"+i);
BioInfo.title.text = eval("title"+i);
BioInfo.city.text = eval("city"+i);
BioInfo.state.text = eval("state" +i);
BioInfo.scroller.text = eval("text"+i);
BioInfo.BioPic.Image = eval("BioPic + i")
i++
}

Reading Text From A File
Hrm, since nobody seems to be able to tell me how to make a dynamic panel...

Is there a way for Actionscript to parse text from a file? =D

Thanks!

Reading From A Text File
Hi,
I've got a movieclip called : nmc, nmc is in another movie clip called wwptcmc. wwptcmc is on the main stage with an instance name of wwptc.

In the movie clip nmc there is a dynamic text box, where shoud I put the code to read the text file : loadVariablesNum("users.txt", 0);
Should it be on the main stage or should it be in nmc. the dynamic textbox has the var set to userlist.

The text file is in the following format :
userlist=jht sam master

Thank you

Php Reading File On Server
ok i was wondering if there is a way to have a php file read what is in a certain folder on your server and then display a link to them using the file name, i am sure there is a way i am just clueless how

Reading Txt File From Flash?
If somebody could please help me with my problem, I'd be so happy, I'm new at this.

I currently have an HTML news page that reads the news via PHP from a text file. The php code is below. I want to have that page do that SAME exact thing, but in Flash! How?!?

<?php
$fd = fopen ("txtlist/news.txt", "r");
$content = fread ($fd, filesize ("txtlist/news.txt"));
fclose($fd);

$line = explode(";;", $content);
echo "<table cellpadding=4 cellspacing=9>";
foreach ($line as $lines) {
if ($lines) {
$linestr = explode(";", $lines);
$date = $linestr[0];
$body = $linestr[1];
echo "<tr>";
echo "<td align=center><b>$date</b></td>";
echo "</tr>";
echo "<tr>";
echo "<td align=center>$body</td>";
echo "</tr>";
echo "<tr>";
echo "</tr>";
echo "<tr>";
echo "</tr>";

}
}
echo "</table>";
?>
</p>

Reading Variables From Php File
Hi,
All I want is to read three variables from php, in flash.
For example, I have the index.php file :

<?php
$x1 = 3;
$x2 = 16;
$x3 = 49;
?>

And I want to take the variables values in Flash, and trace them.
Can anyone give me the fla file doing this?


Lots of 10x!

Reading Text From A .txt File
I want to use a .txt or .htm file to hold text for a flash project. Does anyone know how to set up a text box to grab the text from a file and insert it into the text box?

Reading External Txt File
hey fk'ers

i'm trying to make flash read from an external file to make updating easier. but when i wanted to read a variable from the txt file, and use that variable in a for loop, it won't work

the txt file:
code: PSTotal=3

the actionscript:
code: var totalNum;
PSData = new LoadVars();
PSData.onLoad = function() {
totalNum = this.PSTotal;
};
PSData.load("externalText.txt");
this.onEnterFrame = function() {
if (totalNum != undefined) {
for (var i = 0; i<totalNum; i++) {
trace("A");
}
delete this.onEnterFrame;
}
};

any idea why?

*edit*
when i change i<totalNum to i<3, it works...

Reading In Text From File Into Swf
Hello first time poster here,
I just started working with flash about a month ago and i'm creating the flash for a webpage at this internship im working at. One of the sections i have to make is a "Whats New" a section that gets frequently updated, but once I am gone, the other workers are going to have to update this themselves and don't want to mess w/ the flash.
i figured the easiest way for them to update is to edit a simple text file w/ html. so basically the question is how do i read text from an external file into the swf? I know there is a way to do this (i've seen other flash pages w/ calendars etc ) but i have no idea where to start with this implementation, can someone help me out? thanks in advance!

Reading From A Text File
Hi all,

As you can see I am new to this forum. I have recently been getting into Flash, and would class myself as an beginner/intermediate.

I need to create a presentation that runs at the reception area of my workplace (fair enough). However, one of the requirements is that the receptionist can enter weather details into a text file which my flash presentation will read, and output things based on this text file.

For example, she would put in the next 5 days weather like
monday, 24C, Sunny
tuesday, 17C, Cloudy
etc

Then my presentation would read this file and display the day, temperature and a picture of a Sun or a Cloud etc. And if she forgot to put anything in the text file it wouldnt mess anything up, it just wouldnt display anything.

I have searched a few sites, and scanned through all the tutorials on this site, but i cant find anything that could help me to learn how to do this..

Any ideas or pointers?

Reading Text From A File
Hi,

I am going through the tutorial found in here

The spinning text effect draws the string from the variable inputString
code: inputString = "some text to be animated";

I want to load the string from a text file instead, how do I do that?
I tried loading my text file by adding the code below:

code: loadVariablesNum("data.txt", 0);
where data.txt is the text file containing the string I want to animate,
but the movie just came up with a blank screen.

Please help. Thanks.

Melissa

[F8] Reading A CAD File In Flash8
I have a CAD file with x,y coordinates that creates a square,circle and a triangle. This is the file:
(VR2 V00.34)

(NamedView -186352,183508 265712,-66188 Initial)

(View -186352,183508 265712,-66188)

(Background 0)

C 3

P 5 0,0 0,122880 122880,122880 122880,0

0,0

P 37 -12587,58659 -13906,73739 -17822,88362 -24217,102083

-32896,114486 -43596,125195 -55992,133884 -69708,140289

-84328,144217 -99407,145547 -114488,144241 -129114,140336

-142840,133953 -155250,125284 -165967,114592 -174666,102203

-181082,88492 -185022,73875 -186364,58797 -185070,43715

-181177,29086 -174804,15355 -166145,2938 -155462,-7788

-143080,-16496 -129374,-22924 -114760,-26875 -99683,-28229

-84600,-26947 -69968,-23065 -56232,-16704 -43808,-8054

-33074,2620 -24356,14995 -17917,28696 -13955,43306

-12588,58383

P 4 142892,-6950 204332,115930 265772,-6950 142892,-6950

(EndOfDWF)

I hard coded this file in flash and created the images.this is the hard code:

var _x:Number = -169;
var _y:Number = 167;
var _x2:Number = 242;
var _y2:Number = -60;
stage=x, y+x2, y2;
this.createEmptyMovieClip("circle_mc", 6);
circle_mc.lineStyle(1,0x000000, 100);
circle_mc.beginFill(0x00FF00, 100);
circle_mc.moveTo(-12, 54);
circle_mc.lineTo(-13, 67);
circle_mc.lineTo(-16, 81);
circle_mc.lineTo(-22, 93);
circle_mc.lineTo(-30, 104);
circle_mc.lineTo(-40, 114);
circle_mc.lineTo(-51, 122);
circle_mc.lineTo(-64, 128);
circle_mc.lineTo(-77, 131);
circle_mc.lineTo(-91, 133);
circle_mc.lineTo(-104, 131);
circle_mc.lineTo(-118, 128);
circle_mc.lineTo(-130, 122);
circle_mc.lineTo(-141, 114);
circle_mc.lineTo(-151, 104);
circle_mc.lineTo(-159, 93);
circle_mc.lineTo(-165, 81);
circle_mc.lineTo(-168, 67);
circle_mc.lineTo(-170, 54);
circle_mc.lineTo(-168, 40);
circle_mc.lineTo(-165, 27);
circle_mc.lineTo(-159, 14);
circle_mc.lineTo(-151, 3);
circle_mc.lineTo(-142, -7);
circle_mc.lineTo(-130, -15);
circle_mc.lineTo(-118, -21);
circle_mc.lineTo(-105, -25);
circle_mc.lineTo(-91, -26);
circle_mc.lineTo(-77, -25);
circle_mc.lineTo(-64, -21);
circle_mc.lineTo(-51, -15);
circle_mc.lineTo(-40, -8);
circle_mc.lineTo(-30, 3);
circle_mc.lineTo(-22, 14);
circle_mc.lineTo(-17, 26);
circle_mc.lineTo(-13, 40);
circle_mc.lineTo(-12, 53);
circle_mc.endFill();
circle_mc._x = 400;
circle_mc._y = 25;
this.createEmptyMovieClip("triangle_mc", 2);
triangle_mc.lineStyle(0, 0x000000, 100);
triangle_mc.beginFill(0x00FF00, 100);
triangle_mc.moveTo(130, -7);
triangle_mc.lineTo(187, 106);
triangle_mc.lineTo(242, -7);
triangle_mc.lineTo(130, -7);
triangle_mc.endFill;
triangle_mc._x = 400;
triangle_mc._y = 25;
this.createEmptyMovieClip("square_mc", 4);
square_mc.lineStyle(1, 0x000000, 100);
square_mc.beginFill(0x00FF00, 100);
square_mc.moveTo(0, 0);
square_mc.lineTo(0, 112);
square_mc.lineTo(112, 112);
square_mc.lineTo(112, 0);
square_mc.lineTo(0, 0);
square_mc.endFill;
square_mc._x = 400;
square_mc._y = 25;

That is not what I need. I need to be able to read the 1st file in flash without plugging in each and every coordinate. How would I write a script that will import the 1st file and extract all the data and plug it in for me?

Reading Vars From A .as File
As the title says.. I have some vars I declared in a .as file and I'm trying to read them from a .swf file.. I already did the (#inculde " data.as") and that works, but as for reading the vars.. its saying "undifined." any tips?

Reading Vars From A .txt File
ok gotta question that could be pretty simple i guess...

so what I'm trying to do is, say myNum=1 in a .txt file...
I want to be able to change a movieclip's frame in a .swf file depending on what the value of myNum is. How can I do this?

thanks.

Button Reading URL From XML File
Hi, first post here.

Might as well explain a little about what I am trying to do and some other info to see if anyone can help out.

I have been using Flash for a while but normally just for flick book animation, currently learning ActionScript so I can better my Flash work since it seems that my job is headed that way.

If I layout what I have done so far and then explain further what it is I want to achieve.

After spending quite a lot of time searching on here I found an fla file that someone had kindly posted and that got me started. What it did was generate a swf file that can load images into a container randomly. That is great, I have a folder set-up that contains my images and an XML file that tells Flash where it all is.

What I have added to that is an invisible movie clip that works as a button. It sits just above the images and has an onRelease function added to it as well as an _alpha statement set to 0.

That invisible button needs to fetch a URL when clicked from my XML file.

That brief description might be confusing to some but I can post code, fla if need be.

The outcome of all this is a swf file that loads random images and makes that image clickable to send you to a URL. The idea behind it all is that anyone can create an image, upload it to a server and then just edit a URL in an XML file. Nice and easy and avoiding cock-ups.

I am quite new to ActionScripting things in Flash but am really enjoying it, this forum has been a great resource. I would really appreciate any help offered.

Syncronous File Reading
Hi people,

I've ported an app, from another language, to Flex. Now, I think this is a general ActionScript problem which is why I'm posting it here, but I might be wrong, so let me know if this isn't the right forum.

So, basically, seeing as pretty much ALL non-Flash languages know how to read files syncronously, EVEN the ones that read stuff over http connections, and generally offer syncronous connections as their default reading mechanism, whether you like it or not, this is how the app was made. It was written in C++ and that's just how the app works. It syncronously reads local files on the hard disk.

I want my app in Flex to syncronously read files from the hard disk. I've already ported the code, using a wrapper to a "File" class I made in ActionScript.

Only thing is, I can't implement the internals of the reading for the File class, cos ActionScript doesn't offer any way to sync-read local files

I tried a "while" loop that checked if a variable is set to true, this variable is set from the completeEvent event... but... it didn't work, the event was never called. Perhaps the while loop blocked events? Is there some way to write a while loop that doesn't block events?

Please don't tell me "you just need to write your code for async". Please just don't. It's not any good for porters, is it?

Basically, you are saying "don't bother porting apps to Flash, because Flash can't read files sync-style".

If you are going to say "well it's the only possible way", then at least tell me HOW to refactor my code to be async? I have NO IDEA how to refactor my code.

Isn't that getting into the realms of computer science and design patterns? I mean it's like changing geometric progressions into loop based code, or changing loop based code into recursive functions.

All very well, but it involves major re-work, of the kind that I"ve never done before and have no idea how it's done.

Basically, the code that fires off any read, must "end", right there Because it has NO PURPOSE until the read has completed.

Therefor, all the rest of the code must be loaded in the event.

But then there are many files to be readed, each of which must be read from the events that are called by code called by the events. What a mess!

If only there was some way to loop until the read is done??? Perhaps I can call some function that lets the event complete? Some kind of "flash.doEvent" thing?

Surely there must be some kind of flash genius around here who knows how to make Flex wait until the read has done, so I can do proper sync reading?

Some kind of trick or technique that while not really documented as the way to do sync reading, still works? Like some function I can call that just lets a loop not block events?

Writing To And Reading From A File.
Howdy all.

I'm fairly new to actionscript and trying to create an application to run on a workstation.

The program will be a form that when filled out, will send an email to someone confirming a ticket purchase/acquisition.

The form includes a text field for the recipients name, email, the date and showtime their ticket is for, and a small message from the concierge dept.

I would like to save commonly used emails in a file, so that when the program is started they will be loaded, and can be chosen from via combo box component.

There would be an "add email" button to save the new email to the file.

It doesn't seem like flash itself can do this.
Could anyone explain the best way to perform file i/o ?
I know a bit of C++, but not how to integrade it into a flash application.

Could someone please give me some pointers?
If there is a specific language or 3rd party application best suited for this please let me know.

Reading From A Text File
Hi,

I've used the shared concept to read and write to files, but I really need to know how to read from an ordinary text file.

mySO = SharedObject.getLocal("filedata");
for (a in mySO.data) trace(a+": "+mySO.data[a]+" printing");

This code only recognizes data that's written to the file using sharedObjects.

Anybody, please......is there a way to read pure string or numeric data from a text file (a text file whose path I specify, rather than look it up in some bizzare temporary folder of flash)

Please help me with this.....I need this functionality badly...

Thanks

Reading A CSV File In Flash
I want to read a CSV file in ActionScript and this file will help me to create some array from the data it contains. I googled around but everything i found was related to XML. I want to read CSV. Any Solution ?

Reading Flashvars In From As File
I have an as file with the following code in the constructor.

var obj:Object=LoaderInfo(root.loaderInfo).parameters;
var sLibraryId:String = String(obj["LibraryId"]);

I am getting a "term is undefined" error. Since this is not in my .fla but in an as file, am I doing something wrong in trying to read the flashvars this way? If not, what else might I be doing wrong here? Thanks.

Reading An External AS File
Hi,

I have some code that I don't want it to appear on the main actionscript file,
I see it is possible to create a new -> Actionscript file.

How do I embed the code written there in to an existing AS class file?


Thanks in advance,
Guy

Help With Reading A Text File
hi there . im quite new to actionscript , and im not really sure where to start on this script.


what i want to do is read a line in a text file and split the varibles and put them in to a grid ( listview ect )


example textfile ::


example artist1|example album1|example details1
example artist2|example album2|example details2
example artist3|example album3|example details3

-----------------------------------------------------


so the string seperator is |


any example scripts to get me started would be great

thanks
luke

Reading An XML File For A Form...
Hey guys. Any help is wanted. I have this XML file right, and it has like 60+ questions on it. Each question has three answers, like so:

<question-text questionId="88" desc="Do staff try to correct problems when they occur?">
<answer-text answerId="1" desc="Yes" />
<answer-text answerId="2*" desc="Sometimes" />
<answer-text answerId="3*" desc="No" />
<answer-text answerId="0" desc="Skip Question" />
</question-text>

No here is the deal, can I make a radio button group to answer that? Well, i know it is possible, but could i use code something like this:

Code:
formXml = newXML():
formXml.ignoreWhite = true;
formXml.onLoad = function(success) {
if (success) {
formItem = this.firstChile.childNodes;
for (var i=0; i<formItem.lenght; i++) {
item=_root.attachMovie("formItem", "formItem" + i, i);
}
}
}
Could i do something like that? Where the movie clip is a radio button group? What i really need is a way to attach the answer text to a radio button label. I think that i got the question text figured out.
All replies welcome. You can IM my at kyjmpuckett,
Thanks guys,
Mith

Reading/viewing A File
I have not test this out, because don't have access to FLASH at the moment...not until next week.

The question is...

Platform: UNIX
Webserver: iPlanet
Flash: Flash MX 2004 Prof / Flash MX
DIR Permission: drwxr-xr-x
File Permission: -rw-r--r--

Can flash access a file outside the "public_html" directory when given the absolute path? (ie. /export/home/userid/blah....)


Thanks in advance!

Reading FlashVars In SWF File.
I do have a question in regards to FlashVars and how you test for the existance of a certain value inside a SWF movie?

This code right here works fine for me.
if (_level0.myURL == undefined) {

}
else {
pflipper.gotoPage(3);
gotoAndStop(1);
}

However, it is not what I need. I want to be able to setup an if statement with multiple else if statements. I have tried almost every possible combination except the correct one.

Here is what I would like to do. If myURL == 1 then gotoPage(1) & gotoAndStop(1) else if myURL == 4 then gotoPage(2) & gotoAndStop(4)

Can you please tell me what is the correct syntact for doing this.

Writing To And Reading From A File
Is there a way to write to a file in flash? All the sources I found talk about using different languages with flash to do that. We have a game that we would like to store high scores from into a file and load them when the game starts. Can anyone, please, let us know what the best way of doing this is? Thank you!

Reading File Names
How can I get flash to read file names from a particular folder and paste them into a text field?
thanks

Reading/writing To Xml File
Hey, I'm looking for some help or a tutorial on reading and writing from a flash file to an xml file. I know how to read the data from an XML file to a flash file, but if a user would enter information into a input field, how would it write it back to an xml file? Any help...awesome..

thanks

Reading Values From A XML File...
from this file i want to read the values from <model> tag using a for loop
help me with code. i don't know xml well.

thank u


- <cat-product-structure>
- <Product_Group>
<ProductGroup>DI</ProductGroup>
<Description>Digital Images</Description>
- <Category>
<PrimaryCat>DSC</PrimaryCat>
<Description>Digital Still Camera</Description>
<CatCaption>Welcome to xxxx Digtial Images Product Line up 2004</CatCaption>
<CatWelcomeNote>Welcome to xxxx Digtial Images Product Line up 2004 .. A detailed discription goes here ... many lines</CatWelcomeNote>
<CatPictureName>digitalImages.jpg</CatPictureName>
- <compare_features>
<specname>Lens construction</specname>
<specname>Optical Zoom</specname>
<specname>Precision Digital Zoom</specname>
<specname>Smart Zoom</specname>
<specname>Focal length f=(35mm conversion)</specname>
</compare_features>
- <Sub-Category>
<SecondaryCat>Cyber-shot</SecondaryCat>
<Description>Cyber-shot</Description>
<CatCaption>Welcome to xxxx Cybershot Digtial Camera Product Line up 2004</CatCaption>
<CatWelcomeNote>Welcome to xxxx Cybershot Digtial Camera Product Line up 2004 .. A detailed discription goes here ... many lines</CatWelcomeNote>
<CatPictureName>cybershot.jpg</CatPictureName>
- <compare_features>
<specname>Lens construction</specname>
<specname>Optical Zoom</specname>
<specname>Precision Digital Zoom</specname>
<specname>Smart Zoom</specname>
<specname>Focal length f=(35mm conversion)</specname>
</compare_features>
- <Models>
- <Modelname Name="DSC-T1">
<Description>DSC-T1</Description>
<ModelCaption />
<ModelWelcomeNote />
<FeaturedFlag>Yes</FeaturedFlag>
<NewFlag>No</NewFlag>
<Currency>SGD</Currency>
<Price>110.00</Price>
<modelpicturename />
<specification_code code="E32" />
- <compare_features>
<specname>Lens construction</specname>
<value>5 elements in 4 groups(including 1 aspheric elements)</value>
<specname>Optical Zoom</specname>
<value>1x</value>
<specname>Precision Digital Zoom</specname>
<value>No</value>
<specname>Smart Zoom</specname>
<value>No</value>
<specname>Focal length f=(35mm conversion)</specname>
<value>f=5mm(33mm)</value>
</compare_features>
- <unique_features>
<specname>Optical Zoom</specname>
<value>1x</value>
<specname>Gross Pixels</specname>
<value>Approx2,110KPixels</value>
<specname>Effective Pixels</specname>
<value>Approx2,020KPixels</value>
<specname>Recording Format</specname>
<value>JPEG MPEG</value>
<specname>Playback Still Image Size</specname>
<value>640x480 1,280x960 1,600x1,200 1,632x1,224</value>
</unique_features>
</Modelname>
- <Modelname Name="DSC-U40">
<Description>DSC-U40</Description>
<ModelCaption />
<ModelWelcomeNote />
<FeaturedFlag>Yes</FeaturedFlag>
<NewFlag>No</NewFlag>
<Currency>SGD</Currency>
<Price>110.00</Price>
<modelpicturename />
<specification_code code="E32" />
- <compare_features>
<specname>Lens construction</specname>
<value>5 elements in 4 groups(including 1 aspheric elements)</value>
<specname>Optical Zoom</specname>
<value>1x</value>
<specname>Precision Digital Zoom</specname>
<value>No</value>
<specname>Smart Zoom</specname>
<value>No</value>
<specname>Focal length f=(35mm conversion)</specname>
<value>f=5mm(33mm)</value>
</compare_features>
- <unique_features>
<specname>Optical Zoom</specname>
<value>1x</value>
<specname>Gross Pixels</specname>
<value>Approx2,110KPixels</value>
<specname>Effective Pixels</specname>
<value>Approx2,020KPixels</value>
<specname>Recording Format</specname>
<value>JPEG MPEG</value>
<specname>Playback Still Image Size</specname>
<value>640x480 1,280x960 1,600x1,200 1,632x1,224</value>
</unique_features>
</Modelname>
</Models>
</Sub-Category>
- <Sub-Category>
<SecondaryCat>Mavica</SecondaryCat>
<Description>Mavica</Description>
<CatCaption>Welcome to xxxx Mavica Ditial Camera Product Line up 2004</CatCaption>
<CatWelcomeNote>Welcome to xxxx Mavica Ditial Camera Product Line up 2004 .. A detailed discription goes here ... many lines</CatWelcomeNote>
<CatPictureName>Mavica.jpg</CatPictureName>
- <compare_features>
<specname>Lens construction</specname>
<specname>Optical Zoom</specname>
<specname>Precision Digital Zoom</specname>
<specname>Smart Zoom</specname>
<specname>Focal length f=(35mm conversion)</specname>
</compare_features>
- <Models>
- <Modelname Name="MVC-FD100">
<Description>MVC-FD100</Description>
<ModelCaption />
<ModelWelcomeNote />
<FeaturedFlag>Yes</FeaturedFlag>
<NewFlag>No</NewFlag>
<Currency>SGD</Currency>
<Price>110.00</Price>
<modelpicturename />
<specification_code code="E32" />
- <compare_features>
<specname>Lens construction</specname>
<value>5 elements in 4 groups(including 1 aspheric elements)</value>
<specname>Optical Zoom</specname>
<value>1x</value>
<specname>Precision Digital Zoom</specname>
<value>No</value>
<specname>Smart Zoom</specname>
<value>No</value>
<specname>Focal length f=(35mm conversion)</specname>
<value>f=5mm(33mm)</value>
</compare_features>
- <unique_features>
<specname>Optical Zoom</specname>
<value>1x</value>
<specname>Gross Pixels</specname>
<value>Approx2,110KPixels</value>
<specname>Effective Pixels</specname>
<value>Approx2,020KPixels</value>
<specname>Recording Format</specname>
<value>JPEG MPEG</value>
<specname>Playback Still Image Size</specname>
<value>640x480 1,280x960 1,600x1,200 1,632x1,224</value>
</unique_features>
</Modelname>
- <Modelname Name="MVC-CD400">
<Description>MVC-CD400</Description>
<ModelCaption />
<ModelWelcomeNote />
<FeaturedFlag>Yes</FeaturedFlag>
<NewFlag>No</NewFlag>
<Currency>SGD</Currency>
<Price>110.00</Price>
<modelpicturename />
<specification_code code="E32" />
- <compare_features>
<specname>Lens construction</specname>
<value>5 elements in 4 groups(including 1 aspheric elements)</value>
<specname>Optical Zoom</specname>
<value>1x</value>
<specname>Precision Digital Zoom</specname>
<value>No</value>
<specname>Smart Zoom</specname>
<value>No</value>
<specname>Focal length f=(35mm conversion)</specname>
<value>f=5mm(33mm)</value>
</compare_features>
- <unique_features>
<specname>Optical Zoom</specname>
<value>1x</value>
<specname>Gross Pixels</specname>
<value>Approx2,110KPixels</value>
<specname>Effective Pixels</specname>
<value>Approx2,020KPixels</value>
<specname>Recording Format</specname>
<value>JPEG MPEG</value>
<specname>Playback Still Image Size</specname>
<value>640x480 1,280x960 1,600x1,200 1,632x1,224</value>
</unique_features>
</Modelname>
</Models>
</Sub-Category>
</Category>
</Product_Group>
</cat-product-structure>

Reading A Text File
Hi
I am new to actionscript, but I know C,C++ some Java, Javascript ASP, PHP.

Since I have learned many different programming languages in the past I have not a little list of short programs I want to be able to in any language ( I have discovered these programs are a good basis to start).

List Item Read a text File:

OK I have read the book(s) and I am afraid too late saw your tutorial when I had already got that far with the usual blood and tears.

I can read a a text file and pop one record of 4 field of data onto a Flash form - but my file has more records and I only see the last one reported.
It looks like actionscript does not deal in records as return/enter is just passed as data.
This is my text file:
&Name=Pat Proggie&Email=pat@hotmail.com&Header=About this 'er Flash feedback form&Msg=This Flash feedback form is the bees knees&
&Name=Andy Handy&Email=andyHandy@yahoo.com&Header=Your site stinks&Msg=Your site stinks carry on I like it!&
&Name=Able Cable&Email=able@cabel.net&Header=Great Site&Msg=Tell me more.&
The Code:
//-------------------------------------------------
// I expect to read a text file called
// "feedbackFile.txt" and place data fields into
// the display form "Reporting Text from a File
// this code only displays the last record
// so only 1 record on this file
// would be OK for input variables like rates/discount values
//
feedback_lv = new LoadVars();
feedback_lv.onLoad= onText;
feedback_lv.load("feedbackFile.txt");
var sometext = feedback_lv.toString();
//
function onText()
{
name_txt.text = feedback_lv.Name;
email_txt.text = feedback_lv.Email;
header_txt.text = feedback_lv.Header;
msg_txt.text = feedback_lv.Msg;
}

Code/form view/notepadview in pdf attachment called "The File"

Copyright © 2005-08 www.BigResource.com, All rights reserved