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




I'm Gonna Cry: Reading Variables From Line In Textfile



I thought it would be quite easy to read variables from a textfile into flash, where the first line is the first variable, the second line is the second variable and so on.I was wrong.I already asked help in several ways but no go so I thought I might ask you, the specialists Let me explain:In a textfile, there are 7 lines:
Code:
&mondaystr=this is the menu for monday&&tuesdaystr=this is the menu for tuesday&&wednesdaystr=this is the menu for wednesday&&thursdaystr=this is the menu for thursday&&fridaystr=this is the menu for friday&&saturdaystr=this is the menu for saturday&&sundaystr=on sunday we rest&
So now I want to read those variables into flash. I use this code:
Code:
loadedText = loadVariablesNum("file.txt", 0);var Menutoday = mondaystr;var Menutomorrow = tuesdaystr;var dayToday = dateToday.getDay();
Depending on the day it is, the Menutoday string and the Menutomorrow string should be calculated using a switch case thing. Now, what's the situation:when I create a textfield with var mondaystr, it works. Also for the other days.when I create a textfield with var Menutoday, it says undefined?!I don't get it. It's two days now that I'm working on this single issue and I'm afraid I'm completely stuck Can someone help me out please?Thanks in advance.EDIT: maybe I should add the switch code too?***********************************
Code:
switch (dayToday) {case 0: Menutoday = sundaystr; Menutomorrow = mondaystr;break;case 1: Menutoday = mondaystr;Menutomorrow = tuesdaystr;break;case 2: Menutoday = String(tuesdaystr);Menutomorrow = wednesdaystr;break;case 3: mealOfTheDay = tuesdaystr;Menutomorrow = wednesdaystr;break;case 4: Menutoday = tuesdaystr;Menutomorrow = wednesdaystr;break;case 5: Menutoday = tuesdaystr;Menutomorrow = wednesdaystr;break;case 6: Menutoday = tuesdaystr;Menutomorrow = wednesdaystr;break;}



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 06-25-2008, 05:18 AM


View Complete Forum Thread with Replies

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

Reading Last Line Of Textfile
Hello,

I am currently writing a flashscript that displays the contents of a text file.
I need to keep refreshing the data in the text file, because of data constantly being added to the text file.
Does anyone have a idea if it's possible to read only the last line of text into flash?
(because of a data size of 65Kb + it's impossible to just keep reading the text file over and over)

Reading Last Line Of Textfile
Hello,

I am currently writing a flashscript that displays the contents of a text file.
I need to keep refreshing the data in the text file, because of data constantly being added to the text file.
Does anyone have a idea if it's possible to read only the last line of text into flash?
(because of a data size of 65Kb + it's impossible to just keep reading the text file over and over)

[Flash8]Help Reading Textfile Into Variables
Is there a simple way to read a arbitrary text from a textfile into Flash?
Or must it look like &avariable=blabla to read text from a textfile into Flash?

Maybe it's possible to just read the whole text and store it in a String and then cut it up and put it in some array or something similiar?
-------- EDIT ------
To simplify, is it possible to read a textfile without having "aVariabel=aText" in the beginning of the textfile?


The data looks like follows:

[31:[0,0,1,0],10047:[0,0,2,0],129752:[623,583,225,0]]

(The first number is a timestamp in milliseconds then there is x and y values and a idNumber)

LoadVariables() Reading From Textfile Won't Assign Variables?
Hello,

I googled and found some tutorials on this and even found one written here on actionscripts.org but I just cant seem to get the results I need. The tutorial was here:

http://www.actionscripts.org/tutoria...on/index.shtml

I setup my textfile.txt with &myname=myvalue as a single line.

in flash the first frame I use:

_root.loadVariables("textfile.txt")

Now here is where it gets mean. If I make a dynamic textbox with its var assigned as myname and I test the movie, the textbox will show the desired value from textfile.txt and it appears to be fine.

However if I am using a conditional statement which is what I need to do, it refuses to work. Like this..

if (_root.myname == "myvalue")
{
gotoAndPlay(2);
}
stop();

it refuses to work. So the value is there when used with a dynamic textbox but I cannot use it as a real variable for some reason. I don't know whats wrong with it and would appreciate some insight on this.

Thank you kindly for your help.

-Ji

Variable From Textfile To Load Other Textfile's Variables
Hello! This might puzzle your minds because it's looong but I need help!!

I've worked with flash for a couple of months but I'm still a newbie at scripting. I have this problem, I'm working on a very simple newsreader for a website.

My idea goes like this:
I have two textfields, one named "top", and the other one named "news". And then there are textfiles named "newsxxx.txt" beginning with "news000.txt". In news000.txt I have made the variables:

&top=The subject of the news&
&news=News posted here&
&newnews=news001.txt&
&oldnews=news000.txt&

As you see I have also added some variables for opening newer or older news with two buttons in the movie, one for newer and one for older. And in for example in "news001.txt" the &newnews=news002txt& and &oldnews=news000.txt&.

But there is this tricky thing with this newsreader. I want it to load the latest news when the newsframe is loaded. So I made a textfile called "latest.txt" containing &latest=news002.txt&. Since the newest news-textfile is "news002.txt" it says like that. Everytime news are posted this file has to be updated too. Next time: &latest=news003.txt& and so on.

In the newsframe in the movie I made and action:
loadVariablesNum("latest.txt", 0);

And the variable &latest=news002.txt& is loaded.
But now I just can't figure out how, after this script, load the contents of "news002.txt" using this variable "latest", because the news change dynamically when updated and this should read the latest file (news002.txt) from the latest.txt, and it's variable.

The contents of "news002.txt" is as I said, the &top=*& and the &news=*& variables which are loaded to the textfields. I got that working, but I have to make the flashmovie to determine the latest news-txt file automatically and load it.

This might be very simple but I want to use the variable from a textfile to load another textfile's variables into textfields.

Also I'm wondering how you could assing the two buttons to open a newer newspost or older using the variables:
&newnews=news001.txt&
&oldnews=news000.txt&
in each textfile.

So that's it.. ask if you want me to explain better if you didn't get it. Thanks a lot!

Reading Data From A Textfile
hi all,

i'm trying to read in some data from a text file to use in flash. the text file is in tab delimited format. anyone know if it's possible to read in this delimited type? i don't think it is unless i use the URL encoding character for a tab (%09) or some other special encoding character. I know you can use commas or pipes("|"), but was wondering if there's a way to encode the tab character.

also, i've read in simple text data before but in this case, i'm trying to read in the following data from the textfile. it's similar to a database table.


Code:
activeevent_namelinkstart_dayend_day
yesmyEventsomelink.htmmondaytuesday
yesyourEventlink2.htmwednesdaywednesday
nooldEventlink4.htmfridaysaturday
not sure how i would set up the text file (as far as any special characters go) so that i could read this into flash. if anyone can give me a head start on how to read it in (as far as the actionscript goes) that would be great.

i could do this with XML or via a database but in this case, i need to do it from a text file.

thanks in advance for anyone who can help with this.

Reading Textfield Line By Line ? Selecting Multiple Textfields At Once ?
OK i need some serious help/advice !

I`m trying to make a sort of program like word , i want to have a text field , but the problem comes when i want to create like borders around each line of text and have DIFFERENT background colors for each line.
So i was thinking if i can read line by line and get get the height of each line by examining char by char for it's size and get the biggest one ( since my text may have different fonts sizes ect on a single line) and then have like BLOCKS that are behind each line and adjust their sizes accoring to the line size and change their color also.

Also another thing that I would also want to do , i want to create a table which i did , but now how do i put the table into my text ...and not just lie on top blocking text behind it ..how do i like "push" the text around it ?? ANY IDEAS would help...thats why i thought maybe create lots of textfields just stacked from top to bottom..but then i will have the problem of selecting them all at once like in a REAL word processing problem...and also if the text becomes too big it will need to "flow" into next textfield...

Is there ANYWAY to do this ??! HELP ME!!!!

THANK YOU

Reading Data From Text File Line By Line
I want to read some data from a text file into arrays.
In the text file, I have:

data = 1234567890

This works ok, but I want the text format in the text file to be:

data =
12345
67890

So after reading 'data', i will have 2 arrays.
[1,2,3,4,5] and [6,7,8,9,0]

Any idea how to go about doing this?
It will be even better if I dont need to use any variable.
Like this:

12345
67890

The main thing is just to read the text line by line and get them into arrays.
Thanks.

Reading A Text File, Line By Line
I am using loadVar to read in a text file for processing by Actionscript.
Is it possible to just read in a portion of it (instead of the whole thing), process it and then read in some more? Specifically, can one read in up until a linefeed?

Reading Text File Line By Line
Hy all

Got the following code:


Code:
var strContent:String;
function fillContent(folder:String):void
{
var arrayMenuItems:Array = new Array();
var arrayContent:Array = new Array();
var arrayNews:Array = new Array();
var myContent:URLLoader = new URLLoader();
myContent.dataFormat = URLLoaderDataFormat.TEXT;
myContent.addEventListener(Event.COMPLETE, getString);
myContent.load(new URLRequest("content/" + folder + "/_content.php"));
contentText.multiline = true;
trace("./content/" + folder + "/_content.php");
trace("MY DATA: " + myContent.data);
contentText.htmlText = strContent;
contentText.setTextFormat(format_ContentRegularText);
contentTitle.setTextFormat(format_Titles);
menuItemFont.setTextFormat(format_MenuItems);
}

function getString(e:Event):void
{
strContent = e.target.data;
}
What I actually need is to be able to read the _content.php file line by line. I'd like to store each line of the text file in an array (arrayContent). But I haven't found ANY solutions yet for this problem.

Best thanks for trying to help

Regards

Store Each Line Of TextFile In Array
G'day everyone!

I just have a (hopefully-) simple question... I'd like to read a text file line by line and store each line in an array.

I tried to get this by using the URLLoader:


ActionScript Code:
var strContent:String;
function fillContent(folder:String):void
{
    var arrayMenuItems:Array = new Array();
    var arrayContent:Array = new Array();
    var arrayNews:Array = new Array();
    var myContent:URLLoader = new URLLoader();
    myContent.dataFormat = URLLoaderDataFormat.TEXT;
    myContent.load(new URLRequest("content/" + folder + "/_content.php"));
    myContent.addEventListener(Event.COMPLETE, getString);
    contentText.multiline = true;
    contentText.htmlText = strContent;
    contentText.setTextFormat(format_ContentRegularText);
}
function getString(e:Event):void
{
    strContent = e.target.data;
}

Think everything's clear now. I now would like to save each line to another array index (whatever)

ActionScript Code:
strContent = e.target.data;
Is it possible to change above code on a simple way so I can store the data within arrayContent ?

Finally the idea will be to store the content for each site in a php file in a specific folder. Inside the PHP I'll use own tags that I have to translate with my code. So I need each line to be separately stored.

Another thought of mine is to read all lines into a string. Perhaps there are also such separators like in normal text files (e.g. "backslash"n or "backslash"r) (I still don't know where the backslash is in osx

Best thanks for reading and trying to answer!!

Oli

Loadvars From Textfile Line Space Problem
Hi there

I'm loading some settings from a textfile using a Load vars object however Load vars does not seem to reconsize lines.

ie. it will only read the propertys properly if I format the variables in the text file like this>

&setting1=EWR&setting2=TDS&setting3=FDE

however my text files is set up so there is one line for each variable

&setting1=EWR
&setting2=TDS
&setting3=FDE

because the load vars object can't read lines it basicly adds all the space on the end of each property.

for example if I was to trace the value of setting1 in flash and use "!" to mark the begining and end of the variable I would get the following

trace("!" + myloadvars.setting1 + "!");

output=!EWR

!

when using the text file format in method one i get what I should have>

output=!EWR!

How do I get the load vars object to take into account line breaks so I can have a property on each line of my text file without tons of space being added onto each of the load vars propertys when it is in flash.

The reason I want to do this is because i have about 10000 settings and it takes hours to find a particular setting to edit in the text file if all of the 10000 settings are on the same line! By having each setting on a seperate line in the text file I can locate the desired setting to edit much more quickly.

Thanks in Advance

Reading Code Line By Line?
Guys (and girls) im trying to write a bit of code which appears to shake an image on screen, however when i put all my _x &_y functions in to move it around it reads the whole block in one, instead of reading and DISPLAYING each line seperately... how do i force code to do it (in director Id use an 'updatestage' command) many thanks

Reading In An External Textfile "slowly"
Suppose I have a textfile of 0's and 1's. The numbers control the behavior of a character instance. For exampoe, 0 is stay still and 1 is jump.

Usually, the entire file is imported at once. This would mean the character jumps and stays still at the same time (at least visible to the user). Is there a way to "slow" the import so that the "read" between each number is delayed by at least one second?

Please help. Thanks.

Getting Variables From Textfile
I have a program (non flash) that writes some text to a textfile every now and then. Is it possible to make a flashprogram that every now and then checks the file and gets variables from it?

Variables From Textfile
I created a flash movie.
In the textfile, I typed:
&words=this is the news.

in the Actions panel, I typed

Code:


loadVariablesNum("news.txt",0);
var news = words;
trace (news);



when I try to load the .swf the output is 'undefined'. why is that so?
The example above is not the actual situation. I just used it to describe my problem.

I want to do something else with the variable from the textfile but the output always turns out to be 'undefined'. How can I make it work?

Advanced Textfile Variables
hi!

this one is a little difficult to explain, but i'll try...

i have this section in the movie where i want to give a lot of information, divided (by frames)to several different issues with frames navigation.
in each frame there will be the same form pattern, and dynamic texts that will vary in each frame:
i'll give an example for a frame-

"info a": -inputa-
"info b": -inputb-
"info c": -inputc-

now, i want to use an external text file to give the input information. it's easy for one frame - i'm giving each dynamic text box a variable and putting it in the text file (after the "&" for variable seperation).
but if i have, say, 100 frames i'll have to make 100*(number of input variables) different dynamic texts, which is mess!

if i used a seperate text file for each frame, that would be easy, but i want it to be just one.

is there any way to do it?

i hope i did explain it in the right way.
thanks for your patience and attention,
yoni

How Can I Send Variables To A Textfile?
Hi 2 all,
I´ve got a big Problem. I have abot 100 vars in my Flash Programm, and now i would like to save them into a textfile. But Flash MX in unaibel to write directly into a textfile. So, how can i save my vars? It´s a pure Offlineprogramm, so Php or something like this will not work i think.

Thank all for help,

Andi2000

Loading Variables Via A Textfile
I am trying to load a textfile into flash using MX on a mac.

I am creating the text file in BBedit and it looks liike this...

<----start of textfile -->

online01= crumpler
&online02= "chupachups"
&online03= "wineflyers"
&online04= "aqualuna"

&offline01= "wineflyers"
&offline02= "crumpler"
&offline03= "ala"
&offline04= "aqualuna"
&end=1

<----end of textfile -->


now i am using this line to bring in the textfile

loadVariablesNum("custom.txt", 0);

and for testing i have a textfield called "online01" on the root of my stage. Just for a filler i have the words "sammi" in the textfield

the text field should be displaying the value "crumpler" but it's not. I have done this heaps of times before but i just can't seem to get this one to work and i don't know why, am i missing something simple?

the debugger shows that the variables are being set in the root, but the textfield is not displaying them, and the value of the textfield in the root "sammi" is also being set as a variable with the same name "online".

Argh, what am i doing wrong?

Put Textfile Variables To Array
Hi,
I am trying to put the retrieved textvalues into an array like the following way(see below). I cant get it done, so I hope someone can assist me in this

----------- code --------------------------------
loadVariablesNum("target.txt", 0); //loading the records
set (targetCount,targetCount); //total number of records
for (i=1; i<TargetCount; i++) {
set (target[i],target[i]); //creating the flash variables }

personDB =new Array();
personDB.push({id: "01",name:"Matthias Kannengiesser",stadt:"Stuttgard",plz:13234 });

So my question is:
1) How can I put e.g. the values of taget1, target2 etc. into the section id: " "?
2) making the array loop, based on the given targetcount, so that the array gets filled

Or is there perhaps a smarter way of doing this?

cheers
Patrick

Numerical Variables From Textfile
hello all,
I was curious if anyone knows how to bring numerical variables into flash for use in conditional statements. I have a file with numerical variables and if var 'test' > 2 then I want it load a movie, if greater than 3 then load another movie. I am sure you get the point. Any help would be appreciated.
Thanks Joey

Code:
loadText = new loadVars();
loadText.load("test.txt");
var test=_root.loadText.text;

function get_var(){

if(testa>2) {
LoadMovie("movie1.swf","emptymc1");
}
elseif(testb>3) {
LoadMovie("movie2.swf","emptymc2");

}

else{
LoadMovie("movie3.swf","emptymc3");
}
trace(test);
}

mc.onPress= get_var();

Using Number Variables From Ext. Textfile
Hi,

I have a question about loading variables from an external textfile... (I'm using... loadVariablesNum("myfile.txt",0); )

What happens precisely with numbers? When I set a variable in my textfile (f.ex mynmb=5), I can't do any calculations in flash with the var "mynmb".
I like to use it for calculations but when i try for ex...

var newNmb = mynmb +20;

"newNmb" returns nothing.
I also tried using it for going to a frame

_root.mcClip.gotoAndPlay(mynmb);

but nothing happens.
Can anyone tell me what I'm doing wrong?

Tia,
Yvan.

PHP Writing Variables To Textfile
Hello FlashCats,

I would like to find a simple PHP solution to something I am now using PERL for..... I am currently working on a Flash project that sends some textfield variables to a PERL script, which then writes the variables to a file, say 'text.txt' in the format :

var1=content goes here&var2=content goes here..... etc.

These are pulled into dynamic text fields in another flash movie. This all works fine, but its a pain to configure the PERL script for each new server I put it on (the absolute path to the file changes depending on how the server is set up). If any PHP wizards out there can help me out with some PHP code that would do the same thing (essentially, recieve variables from a SWF and write them to a textfile in the format shown above) I would appreciate it..

TIA,
Colin

Save Variables To Textfile?
Is there any way I can make Flash save variables or data in any kind into a textfile of my choice?
example:
I have a variable, mushroom=1 and i want it to be saved to fungus.txt the opposite to loadVariables.
Thanks in advance

Loading Variables From Textfile
Hi,


having a strange problem with loading variables for a flash movie that combines and creates a movie sequence to play from a selection of clips.

On the first frame i have the code:
var scene1;
scene1=0;
var scene2;
scene2=NULL;
var scene3;
scene3=NULL;
var scene4;
scene4=NULL;
loadVariablesNum("writeTo02.txt",0);
loadVariablesNum("writeTo03.txt",0);
loadVariablesNum("writeTo04.txt",0);

The textfiles contains the text:
scene2=3
scene3=7
scene4=25
in respective file.

To check that the variables are loaded, i have placed the variables in three dynamic text fields, which indicates that the variables scene2, scene3, and scene4 contains the numbers they are supposed to contain. These text fields indicates nothing stranges but shows accordingly:
3
7
25.

However, on the next frame i have placed the code:
if(scene2==1) {
loadMovie("FinalAutumn01.swf", _root.FilmHolder2);
}else if(scene2==2) {
loadMovie("FinalAutumn02.swf", _root.FilmHolder2);
}else if(scene2==3) {
loadMovie("FinalAutumn03.swf", _root.FilmHolder2);
}else if(scene2==4) {
etc ...
}

Next i use scene3 and scene4 in a similar way.
But this time the content of scene2, scene3, and scene4 is not recognized. The if-statement doesn't seem to recognize the variables loaded and doesn't respond to the 3 in the variable scene2. I have tried enclosing the 3 in quotationmarks "3", but there is no difference. The movies are loading fine if the variables are set manually.

I have somehow assumed that it might have to do something with global variables, but have not made it work anyway.

Has anyone got a clue about what is happening?
What can i do about it?

Thanks
Charlotta, Sweden

More Variables In A External Textfile
Hey

I'm trying to make some kind of logfile of my work in flash MX. The layout is: left some buttons and right a dynamic textbox. The buttons refer to week 1, week 2 etc. and when you click on one of the buttons, the log of that week is showed in the dynamic textbox. Every week has it's own textfile (week1.txt, week2.txt) so I was wondering if I could put them in one textfile. Just marking the text with week1= and week2= in one textfile won't do the job.

any help would be thankful!

Tipsko

Variables Loaded From A Textfile Are Not Recognized
Hi everybody !

Im loading variables from a textfile into my movie (or at least I`m trying). via loadVariablesNum("ausgabe1.txt",0)The textfiles content is:

_root.area1=12

Now, my movie has textfields, one of the named "area1" and right, it`s at the main Timeline.The data from the textfile is displayed in the field, and everything works concerning displaying the data from the Textfield.

The Problem however now is, I would like to use the data from "area1" for scaling bars via ._xscale. No matter what Itry, I don`t seem to be able to recover the content of _root.area1 nontheless it is read from the textfile and displayed correctly in the textfield.

I tried

onClipEvent(enterFrame)
{
variable=_root.area1;
}

but it also wouldn`t work. Where is the Proble, I can`t find it and it`s going to drive me insane...

Help would be very much appreciated really !

Saving Variables In Textfile On Server?
I want to save variables in a textfile on my server and then reload them from this textfile at a later time...how can I do this? I am VERY new to actionscripting.

Thx
John

[FMX] How To Load Variables From Textfile Into Array?
Hi,
I want to load all the variables from a txt-file into an array.
[list=1][*]How can I do this?[*]Have the variables in the txt-file to have a syntax like this: &answer1=blue&answer2=green&answer3=red or can I put it in there like this: blue,green,red[/list=1]
thnx in advance,

- Gelfling5775 -

Loaded Variables From Textfile To Array...?
Hello!

I want to make a menu wich loads the url's for the buttons from a text file.
I can load the variables butt I can only assign the variable name to the
button and not the actual data the variable contains.

here's my code:


Code:
this.loadVariables("menu_content.txt");
this.loadVariables("menu_links.txt")

for(i=1;i<11;i++){
_level0["b"+i].ButtonUrl = "index.php?page="+["L"+i];
_level0["b"+i].onRelease = function(){
this.animation.gotoAndPlay(5);
getURL(this.ButtonUrl);

};
}
This returns: "index.php?page=L1" instead of "index.php?page=home"

Do I need to create an array to get this right, and if so, how do I make one ????

This is the textfile I use:


Code:
L1=home
&L2=news
&L3=gigs
&L4=members
&L5=photoalbum
&L6=downloads
&L7=merchandise
&L8=mailinglist
&L9=contact
&L10=
Please help
Thank you!

How To Load Variables From Textfile Into Array?
My array is loading images and it does. It is situated on the timeline:

_root.num=0;
_root.arrayname=new Array(‘image1’,’image2’,’image3’);

Instead of feeding the array with these variables I have created a textfield from which the ar-ray should get its variables.

It is called: ‘text1.txt’

As the textfield contains the variables I wrote in it:

num.field1=’image1’,’image2,’image3’

Now I tried everything to make the array get its variables from the textfield, but it does not work.

For instance I tried:

    situating the script on the holder:

onClipEvent(enterFrame){
_root.loadVariables('tex1.txt',0);
_root.code=_root.num.field1;
}

    and situating the script on the timeline:

_root.num=0;
_root.arrayname=new Array(code);

This as well as other scripts I tried don’t work.
I would be very glad if somebody would help me with a solution.

Aribert




Reading A Specified Line In A Textfield
Hi!

Here is my question

- I have a Dynamic textfield with dynamic text ower serveral lines WORDWRAPs

- I need to read line by line to build up a new string so that my backend uses the same linebreaks that my flash textfield uses.

- So wat i really need to do is read line by line. Like line0 + "
" + line1 + "
" + line2 and so forth.

Any ideas?

Load Data From Textfile Into Variables For FOR-Loops
hello,

I'm new in this Forum, so I'm quite unfamiliar with it by now.
If I'm posting wrong, please tell me so I can learn

My Question:

I'm making something like a dynamic Picture Viewer, wich should display Pictures named by photo1, photo2, etc. dynamically from an url I give the viewer as a parameter. Thats not my problem by now, my problem is that I try to give the viewer few "parameters" through a text-file

NumberOfPictuers=12

I load this file like this

loadNumber = new loadVars();

loadNumer.onLoad = function()
{
/* - And here's the problem: I want to load the variable not into a
textbox, but into a variable like i for example, so I tried it like this*/

txtHelpText.text=this.NumberOfVariables;
}

//outside the function i tried this

i=txtHelpText.text;


//I tried to reassign directly into i (inside the onLoad-function), like this

i=this.NumberOfVariables

I tried a lot but, didn't succed to get the data from the textfile into
i so i can use it like this

for (k=1; k==i; k++)

or to use it for other purposes.

If someone nows an answer, please help,

Like I said I'm new with this, if I'm posting wrong, or if the problem is to easy for this forum I'm sorry.

Thanks for the help
Aleksandar

Load Data From Textfile Into Variables For FOR-Loops
hello,

I'm new in this Forum, so I'm quite unfamiliar with it by now.
If I'm posting wrong, please tell me so I can learn

My Question:

I'm making something like a dynamic Picture Viewer, wich should display Pictures named by photo1, photo2, etc. dynamically from an url I give the viewer as a parameter. Thats not my problem by now, my problem is that I try to give the viewer few "parameters" through a text-file

NumberOfPictuers=12

I load this file like this

loadNumber = new loadVars();

loadNumer.onLoad = function()
{
/* - And here's the problem: I want to load the variable not into a
textbox, but into a variable like i for example, so I tried it like this*/

txtHelpText.text=this.NumberOfVariables;
}

//outside the function i tried this

i=txtHelpText.text;


//I tried to reassign directly into i (inside the onLoad-function), like this

i=this.NumberOfVariables

I tried a lot but, didn't succed to get the data from the textfile into
i so i can use it like this

for (k=1; k==i; k++)

or to use it for other purposes.

If someone nows an answer, please help,

Like I said I'm new with this, if I'm posting wrong, or if the problem is to easy for this forum I'm sorry.

Thanks for the help
Aleksandar

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.

Reading One Line Of A File At A Time (ActionSript)
I'm using Perl for all of my backend database work. There are multiple
items in the database. Each item is stored on a single line which contains
all of that particular item's individual properties (such as name, price,
color, description). In Perl, I'm able to read in the entire file at once
into a single array. The array will have each line of the file (delimenated
by the newline char '
' ) as a separate index. I'm then able to
manipulate the individual values that are stored for each item within each
line.

The problem that I'm facing is that each item uses the same variable names
for its properties (ie all items have variables called itmName, itmPrice,
itmColor, etc). Therefore the LoadVariables command within ActionScript
keep overwriting each variable (ie itmName) every time it re-occurs within
the file.

Is there a method within ActionScript that will allow you to read the
contents of a file w/out automatically splitting the variables for you? Or
can you think of any other solution to my delimma?

I'll be VERY appreciative of any help at all. Thank you ahead of time,

-Nathan Chatellier
-support@ignitrix.com

Loading Variables From A Textfile. Sounds Simple? Doesn't Work.
Hi, I was just making my footer and as you can see here it's pretty much empty, because there's supposed to be a small block of text under my name in it. In the fla I've used this peace of code in the actions of the first and only frame:

ActionScript Code:
_root.loadVariables("http://blippo.addr.com/footer.txt");    stop();

And then I have a dynamic textbox that displays the variable quote. That's because the file http://blippo.addr.com/footer.txt has this inside:

Code:
&quote=Bla bla bla bla
So when I test my movie in Flash MX it works fine and it displays the text that it loaded from the URL. Now when I put this on the net, it doesn't work, as you can right in my signature (unless I've gotten it to work by now, hehe).
All help is appreciated. Also, here's the fla file.

Loading Variables From A Textfile. Sounds Simple? Doesn't Work.
Hi, I was just making my footer and as you can see here it's pretty much empty, because there's supposed to be a small block of text under my name in it. In the fla I've used this peace of code in the actions of the first and only frame:

ActionScript Code:
_root.loadVariables("http://blippo.addr.com/footer.txt");    stop();

And then I have a dynamic textbox that displays the variable quote. That's because the file http://blippo.addr.com/footer.txt has this inside:

Code:
&quote=Bla bla bla bla
So when I test my movie in Flash MX it works fine and it displays the text that it loaded from the URL. Now when I put this on the net, it doesn't work, as you can right in my signature (unless I've gotten it to work by now, hehe).
All help is appreciated. Also, here's the fla file.

Reading Text File Then Displaying Each Line As Seperate Movie
Reading text file then displaying each line as separate movie. Can this be done?

I want to read in my text file. eg...
Cat
Dog
Cow

Then display each line moving up the page. The purpose of this is so I can add to the text file and not have to update the flash movie. If there is anyway I can achieve this, can someone plz assist...

Cheers,
  David


Reading Variables
Hey people,

I ran into a little problem and hope thought some of you might be able to help me out.

I have set some variables in my root movie and my second movie (loaded into a target on the root movei, not using levels) doesn't seem to be reading that. And I am just wondering why.

I have tried the 'with' command too, no luck.

Thanks in advance.

Reading Variables
hi

is it possible to read a variable that is defined in a javascript on the HTML-Page where my swf-movie is embedded?
i need a solution that works on Macintosh-Systems too.

thanks for help

Reading Variables From Another Swf?
Hi,

is it possible to load a swf-movie into another and use the variables of the main-swf? I wan't to read a number from the main swf into a loaded swf (loadmovienum..).

Thx in advance
Riven

Reading Variables From A Url
let's say I have a url like

www.mysite.com/index.php?name=sam

How can I then use this variable in flash? I figured something like this would be a start but I can't seem to finish it:


PHP Code:



s = unescape(_url);
useURL = s.substr(s.indexOf("?")+1, s.length);




Thanks for the help!

Reading Url Variables
i want my flash to be able to read the url's variable so that my flash will appear accordingly to what the user specify.
so far example, i have this url, http://www.mywebsite.com/enter.php?...one&option2=two
how do i code in the actionscript to read the option1 and option2 variables from the url?
thanks

Help Please, Reading Variables From Php
I have a SWF as the header to my website.
When the page is loaded, header.swf loads a random SWF from a designated folder.

loadVariablesNum("billboards/count.php", 0, "POST");
loadMovie("billboards/billboard"+num+".swf", "_root.stage");

count.php counts the # of swf files in the folder it can choose from and returns a random number for one of them, for example: "&num=3"

it tries to load "billboard.swf" and ignores the num variable, any idea what am I doing wrong?

I'm pretty sure the php script is working, and it's something to do with the variable being translated back into flash, but here's the php file anyway:

$dir = $_SERVER['DOCUMENT_ROOT'].dirname($PHP_SELF);
$handle = opendir($dir);
$count = 0;
while (false !== ($file = readdir($handle))) {
if (is_file($file) && $file !== '.' && $file !== '..' && $file !== 'count.php') {
$count++;
}
}
$num = rand(1, $count);
print "&num=" . $num . "";

Thanks!

Reading In Variables?
Hi folks,

I'm trying to read in an external text file and use the variable values to increment the rotation of an mc. I can't seem to get it to work. My code is below. Is there something very obvious?

Cheers 101


Quote:





stop();
loadNumVar = new LoadVars();
var redun:Number = new Number();
var griev:Number = new Number();
var disc:Number = new Number();
loadNumVar.onLoad = function(success) {
if (success) {
redun = this.redun;
griev = this.griev;
disc = this.disc;
;}
};
loadNumVar.load("./Presentation_Data/Data.txt");

_root.obj_mc._rotation = _root.obj_mc._rotation+VARIABLE VALUE;

Reading SWF Variables Using PHP?
I was wondering if anyone knew how to read SWF data using PHP? Like, if I created a SWF with an internal variable:


PHP Code:



var imageName = 'Dogs playing poker.'; 




Is there a class in PHP that can read the variables used in a given SWF? I found one class that can read and modify the basic headers of a SWF:

http://www.sephiroth.it/index.php?bl...07_weekly.html

...but I don't think this is what I'm looking for. All I really want to do is what I wrote above.

Thanks in advance.

Reading GET Variables
Hello! I am making a sound player for my website, and I need the the player to read a GET variable to find the sound to play. I can't find ANY good resources for this. Could I please have some help?

Cheers,

MJAZ

Matt www.cyber-share.com

Loading/reading Txt Variables
Anyone know any good sources where I can learn how to have my Flash movies read from text documents..whether it be web or book or whatever, please pass it on!

Thanks

Charles C.
http://www.StiffieJones.com

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