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




LoadVariable



io folks I got a litle problem fixing an elementary loadvariable routine. var nmVars=new LoadVars();nmVars.load("NFO/C01.txt"); nmVars.onLoad=function (ok) { if (ok) {i=1;while (i++<=4) { nm (eval("p00"+i)).split("¢");preNM=nm.slice(1,2);lstNM=nm.slice(3,4); po=(eva("p00"+i)).split("¢");io=nmVars.po; }}} ___C01.txt&p001=¢The Ticket magazine¢ ¢SWF/TIC.swf¢... Its goes fine when I putio=nmVars.p001;but how to replace p001 by a variable ? Thanx for help



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 09-03-2004, 10:58 AM


View Complete Forum Thread with Replies

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

Loadvariable
Hi!

How can I load text into my flash movie whith loadvariable?

Thanks!

Using LoadVariable
Hi,

I am trying to use the loadVariables action in Flash 5. I cannot figure out how to use the loaded variables inside a movie clip. I can make the variable become the text inside a textfield that is on _level0 but I cannot figure out how to use it in any othr situation.

For example, if I want to say something like:

loadVariables("score.txt", 0);
myScore.txt = txt0;
myScore.comment = comment0;

this being all on the first frame of the main timeline and the variables txt0 and comment0 being inside the score.txt file with correct notation and all. This does not work for me. I have tried several variations like _root["txt0"] _root.txt0 _level0.txt0 and so on. Which are all correct.

I need help I am lost. Please email me if you have a response, although I will keep checking.

Thanks,
Sandro
throwthegame@yahoo.com

LoadVariable And ASP
Hi,
I'm using

loadVariables("send.asp", _root.contactdud, "POST");

to send variables from a form in Flash to an ASP page to sned them out as an e-mail.
It is not working.
Is this the right syntax???
What is the difference between an expression and stuff with "quotes"

cheers,
George.

Loadvariable Help
How can get a text box to display the text after i load the strings from a text file

Help With LoadVariable
Hi guys out there: First, I have a main movie called home.swf, which loads external movies through a blank movie clip instance called loader (so I can control the _x and _y position - wow, what a smart guy I am...). I have a secondary movie called news.swf with a dynamic text field (variable name "news"), which loads a text file called news.txt using this code:

loadVariable ("news.txt",0,"GET");

so when I play the news.swf movie (standalone), it loads perfectly the news.txt file; but once I load this movie in the main movie described above(home.swf) using the blank movie clip... this loads the news.swf movie but not the news.txt. So if anybody has solved this problem, please let me know it right the way.
Thanks in advanced.

PD: The text field inside the news.swf is located in the main timeline of the movie, that's why I'm using level_0.

LoadVariable
what can I do if my field is in the scene 1 and this code in te scene 2 ?

loadVariablesNum (_root.input +".txt", 0);

can I make that:
loadVariablesNum (_scene2._root.input +".txt", 0);

Help!

Using The Loadvariable To Set A Var...
I'm starting to believe I suck at programming,
but I have been looking everywhere to try and do something simple, and cant seem to get it to work....

I have a file called section.txt, it contains the following:
section=1

I loadvariable ("section.txt",0);
& it pulls the "1" perfectly in the dynamic text, but thats not what I want.

so is there any way, I could do something to the effect of:
var sec=(The variable pulled from the textfile?);

that way I could manipulate the variable I loaded, with the sec variable...


Reason I am doing this:
in every folder I want to add a text file determining the section I am currently in when loading the same swf file. thus if the section=2 it will go to a different frame... etc..etc...but I dont know what else I can do to make this system work

and could someone tell me if I am going about this all wrong!

Thanks

Loadvariable
hello, i have a "MovieA" and in this movie a have a variables, i loadmovie (movieB) in target 2 and a would like load a variables(movieA) in a "movieB". it's possible to loadvariable not use a file.txt ?

Loadvariable And Rtf
Just wondered if the have changed the syntax for the load variable()command as my text files are not working. Im using a mac does rtf files work.

LoadVariable
I know that I have a ridiculous question. I can't load an information from an external file. I use Notepad to save an external file but it doesn't work. How can I solve this? Help me.

LoadVariable
Hi there,

I'm creating a Contact Us page using the load variable function, but how to I make it so that I can include the international dialing code for the phone number...

i.e. phone=+44(0)1344

because at the moment flash is turning the + into a space

Cheers

LoadVariable
Hi,
I'm loading an external .txt file, but I want it to do something after its loaded. Is there a way to create a preloader for a loadVariable? Thanks.

LoadVariable And PHP
I'm completely new to the php buisness, i read around the fourm yet i do not understand any.. i'm trying to create a game where people must login in order to play.

Anyways i want to know.. How can i make it so where one registered his/her account info (name/password) and it's saved into a php file "Login.php" and then if the user try to login it'll read the account info off "Login.php"

i know it has something to deal with loadvariable, but i'm not really sure how to use it yet. Can anyone explain it to me?

LoadVariable()
A rather simplest question for all you ActionScript Gurus out there, is it possible to load more than one variable from an external file. I have a text file with more than one variable and i m having trouble loading them in a movie clip which holds a few text fields.

Setup:
Text File:

VariableOne=TextOne
VariableTwo=TextTwo
VariableThree=TextThree

Flash File:
A movie clip with an instance name "someInstance", which holds three dynamic text fields with variable names textFieldOne, textFieldTwo and textFieldThree.

Now when i try to load the three variables in the three text fields what happen is text field one show TextOneVariableTwo=TextTwoVariableThree=TextThree
and textFieldTwo and textFieldThree appear empty

I want the result to look something like this:

TextFieldOne (should show) TextOne
TextFieldTwo (should show) TextTwo
TextFieldThree (should show) TextThree

Suggestions and comments are highly apprciated

Thanks

LoadVariable And PHP
I've spent the past hour searching the forums for some help, and all the results are merging into one!

My problem is, I have a variable in a PHP file, that I want to use in Flash. I have this line of code;


Code:
loadVariablesNum("test.php", _root);
... to get it, and if the file is changed to .txt, it works fine. When I try to use PHP however, the SWF thinks it's downloading the PHP file - and doesn't actually load the variables in it.

And, if I change loadVariablesNum to just loadVariables, nothing happens whatsoever!

Any help please?

Help With Loadvariable
Ok on one of my form I have this code:

on(release) {
form.loadVariables("email.php", "POST");
}

If I put a break point on it I can see that it stop there. The thing is it seems like it never get out to my email.php cause I don't get the email. Can anyone give me a hand on how to debug this??? How can I tell if my loadvariables work properly????

cheers.

LoadVariable
io folks

I got a litle problem fixing an elementary loadvariable routine.

var nmVars=new LoadVars();
nmVars.load("NFO/C01.txt");

nmVars.onLoad=function (ok) {

if (ok) {
i=1;
while (i++<=4) {

nm (eval("p00"+i)).split("¢");
preNM=nm.slice(1,2);
lstNM=nm.slice(3,4);

po=(eva("p00"+i)).split("¢");
io=nmVars.po;

}}}

___C01.txt
&p001=¢The Ticket magazine¢ ¢SWF/TIC.swf¢
...

Its goes fine when I put
io=nmVars.p001;
but how to replace p001 by a variable ?

Thanx for help

LoadVariable Help?
I have a main.swf that calls my admin.swf in a container clip.
for example..

on (release) {
setProperty (_root.container, _x, "0");
setProperty (_root.container, _y, "0");
_root.container.loadMovie ("admin.swf");
}

The admin.swf by itself allows me to edit some data entered by a user. using this:

loadVariables("GetDetails.asp", "_root", "POST");

now running admin.swf by itself it works, however when i call it from main.swf from the container, it wont populate the fields anymore. I think it has something to do with "_root" but I dont know how to change it so it will still work when called from the main.swf.

any help would be greatly appreciated.

Loadvariable Problem
i am using loadvariables in my movie. the code is

loadvariablesnum("abd.txt",0);

now i want to know how many variables have been loaded from the external text file.

how do i use it as array.

does anyone know

HTML As LoadVariable?
I'm having problems with variables.
I can load a txt file, can I load an html file?
I want my text to be able to link to other text files in the same movie.
For example: Click the 'theory' button and it loads text. Click the word 'links' in that text and it takes you to a link page.

Is this doable with HTML or is there some other code I have to use?

How Do I Loadvariable To Control A SWF?
hi all
Bit of a newbie in the actionscript department here...
I am playing around with accessing data from a txt file (located locally)
I have set up a tutorial to call text from a file and display it in a text field:

loadVariablesNum ("textfile.txt", 0);

However rathen than just display the referenced text I want to have it actually control the movie. I have fumbled this together:

if (text1="textinfo") {
gotoAndStop ("Scene2", 1);
}

so if the text file is "text1=textinfo" I want the flash movie to proceed to a specific scene. can anyone point out why this isn't directing the file?

ultimately i want to run multiple flash files all accessing and changing the one text file to have them synchronised separately.


thanks
clint

Loadvariable Vs Loadvariablenum
hey everybody,

this might sound really stupid, but what is difference between loadvariables and loadvariablesNum?
And how are they used differently?

Thanks very much.

Arrays - From Loadvariable
How can I load an array using LoadVariable? it seems no matter how I define the information in the datafile, I can not access it via [x] for example

datafile:
F[0]=3&F[1]=5&F[2]=2 etc.

I can not access this in a loop using the loop counter for a variable.

for (i=0;i<3;i++){
trace (F[i]);
}

Problems With Loadvariable()
Ok I have a FormMail section. It submits perfectly, however, when I click submit, it sends ALL variables on my site. How can I choose it to just send specific variables, i.e. NAME , EMAIL, COMMENTS

http://www.illicit-designs.net

thanks

Kevin

Loadvariable Maddness
ok check this out... i have this clip thats loading a txt file containing a variable's (links ) info.. everything works out fine, the only prob is that when it loads the txt file, it WILL NOT STOP LOADING IT. it just keeps on reloading the same file and literaly slows down the connection due to the friggen movie constantly loading this one text file over and over, i have no idea how to make it so it only loads it once, you youd like to see the problem look at this page im working on( the option at the top of the 3 points).. http://illscience.cjb.net in the portfolio section and try it out.. who thinks they have got the answer to this one?

GetURL Vs LoadVariable
I want to record high scores using a database on an NT system... it seems there are two ways to do this GetURL and LoadVariable.. which would be best ?

Unicode And LoadVariable
Hi

How to use unicode in loadvariable (ie to use unicode using a text file because in text file iam not able to use the spl character like &, >, < )

Any tutorial or help will be appreciated

Thanks

Simple Loadvariable
Alright, I have a ultra-simple flashmovie that should load a text-variable from a ultra-simple asp-page and show it in a textbox.

What is the syntax in asp?

Loadvariable Woes
I am having trouble loading variables from a text file for use in my action scripting. I've read every post and tried a lot of different stuff with the same affect. Here is the code I've been working on

button = new Array();
var frametoshow = 0;
myDate = new Date();
addon = myDate.getTime();
_root.loadVariables ("siteadmin.dat?" + addon, "");
frametoshow = button.length + 1;
stop ();

If I use dynamic text areas to display the values of the array and the frametoshow variable the frametoshow shows up first everytime and then very quickly thereafter the values of the array fill into the fields. Im suspicious that I need to verify the load prior to checking the array length, but I can't seem to figure this out.

Any help would be greatly appreciated.

Problem About Loadvariable
loadVariablesNum("copytest.txt", 0);

if I have an instance called "something";

and there is a textfield called "testtext" in the instance "something".

how should I set the level in loadVariablesNum
so that "testtext" can get the text.

Loadvariable Problem
Hello,

first of all i would like to thank you guys for your previous help
but i still have a question...
i have a movieclip called newsletter on my main stage
in that movieclip there's a button called submit and a input textfield with variable email
i've assigned the following code to the button

on (release) {
loadVariablesNum("mail.php", _level0.newsletter:email, "POST");
}

in my php i have the following code

"INSERT INTO Mailinglist (email) VALUES ($HTTP_POST_VARS['email']);

i've also set a mail command
mail("info@fallout.be", "Mailinglist", $HTTP_POST_VARS['email']);

well the problem is , i get the mail but theres no content in it...apparently the variable is not recognized by php or flash i don't know which one
could someone pls tell me what i should write in the level place in the loadvariablesnum command?

Kind regards
Bart

Loadvariable Help Im A Lamaah
ok this is the problem
my mate wants for his site a typewriter effect , displaying latest news about his stuff.. easy u say.. so thought i =)

so i made a little simple typewriter-effect (via some tutorial, coz i am n0ob!:P )

now frame 1 action displays:

text = "news::06/21/03 // blahblah";
max = length(text);
loop = 1;

frame 2 does:

loop = loop+1;
type = substring(text, 1, loop);

frame 3 does:

if (i>max) {
stop();
} else {
gotoAndPlay(2);
}

my textbox is labeled in var-box as: type
all above works.. but!

now all i want is to load the data of frame1 variable Text
from a .txt file on a www location (so all my buddy does is changing the news in the .txt file) i tried fiddling around with loadvariable function but it doesnt want to display anything at all.
this should be really easy i think for u guys
help me out! its driving me insane! ;p

LoadVariable Query
hi

any ideas why this works (loading a movie):

on (release) {
loadMovie("section1/project1/"+numberofPics+".jpg", _level0.photoholder);
}

but this doesn't work (loading a variable):

on (release) {
loadVariables("section1/project1/"+numberofPics+".txt", newinfo);"
}

?

"+numberofPics+" is a number updated every on(press).

i'm sure i've read not to name a file as a number (ie, 1.txt, 2.jpg) but the jpgs load fine whilst the txt doesn't.

any ideas why??

Cant See LoadVariable Text
I am using the following code to load a text file, into root, then load it into a dynamic text box thats inside of a mc, inside of another mc. When I view the test movie it works when I preview in browser it works. When I load the page after uploading it to server, thru ie, the text doesnt show. I am using _sans font (embeded), flash 2004mx, flash player 7, and for the life of me I cant seem to figure it out.


Code:
_root.loadVariables("about.txt");
_root.scroller1.wordWrap=true;

_root.about.about1.scroller.loadVariables("about.txt");
_root.about.about1.scroller.wordWrap=true;
_root.onData = function() {
this.about.about1.scroller1.text = this.aboutcontent;
};
Thanks in advance for any possible imput.

LocalConnect & LoadVariable
I have a swf file which loads a text file... simple enough. I want my main menu swf to tell the text swf file which file to load... so I decided to use LocalConnect and pass a variable telling the swf which file to load... but I its not working. Can I use loadvariable as function of Localconnect?

Code:
//localConnect Sending
_root["MenuHolder"+i]["button"].onRelease = function() {
sending_lc = new LocalConnection();
sending_lc.send("lc_name", "MethodToExecute", "text.txt");

//localConnect Receiving
recieving_lc = new LocalConnection ();
recieving_lc.MethodToExecute = function (param1){
loadVariables ("text/"+[param1], _root);
};
recieving_lc.connection("lc_name");

Loadvariable Trouble..(I Think)
It worked when I had it as a frame action... worked when it on a clip event.. I add it to a button..and it doesnt work.

1.) make text box called statusField

2.) make 4 movieClips (nothing moe than circles/dots) instance names
pointA
pointB
pointC
pointD

3.) make a button with this code on it:

Code:
on (press) {
myVars = new LoadVars();
myVars.onLoad = function (success) {
if (success) {
displayChart();
} else {
_root.statusField.htmlText = "Error loading text file";
}
}

myVars.load("pointLocations.txt?" + random(99999));

function displayChart(){
_root.pointA._x = _root.pointA_x;
_root.pointA._y = _root.pointA_y;
_root.pointB._x = _root.pointB_x;
_root.pointB._y = _root.pointB_y;
_root.pointC._x = _root.pointC_x;
_root.pointC._y = _root.pointC_y;
_root.pointD._x = _root.pointD_x;
_root.pointD._y = _root.pointD_y;
_root.createEmptyMovieClip("line", 0);
_root.line.lineStyle(3);
_root.line.moveTo(_root.pointA._x, _root.pointA._y);
_root.line.lineTo(_root.pointB._x, _root.pointB._y);
_root.line.lineTo(_root.pointC._x, _root.pointC._y);
_root.line.lineTo(_root.pointD._x, _root.pointD._y);
_root.statusField.html = true;
_root.statusField.htmlText = ("Data Loaded!!");
}
}


4.) make a text field called: "pointLocations.txt"
with this text/data inside:
&pointA_x=50&pointA_y=300&pointB_x=200&pointB_y=20 0&pointC_x=300&pointC_y=10&pointD_x=600&pointD_y=2 50



the text field returns the correct message..the "lines" get drawn from clip to clip...however..the "point locations" are not being parsed in correctly..

what am I missing??


update: crazy!! I just added this line to a frame 1 of my movie:

Code:
loadVariablesNum("pointLocations.txt",0);


not when I click the button...it works?... WTF?.. I need it to work withOUT having that code in frame..just the code posted above on the button.. so each button can call another text file and move another set of "data points".

thanks

LoadVariable Problem.
Hello.

I am creating a mail form with flash and php.

I can succesfully call the php mail form but my problem is that flash is deciding that I need to know that the text field is using

'<FONT FACE="BLAH" size="some number" '... and well you get the point..

Is there something that I'm doing which tells flash that I need to know all this?

I just want my header to look well.. like I typed it in(with out the html tags).

Any Ideas?

Loadvariable Array From Txt
is there a way in which i can load variable values from a txt file into flash varibles, and not into a movie clip?(the loadvariables command only loads them into a movie).

eventually, flash will be taking arrays from text files (ie "content[1]=****;content[2]=*****;" etc) in the text file. is this possible?

cheers

LoadVariable & Loadmovie
hi,

I was trying to do something, I created a movie and then attempted to load it onto another movie. To make it faster & easier for me, I went ahead and did a loadMovie("",""); then the movie that is loading I have some text on it which I'm loading externally as well. Im using the following for that: loadVariable("","").

Everything works good, however when I load the movie that has the external test loading onto the main movie. It doesnt load the text. Did I miss something ?

I would appreciate any help anybody can provide..

thanks

LoadVariable Path
I can get a fully qualified domain name to work in the "path" parameter of the loadVariable command, ie. "http://www.thisdomain/flashData.aspx"

I want to make it work locally with a relative path... that is,  with "../flashData.aspx"

WHY won't it work?? I don't get errors, it just returns no data...  It works perfectly when I have it on the live server...

Thanks
Kevin Howell
Briefcase of Talent
Austin, Tx.

LoadVariable Problem
I'm trying to load variables from a text file but it's not working.

This is what I have now:

ActionScript Code:
loadVariables ("countdown.txt","");
var launchTime = new Date(raceStart);


My text file looks like this:
raceStart=2007,5,17,8,0,0,0

This is what I want it to look like at runtime:

ActionScript Code:
var launchTime = new Date(2006,5,17,8,0,0,0);



If I trace raceStart I get "undefined".

If I create a dynamic text field with var raceStart I get "2006,5,17,8,0,0,0".

What am I doing wrong?

Thanks for any help!!

Loadvariable In Redhat 6.1 Flash 5 NO GO (or Is It Just Me)
Boys and Girls.

I am trying to get something running. from a php based apache server.
This something is just getting 1 variable from the web server into flash 5.
code php where variable is stored and ready to get by *.swf

<? #header ("Content-Type: application/x-www-urlformencoded");
$sjon="kutkind" ?>
sjon=<? echo $sjon ?>&eof="true"

html with the swf

<meta content="application/x-www-urlformencoded">
<? #header ("Content-Type: application/x-www-urlformencoded");
?>
<a href="datatest.php ">again behatch </a>
<object
classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#3,0,0,0"
width="300" height="200">
<param name="SRC" value="/datatest.swf">
<embed src="xsbar1.swf"
pluginspage="http://www.macromedia.com/shockwave/download/"
type="application/x-shockwave-flash" width="300" height="200">
</embed>
</object>

swf script

Scene 1
actions for frame 1
//
// Laad de variabelen
//
loadVariables ("getdata.txt", this);
gotoAndPlay ("loading_loop");
actions for frame 9
//
// Checkt of de laaste variabele "eof" (EndOfFile) binnen is
//
if (eof == "true" || eof == true) {
gotoAndStop ("loaded");
}
actions for frame 10
gotoAndPlay ("loading_loop");
20, (TextField7), (Times New Roman, 63 pts)
yo, (sjon), (Times New Roman, 63 pts)
ja, (TextField8), (Times New Roman, 63 pts)

So In the text field called sjon has to be displayed the variable sjon
Tried txt as well. The cool part is that having the txt with the variables (which is the same copy as on the server)
on the client. Everything runs well.
As soon openen from web server which The data is not being transported to the swf file.

Also SWF, txt and php all reside in the same folder/directory


Can this be a domain problem????
Or a bug.
Or is my code just wrong

thanks Widios

Loadvariable Text Formating?
I'm loading text in to an MC text field but having trouble with amperstands (&) in the file. Does anyone know how amperstands should be formated in the text file so they display as an '&' in the MC?

LoadVariable Text Problem
Ok, I've got a flash movie set up to load a text file. It's dynamic text, multiline, uses word wrap, and uses HTML.

It automatically double-spaces, which is a real problem with what I'm trying to do. I've tried just putting the text, then I tried using the < pre > tag.

I found one solution to it, but it is putting everything in one huge line, without ever returning down, so it's one big complicated line of tags and text. This entirely defies my point of using the text files for simplification.

Help would really be appreciated...

Loadvariable & Path Problem
I need some help for this:
my main movie loads a second movie within a movieclip textbox loads a variable text file, here is the code:
onClipEvent (enterFrame) {
loadVariables("parten.txt", "_root.mc_ref");
}
this code work if I put it in the main movie but not when I use it in the "child" movie loaded by the main movie. I tried also to put _root. just before loadvariables, no beter result!
Can someone figure it out? many thank's.

Loadvariable, Numeric Value Not Literal
hello, there seems to ba a lot of loadvariable problems but none answer my problem. i am loading some varialbes from a text file which all works properly but the value of the variables seem to be literal and not numeric ie:

featurestart=3
(this is loaded to a movie from the text file.

featurestart = featurestart+1
(this is in the flash movie)

and the answer i get is
featurestart = 31

it does'nt think of it as the value 3

can any one help, is there a command that turns the value into a numeric one . thanks.

howard.

Loadvariable, Numeric Value Not Literal
hello, there seems to ba a lot of loadvariable problems but none answer my problem. i am loading some varialbes from a text file which all works properly but the value of the variables seem to be literal and not numeric ie:

featurestart=3
(this is loaded to a movie from the text file.

featurestart = featurestart+1
(this is in the flash movie)

and the answer i get is
featurestart = 31

it does'nt think of it as the value 3

can any one help, is there a command that turns the value into a numeric one . thanks.

howard.

How I Can Make Preloading, While LoadVariable?
I can't corect read loaded variables, then maybe i can make preloading while LoadVariable from file.

How i can make it?

Netscape Foulup When Loadvariable From .txt
I finally got loading the variables to load, and been able to manipulate the values of that variable... But it only seems to work in IE. Netscape doesnt seem to recognize the if functions and goes directly to the last exception,
please help.


FRAME #1:
loadVariablesNum ("i.txt", 0);

FRAME #4:
stop ();
if (i == "home") {
gotoAndStop (5);
} else if (i == "fun") {
gotoAndStop (10);
} else if (i == "archive") {
gotoAndStop (15);
} else if (i == "alumni") {
gotoAndStop (20);
} else if (i == "about") {
gotoAndStop (25);
} else if (i == "forms") {
gotoAndStop (30);
} else if (i == "contact") {
gotoAndStop (35);
}


"IF I Add an ELSE statement by itself at the end the browser crashes"

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