Load Variables: Text File
i'm using the following script to load text file variables:
Code: on (release) { _parent.Thread = "loading..."; _parent.File = File; _parent.Topic = Topic; loadVariables (_root.Forum.PathToDir+_root.Forum.Category+"/"+_root.Forum.File, _parent); }
(Flash 5)
it loads the files no problem.... however, if i add information to a particular text file (it's a message board), when i click the subject again (the script above), it doesn't load my updated text file (with the new comments).
i'm guessing that this is something to do with the fact that after originally loading the text file, it just reads this (cached file) and not my updated version.
is there any way around this...??
any help very much appreciated... this is really doin my head in now!!
cheers - ric
FlashKit > Flash Help > Flash ActionScript
Posted on: 01-27-2004, 03:40 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Load Variables From Text Then Loading Image File With The Filename Given In Text File
The problem is, that i need flash to load variable from text file, eg: info.txt, with image=gt.jpg in it.
Then I want flash movie to load a gt.jpg into a blank movie.
The point is that after i change filename in txt file, i want movie to load that img.
I wrote AS:
loadVariablesNum("info.txt", 0);
loadMovieNum(image, 0);
but it's not working
After i traced variable image, debugger showed that this variable undefined, but if i put textbox with image as variable, it shows "gt.jpg".
Please help
How To Load More Than One Variables From One Text File ....
hello again......
well friends i have another prob....
lets c .... i have a text file name myfile.txt and in it the variable mytxt=.... now i want to add more than one variables in that file....
like .... mytxt1=
mytxt2=
mytxt3=
mytxt4= and etc...
so how can i do that..... how can i close a variable and start other.... or how can i difrentiate them.. so that i can load them from different places.... or on diff events...
what if i have a mc of 20 frames... now i want to load the
mytxt1= on frame 5
mytxt2= on frame 10
mytxt3= on frame 15
mytxt4= on frame 20
but the prob is that ... i want to use only one txt file for that... :-
ANY SUGGESTIONS plz !!!
Load Variables From A Text File - Help
Using a text file to load variables into a movie. Loading in OK but can't do maths with them - I assume this is because they are a text string? Tried Number function and parseInt to convert them to numbers but neither seem to work. What am I doing wrong???
Loading variables with:
loadVariablesNum("blueballdata.txt", 0);
in main timeline frame 2
then trying to add positionx and positiony and display answer in text field (also use values to position a movieclip on the stage)
have tried
total = Number(positionx) + Number(positiony)
and the same syntax with parseInt.
Any help appreciated
Load Variables From Text File = HELP
Hello All,
I'm hoping someone can help me with this issue. I am using the loadVariablesNum and importing variables from a text file. The problem is when the variables load they load with quotes around them. I need the variable to be a numeric 1 or 0 (1 for true 0 for false) so I can later I can check for equality (==).
How can I get the variable when loaded from a text file to be:
myvar = 1
instead of the way it is currently loading:
myvar = "1"
Thank you for any help.
Flanim8r
Load Variables From A Text File
I have a couple of questions about loading a text file.
One. When my text file is loaded in the text box and you scroll down to read it then try to load another text file in the same textfield, it doesn't return to the top. How do I fix that?
Two. It seems that my text box is only loading a maximum number of characters. It doesn't load the whole text file. Can I fix that.
Three. A client that knows nothing about html is uploading the .txt files. Anytime she uses an apostrophe (') it shows up as a square. Can I somehow embed that character so it shows up?
Thanks for your help on any of these questions. Here is the link to the site so you can see what I mean.
http://www.dwightillinois.com/minutes.htm
Load Variables From Text File...
Hey,
I want to create flash site which reads the variables off of a text file. I currently have 2 layers (canvas & scripts). On the canvas I have 20 text layers which are set to dynamicly load according to the variable names (t1, t2, t3, etc...). On the script layer I used loadVariables("text.txt"); and in the file I have t1=xxx&t2=yyy&t3=zzz. However when I try to load the movie it says that I have the incorrect number of parameters and I have to have b/w 2 and 3. Please Help!
Load Variables From Text File...
hey all
can i load an array from a text file? and how would i write the syntax in the file?
i dont think i can, but thats why im here
if not....
i would like to load a variable from the text file example
myVar=one+two+three
how, in flash5 can i rip apart the string to make the 3 words separate, which i will be using for 3 other variables?
thanx in advance...
cheers
paul
Load Variables From A Text File
Let's say I have something like this, which loads a random movie:
Code:
file = ["movie1", "movie2", "movie3"];
i = file.length;
j = Math.floor(Math.random()*i);
loadMovieNum(filename[j], 1);
Is there a way I can use a text file with something like this:
Code:
movies = "movie1", "movie2", "movie3"
And use this in the fla file:
Code:
file = [movies];
i = file.length;
j = Math.floor(Math.random()*i);
loadMovieNum(filename[j], 1);
This way, whenever I want to update the movies, I can edit the text file instead of the fla file.
Load Variables From Random Text File In Set? HELP
I need to be able to_ Load variables from random text file in a given a set._ I am using the newest flash version (fx, mx??) on Mac OS X
heres what I was emailed
"needs:_
1. we'd like this game to load numbers dynamically from a given range
of numbers rather than from a textfile._ If all the numeric variables
loaded randomly from say a range of 1 to 10 for level 1 then how can
you program to make the answer for the game?_
2. , we have to devise a
way to keep track of the number of times a user chooses the bucket and
make the bucket work that many times._ So if you click 30 times
really fast on the bucket, it will probably only work 2 or 3 times as
it has to play an animation after a click._ The bucket becomes
inactive while in animation so how do we tell it to keep working
based on clicks?_
3._ keeping track of correct answers._ So this may be a way off but
we need to keep track of the wins by a user when they enter into the game._ keep track of these wins over the course of the whole game, or based on each user. "
can anyone help me or give me code for how to do any of this? I am rather lost and don't know where to begin- please help! I am still a beginner and would love some step by step how to's thank you!
Using This._name To Load Text File Variables
n00b question here
i've managed to get a dynamic text box to display the instance name of it's parent MC (infoa, infob, infoc...):
on (release) {
gotoAndPlay(2);
txt.words = this._name;
with (anim) {
play();
}
}
But how can I get the text box to display the variable of the same name which is in a .txt.
Where should i put my loadVariables and what should it say
what i need is 64 instances of cubeMC, but when you click on one it displays the text according to which instance you click. The text (which has var: words) is inside txtMC (instance name txt) which is in cubeMC.
any help appreciated
Problem In Load Variables From Text File
I would like to load a plenty of data from a text file and then assign them to the variables in flash. However, when I use:
loadVariablesNum("test.txt",0);
doAssignment();
gotoAndPlay("finishLoading");
to achieve the purpose, the flash movie does not function well and it unreasonably back and stop to the first frame in the _root level. I think it should be the problem that the movie do not have enough time to load all variables from text file, so that it perform wrongly, isn't it? If so, how could I ensure that all data was loaded before move on to other frame, or does anyone have better solution to this problem? thanks for your help!!
Load Variables Email Address From Text File Anyone?
I have the code below attached to a movieclip which i am attempting to use to call in an email address from a text file. The idea being that the textfile can be altered by a luddite, and the recipient email adress changed in the flash file.... but i'm not doing too well...!
The best i have achieved is undefined email or garbage.
all help greatfully received. thanks.
___________________________________
on (rollOver) {
this.gotoAndPlay(2);
}
on (release) {
loadText = function(){
loadText = new LoadVars();
loadText.load("email.txt");
loadText.onLoad = function() {
emailAddress = this.eAddress;
}
}
submit.onRelease = function(){
getURL("mailto:"+emailAddress);
}
}
on (rollout) {
this.gotoAndPlay(1);
Load Variables From Text File On Hard Drive?
Hello, all.
Can some one help me with an issue I'm having with loading variables from a text file that is sitting on a Hard Drive rather than the server?
I would like each computer station to pull data from the server based on their individual Station IDs (which is defined in the text file on the hard drive).
The path to the text file is C:StationID.txt - I am having trouble with defining the PATH to the text file on the actual hard drive.
Thank you very much
Problems Loading External Text File With Load Variables In Windows
Hi,
I want to load the text content in my Flash movie from a external text files with the load variable action. Everything works great, that is when I test it on my Mac, when I try it in Windows under virtual PC explorer won't load the external text files into my movie. Sometimes it even crashes Explorer completely! I tried several source codes which I found on Flashkit but every time the same happens.
Return Variables From Php To Load In Flash Text Variables
Im having an issue using the kirupa flash login. I already have the actual login working with php and mysql but i need to change it up a little bit and i don't know enough about php to write it myself. But here's the situation.
Flash login is a basic script, I've already modified this part and it works great
What I need to know is how to modify it so when a user logs in, php captures the $_POST and returns the alternate variable fields that consist of ("co","fname","lname","cph","email") within the ID for user and pass
also i have already made a common loadMovie to load random variables i just need the php to point to the movie
Loading Variables From Text File. ( Not Fixed Variables )
i would like to know how to make my Flash werbby load variables like this automatically everytime i load my flash webby
(this is contained inside a text file) example:
&news[15462]=hello&
&news[14890]=uuuuuuuuuuuh :P&
but i won't be using fixed numbers. these numbers will be randonmize. but how do i tell my textfield to load allll variables that contain the word "news" and a value (number) ? or is there any other ways of doing this?
[Edited by xanbarian on 07-08-2002 at 12:56 AM]
Assigning Dynamic Text File Variables To Variables
Ok so I know exactly how to load variables from a text file and catching these variables in a dynamic textbox to show there string content. But I wanted to work with the string in the passed variable (ie from txt file) BEFORE I display the text in the dymnic text box. I seem to be having trouble assigning the passed .txt file variable to a newly created variable in my movie, it keeps saying "Undefined" when I run a trace().
<code>
//The contents of the text file looks like this
&textxxx=This is the text withing the text variabale
//1st frame, layer 2 in main
loadVariables("text.txt", _root)
//1st frame, layer 1 (below layer 2)
_root.strText = _root.textxxx
</code>
->So why does it say strText "Undefined" !? Does flash not allow variables to be assigned to variables?
If you help that would be fantastic
Can You Load Different Variables From One TXT File?
I have an MC. It contains a dynamic text box, called "textbox". Let's say I need to reload this MC, but different variables each time.
========-VARIABLES-======
1. Native Americans - blah blah blah...
2. Early Settlers - blah blah blah...
3. Maryland - blah blah blah...
etc...
How do you load multiple variables from one text file?
PLZ HLP
[Edited by phallex on 10-30-2001 at 12:09 PM]
Load Variables From ASP File
Well,
I have a flash file called title.swf
this file need to load a VARIABLE title in the file.
But, Can't use Loadvariables("test.asp") because the TITLE.SWF is used in many files
I use in test.asp, main.asp, news.asp and i can use in other, I make this metod , for not having to do a file for all page that I'll need to use.
How I can make the flash to LOAD the VARIABLEs in the LOCAL of de SWF is displayed??
Please help mee !!
Regards, Eduardo
Can I Load Different Variables From The Same File?
Well I found a calendar that will allow me to put text into the dates. The issue I am having now is loading in the text from a text file. Now I know I could do this the hard way and have 31 different text files for each day but that seems like a lot of work and seems like there should be an easier way So does anyone know how I can have different data in one text file for different dates? Hope that made sense! I found a tutorial here where it inputs the weather into different fields, but each set of information had a different file. I figure there must be a way that I can tell it to only load one file, but then a seperate command on each button (date) to tell it to only load a certain part of the text file....for instance....
Day 1 = meeting 10am
Day 2 = lunch 12 noon
etc.. and tell the button on day 1 to only load in the variable after day 1 in the text.txt file?
Can anyone help..or have I totally confused you all!?!? Thanks!
Load Different Variables From The Same File In Different MC's
Hi,
Hope somebody can help me out;
I want to load different variables from a php file into two textboxes with variablenames. But it will only work with the one one the main tmeline. There is another textbox in a MC in a MC!
So far i have done this;
-there's variable with the value of the URL
after pressing a button i want a text (a MC in a MC) and an emailaddress to be sent to the php-file. The emailaddress inputtextbox is on the _root; therefore it works fine. But the text in in a textbox (variablename; _bestellingsbox) in a MC inanother MC and wont work!!.
I hope i am clear enough and anybody is willing to help me... i know the php file is working after tests i did.
Thanx
FD
Load Variables From Txt File
I have a confusing question !
I know how to load variables from a text file, but how can i make the load variable in flash load a text file to tell it what text file to load ? Confused ???
Senario:
I have a flash movie that loads text from a text file, I have to make the same movie but with 30 different text files depending on the location of the movie. i.e. Venue 1 will need text file 1, Venue 2 will need text file 2.
I have stored the text files on a server so that I can change the content of the files remotley, I would like to save a local file with the swf that tells the movie the location of the text file it needs to load. rather than saving the swf 30 times with different paths in it?
I hope you can make sence of what I am trying to do.
Using Variables You Load From A Txt File...
I've learned how to use loadVariablesNum to load variables into text-fields with a txt file. Now I try to use these variables and they say "undefined"...
What if I had loaded variables from "one.txt" which defined
&variableA = 54
then loaded variables from "two.txt" which defined
&variableB = 46
Then inside my flash movie I wanted to make
variableC = variableA + variableB
Then load it in my text field in flash like this
_root.textBox1.text = variableC;
How could I get such an effect? It doesn't work when I do it this way, I even tried making 3 diff. text fields in my flash movie and loading variableA to one field (worked), variableB to another (worked), and then put
this.textBox3.text = this.textBox1.text + this.textBox2.text;
If I'm not mistaking it said something like 5446 instead of adding them as numbers.
PLEASE CAN SOMEBODY HELP ME!!! I REALLY WANNA FINISH MY WEBSITE!
Load Variables From Txt File
I understand how to load (and display) a variable from a txt file. What I would like to know is if it is possible to have a single txt file containing more than one variable?
[F8] Help On How To Load Variables From Php File.
Hey guys,
Ok I'm making a high score table and I have a php file and the database all sorted.
Im just not sure how do I load my variables from my php file and how to assign a varibale to a dynamic text box, which will display that variable.
my php file is located: http://localhost/new_msql.php
My variable names are:
-Number_of_minimum_attempts
-Number_of_attempts
-Number_of_wrong_attempts
-Date_time
My instance names for my dynamic text boxes:
-minimum1
-attempts1
-wrong1
-date1
Hope that makes sense. Thanks guys
How To Load Variables From A .txt File
Hi.
I usually make a flash aplication in colaboration with a php programmer. But i want to test my swfs without having to wait for him. So i want to do that through a text file. I know that flash can load variables from text files. The problem is i don't know how to format the text file ( example.txt).
Thank you
Attach Code
var puzzle:LoadVars = new LoadVars();
puzzle.onLoad = function(success:Boolean):Void {
if (success) {
pVar = puzzle.puzzlevar;
}
};
_root.puzzle.load("puzzle.txt");
if (pVar == 1) {
piesa1_mc._visible = false;
piesa2_mc._visible = false;
piesa3_mc._visible = false;
piesa4_mc._visible = false;
piesa6_mc._visible = false;
}
if (pVar == 2) {
piesa1_mc._visible = false;
piesa2_mc._visible = false;
piesa3_mc._visible = false;
piesa4_mc._visible = false;
piesa6_mc._visible = false;
piesa5_mc._visible = false;
piesa7_mc._visible = false;
piesa8_mc._visible = false;
piesa12_mc._visible = false;
piesa13_mc._visible = false;
}
Edited: 02/22/2008 at 01:38:26 AM by Venian
Load Several Variables From 1 Txt File
hello
I import variables from txt file with loadvariablesnum.
but,
I can load only one variable from my txt file.
exemple of my txt file : var_a = 2
I would like to load several variables from 1 txt file.
like : var_a=2
var_b=3
var_c=4
How seperate the variables in the txt file for Flash to recognize each one???????
thanks for your help
Load Several Variables From 1 Txt File
hello
I import variables from txt file with loadvariablesnum.
but,
I can load only one variable from my txt file.
exemple of my txt file : var_a = 2
I would like to load several variables from 1 txt file.
like : var_a=2
var_b=3
var_c=4
How seperate the variables in the txt file for Flash to recognize each one???????
thanks for your help
Cant Load Variables From A Txt File
Hi, iv been trying to load some variables from a 'txt' file into some arrays that i defined. This is the code i used:
FileName = new Array();
NosOfFiles = new Array();
loadVariablesNum("photolist.txt",0);
The variables in the 'txt' file were defiined in the following string:
FileName=abar,beach,boat,chateau,eleven45,panchos,tiberious&NosOfFiles=11,7,9,14,15,11,13
Whenever i test the code the contents of the arrays are always set as 'undefined'
please help
thanks
LOAD MULTIPLE VARIABLES FROM TXT FILE?
Is there a way to define multiple variables in a text file??
My txt file looks like this:
date01=11.20.01
bands01=Blah blah blah
venue01=Blah blah blah
info01=Poop
Only the date variable loads....can you load more than one in 1 text file????
All of my textfields are in the same location as the one that works and the names are spelled correctly...
Can I set up an array? If so, how does the syntax look?
[Edited by shreder540 on 11-20-2001 at 10:44 PM]
Load Variables From File With The 'ñ' Character
Hi there. I'm making a good guestbook with Flash MX 2004, and I've corrected almost every posible bug to be, but I don't know how to write the 'ñ' character, because flash doesn't seem to load it from the text file, and tend to collapse...
Is it posible to read the 'ñ' character from a text file??
THX a lot
Can't Seem To Load In Variables From An External File
Hi there, hopefully somebody will be kind enough to point out the error in my code. I want to randomly generate a word from an external text file on mouseclick. The external file has 1,000 words, all separated with a comma. Here is the code in frame 1:
myGenerator = new LoadVars();
myGenerator.load("words.txt");
allWords = myGenerator.words;
words = new Array();
words = allWords.split(",");
myArray = words.length-1;
stop();
And on the button is this code:
on (release) {
word1 = words[random(myArray)];
}
where word1 is a dynamic text box.
Thank you for your help!
New Movie Won't Load Variables From Txt File
Hi
Got an annoying problem which is probably easily solved but i'm new to this stuff so maybe you can help.
I have a movie (lets call it movie a) that loads variables from a txt file called answers.txt into dynamic text boxes. So far so good.
I have a swf file (movie b) that also displays text from the same txt file and that works fine too.
The problem occurs when I load 'movie b' into 'movie a' using loadMovie. The dynamic text box in 'movie b' does not display the text from the .txt file.
What am I doing wrong??
Thanks in advance
Elliot
Load Multiple Variables From One Txt File
Hi!
I can't seem to find an answer for this...
I'd like to have one txt file with multiple variables in it, like:
a=blah blah
b=more blah
c=even more
d=etc
Right now, I have the file loading & created the dynamic text boxes, but it only seems to recognize the first variable. For example, initially, I only saw variable a, then I switched a & b in the file, then I only saw b.
Can this be done? I'd rather not have to have separate files if possible.
Thanks in advance!
Jessica
Comparing Variables To Variables In A Text File
I am trying to make a login in flash and I would like to have a txt file with user names and one with passwords or have one file with both. When they click submit it will see if the user name and password they entered are in the text file if they are it will do one thing and if they are not it does another.
Load Variables From Txt File Into An Swf, When It Itslef Is Loaded
Ok this is a tricky one to explain
I have content loaded into an swf from a txt file - nothing dificult there - the usual
==============================================
loadVariables (text_file.txt, this)
==============================================
instruction
no problem
I now am loading this whole swf into a container movieclip in a larger movie, but when it appears in the larger movie, the content from the text files is not there.
All of the files are in the same folder so this is not the problem
I have also tried altering the path of the loadVariable command to target the loaded swf within the larger movie by using
_root.mc_instance_name.container
the content is just not loading up in the called swf, within the main movie
Would appreciate any help you can give...
Load Variables From Html File Swf Is Embedded In?
Is it possible to capture variables within the html page a swf movie is embedded in?
eg
.....
OBJECT
*PARAM NAME=movie VALUE="bobby.swf?variable1=1&variable2=correct"
*EMBED src="bobby.swf?variable1=1&variable2=correct"
OBJECT
HTML
thanks in advance
Load Unknown Number Of Variables From File
Hi
I am trying to load variables from a text files using URLLoader.
The text file looks like this:
NumOfVariables=N&value1=X1&value2=X2......&valueN= XN
How can I load these variables , when I don't know in advance how many there are (N is unknown)?
Thanks
Joe
Html File Using Load Variables & GetURL
So far I created a load Variables, so that I have a url encoded addresses calling the variable in flash. Then I wanted a easier way and shorter way to update links in getURL. Would this work:
here is my code:
in the text file:
giveMe=http://yahoo.com/ append/jdjhj/kjjh/blah.html
in the first frame:
loadVariables(giveMe);
on the button:
on(release){
getURL("giveMe",_blank);
}
Load Text File Data (No Variable In Text File )
Hi everyone,
In Flash Mx,
How can i load data from the text file ??
I know its easy using variables but..
There is only text, no varibales like -- Name=bla bla
in the text file
So, how can i load all the data from the text file in a varibale(I am not getting any variable from the text file, getting only data) ??
Thanx in advance,
$hailesh Mewada
[F8] Load Dynamically External Images Via Variables In Txt File
i need something like below
http://www.infopia.com/includes/swf_files/partners.swf
i want to load unlimited images via variables in txt like
image1
image2
and thing is that i want to make them animated/fading... just like above
howz that possible plz help me
Load Long String Of Variables From External File
I have some variables that I am trying to load into flash using AS2. The string is relatively long (2610 characters) and I am really having trouble getting this to work. If I hardcode the variables as a text file they load fine, but if I try to read them out of a database using PHP flash can't get the variable values. I have tested the php in a browser and there are no problems with the page itself. Its like flash is unhappy with the few extra milliseconds PHP is taking to generate the page dynamically. I have even tried LoadVars onLoad success, and flash decides the page is loaded even though it doesn't have any variable values yet.
Could someone please give me the most reliable way to do this in AS2?
How To Load Variables From External File And Insert Into TextInput Component
This is for mx 2004. I'm not very familiar with actionscripting - I've been searching for this solution for 2 days now and can't seem to be able to find any tips on this... I figure it's pretty simple though!
All I need to know is the code to load variables from an external txt file at the beginning of flash movie...At various keyframes in the scene the movie shows different forms for user to fill in into the TextInput components. As soon as these forms are shown, the TextInput components are pre-filled with default text (the variable values that were loaded, for example "Enter your title here"). I know how to do this in earlier versions easily with the Var variable but now I'm stuck. I've been trying to do something but I keep getting "undefined" in the TextInput.
Hopefully someone can help!
How To Load Variables From External File And Insert Into TextInput Component
This is for flash mx 2004 and should be compatible with AS 1.0, not 2.0 unless necessary. I'm not very familiar with actionscripting - I've been searching for this solution for 2 days now and can't seem to be able to find any tips on this...
All I need to know is the code to load string variables from an external txt file at the beginning of flash movie...At various keyframes in the scene the movie shows different forms for user to fill in. As soon as these forms are shown, the TextInput components are pre-filled with default text (the variables that were loaded, for example "Enter your title here"). I know how to do this in earlier versions easily with the Var variable but now I'm stuck.
Hopefully someone can help!
|