LoadVariables Help?
Hi,I am using 'LoadVariable' to load a small block of text into a dynamic text box.All works fine apart from when the imported text as an ampersand symbol. for example if I have the phrase Bed & Breakfast. I assume it it thinking its a break for a new variable name.Is there a way to import this text WITH the ampersand?Cheers,Tim
Adobe > ActionScript 1 and 2
Posted on: 06/13/2007 02:50:55 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
LoadVariables: Can Two LoadVariables In The Same Script Cause A Problem?
Hi,
It seems that for some reason, my attempt to send vaiables is not working. I'm not certain if its my syntax or the fact that I have a second loadVariables later in my script(with a different name of course). help?
heres a sample of the script that I'm using:
ClickedSendVar = new loadVariables();
ClickedSend = "bob="+bob+"&fred="+fred+"&jim"+jim;
ClickedSend.send(_root.on_card, ClickedSend, "POST");
LoadVariables From CGI
Why does it work from my HD, and not on the Web.
When I run the SWF in flash it load the vars ok. Then I tested outside Flash, in the Flash PLayer, and in the Browser both from the HD. The file was on my HD but the script still gets the vars from a valid URL.
I load the vars like this:
loadVariablesNum ("http://www.mydomain.com/cgi-bin/flashclock.pl", 1);
In the dubugger window, all the vars are loaded correctly only when the file run from the HD.
Then I run the (SWF) file from the web, and the debugger window only show me the _level0 objects and vars. NOTHING from _level1 (to witch i'm loading them).
I tested the PL right in the browser to, and it outputs everything correct, like:
&name=paul&weight=85&...
Is loadVariablesNum a wrong method to get the vars from a pl file.
H E L P !!!!
LoadVariables + Php
I have this tiny PHP script that I would like to call in order to generate a string to be used as a variable:
Code:
<?php
// filename is 'metar.php' located on server 'your_url_here'
echo "metar=";
$fp = fopen ("http://weather.noaa.gov/pub/data/obs...tions/CYUL.TXT", "r");
// The above URL retrieves the latest weather data for Montreal's Intl. Airport.
// Hack the source at http://www.gimpster.com/php/phpweather/index.php PHP Weather for how to interpret the value.
while (!feof ($fp)){
$metar = fgets($fp, 4096);
echo $metar;
}
fclose ($fp);
?>
In my flash movie, I call that script on fr.1 using
Code:
loadVariables("http://your_url_here/metar.php", "");
and I have a dynamic text field which is linked to the variable metar.
Of course it doesn't work so far. Any pointer why and/or how to make it work?
thanks and cheers
D.
LoadVariables Bug?
Im getting feed back from my users that when they try to login it hangs.
all im doing is a simple task they type userid and pass click next
loadvariables from a CGI script which checks the userid and pass sends back a responce of either wrong or ok
while flash is waiting for this responce i do this.
if (responce eq "ok"){
gotoandplay("ok")
}
elseif(responce eq "wrong"){
gotoandplay("wrong")
}
else{
prevframe
}
#################
the previous frame is just a play() to check the status again.
so why is it hanging? is there any know problems with this method like using it in different browsers or platforms??
or if anyone has a better method i will be happy to listen.
Danny
LoadVariables
Hello,
I have 10 frames in my movie and each frame has 2 loadvariableNum command to load text into 2 different dynamic text boxes in my main movie. 1 loadvariableNum command looks for data from the database and the other from a text file. When I try it out, only 1 LoadVarNum command works, meaning that text var 1 will populate with text but not text var 2. I have both variables loading into level_0. What is the processing order for LoadVarNum command? Is there a certain order that they load in?
Loadvariables Help
I have a simple menu on a page called menu.html with four selections (red, yellow, green and orange). This opens a pop up window (menupop.asp) with the following code:
<%color = request.form("color")%>
<script>
var color = "<%=color%>"
</script>
This page has a flash movie with the code:
stop ();
loadVariables ("menupop.asp", "0", "POST");
gotoAndStop (color);
There are four frames with labels red, yellow, green and orange, but is not going to the right frame.
Any solutions?
I'll try to upload the pages later (my server's being a pain).
-Brandon
[Edited by bugkarma on 10-16-2001 at 02:00 PM]
Help With Loadvariables
I have a simple menu on a page called menu.html with four selections (red, yellow, green and orange). This opens a pop up window (menupop.asp) with the following code:
<%color = request.form("color")%>
<script>
var color = "<%=color%>"
</script>
This page has a flash movie with the code:
stop ();
loadVariables ("menupop.asp", "0", "POST");
gotoAndStop (color);
There are four frames with labels red, yellow, green and orange, but is not going to the right frame.
Any solutions?
You can see the pages at http://www.neweconomydesign.com/test/menu.html
-Brandon
HELP With LoadVariables
I ma trying to load variable values from a text file. Nothing seems to work to make this happen. I have a file in the same folder as the .fla file. It is called "data.txt" and it contains the following-s1Var=4
In the first frame of the movie I have the following code
loadVariables("data.txt",0)
trace(s1Var);
this always returns 0. How do I make this work???
LoadVariables
Please someone help!
Does anyone know where i can get some information or an example of how to use the loadvariables command.
I am very confused on how to use it.
I have a templete that i need to have variables from a data file to load into.
On the first frame of my swf. i have
loadVariables(url.questions)
the url is typed out correctly, this is the data page with various variables with values.
the questions is the name of the text variable in the flash movie where i want the value of the variable from the data file to be placed.
I have many questions, how does the loadvariables know exactly what variable i need and where to place it.
i hope this makes sense. please, if anyone knows what i am trying to describe or knows of a tutorial i can use, please tell me. the stress and pressure from my bosses is horrible.
if you have not figured it out, i am just learning actionscripting.
thanks,
dawn
LoadVariables
How does the loadVariables command work?
I want to create a button that, on release, reads variables from a text file. Then the variables must be put in textboxes.
I have a .swf file and the text file in a folder on my hd.
What has to be in the text file and how does the loadVariables command work?
Say I want to read test="hello" and then have in a text box in the movie "hello" in a text box
Loadvariables
Hello, I am creating windows in flash and I am trying to import data from a text file using loadvariables. i.e.
("aboutUs.txt", "_root.aboutUsWindow.window.text_box");
the text file looks like this:
textField=<blah blah blah>
(textfield is within text_box).
This works fine except that now, I want to load multiple variables into different text fields from the same file.
Please help.
prac2
LoadVariables
Hi,
I have an flash movie and I have a movie clip in that. I change the color of the clip according to the database value which I get using ASP. In the frame actions actionscript, I change the color of movieclip according to the return value from ASP, still the color does not change. I checked the variable value and it is not set too. I gave red color before calling LoadVariables (which passes green), the color is not changed. What can be the reason. I have written the code in any event, just in the frame actions main script place.
Any help is appreciated.
Thanks
-r-
LoadVariables
Hi, I need help with loadVariables. I have a movie clip named "blah" containing a dynamic textbox with the variable set to "text," and I have the line:
loadVariables("blah.txt",_root.blah.text);
loaded into my actions layer. Yes, blah.txt is in the same directory as the flash. I want to load blah.txt into the textbox. What am I doing wrong here? Thanks
LoadVariables()
Hi there,
Would like to ask regarding the movieClip.loadVariables() action. The second parameter is supposed to be "GET" or "POST" right? Is this "GET" or "POST" action the passing of variables into flash, or is flash passing variables into another application?
For that matter, I am aware that by specifying the additional parameters with the URL string, you can simulate a GET request to a server. I'd like to ask then, how can I use Flash to do a POST action?
Thanks.
Regards,
KA
LoadVariables (again)
I want to load a list of (text) variables from a .txt file into a mc, using a split (into an array). There should also be a (invisible) button attached to each variable, in order to enter a url link and the number of variables is not fixed. I tried everything, I have the overall idea, but it still won't work... Can someone explain me step by step what to do ?
Loadvariables
I want my buttoninstances to have a variable name.
I made an MC,
on frame 1 : loadVariables("/fotos/fotos.txt",_root);
on fame 15: event1.eventname.Text= _root.event1;
event2.eventname.Text= _root.event2;
...
in the txt file :&event1=button1
&event2=button2
...
but I don't see the button names when I upload the site, or even when I preview the html file.
this I probably a dumb question, but how comes?
LoadVariables
Hi,
I have a problem with loadVariables.
In the first frame, I try to execute the script counter.php
In the second and third frames I check, if I receive the variable “hits”
The variable “out” is a text box and “loop” is only a counter. “hits” is the variable I want to receive
See my short code description:
Frame1:
loadVariables("http://mitglied.lycos.de/fcneptun/c/counter.php"+"?ran="+random(9), "", "GET");
Frame2:
out = ++loop + ") Waiting .... hits: " + hits;
Frame3:
GotoAndPlay( 2 )
OK, If I try the MC local on my test computer, it works perfect . But if I put the MC on my web space, it don’t works !!!!! My web space is on a different provider “members.aon.at”. My be is this the problem????
Please help!
Thanks
David
LoadVariables() & Php
zipper'll,
will the function loadVariables() send variables to php, have them altered and then recieve them again?
or is something like a getVariebles() needed (if it exists) to get them again
thankthanks
thrill,
lloydmannes
Loadvariables & Asp
when i send a particular variable to an asp page using loadvariables it arrives at the asp page appended with a html formatting tag. do you know why? thanks Shane.
LoadVariables - I Just Don't Get It - Please Help
Okay, I just don't get LoadVariables. Can someone break down exactly what happens with this command?
I have an asp page that returns a simple string in the format indicated in the documentation:
var1=1&var2=2&var3=3
So I call that asp page with loadVariables: loadVariables ("http://www.whatever.com/my.asp/",0)
What happens with that call? I always assumed that this would be equivilant to writing
var1=1;
var2=2;
var3=3;
directly into the code, but it just doesn't seem to work that way.
I'm seriously stumped on this one.
Loadvariables Via ASP
I am trying to grab a variable that is in an ASP file using loadvariables. Do I have to use loadvaribleNum and a get or a post to do this?
Loadvariables
hi....
I have a dynamic txt field in which i want txt to get loaded from a notepad file... Now this text needs to be replaced by a new txt after every few seconds...
Actually the text is nothing but comments of an exhibition that was held in 2001. So i 've to load text from this notepad where all the different comments of different companies and people are stored one at a time and this has to be refreshed after every few seconds in the same dynamic text field.
please attend to this query ASAP coz i'm really despearte to incorporate the same in my working flash file...
Thanx in anticipation of an early response...
Alternate email : muksy2175@rediffmail.com, muksy2175@hotmail.com
LoadVariables Help
I am trying to bring in text from a text file, but I can't seem to get it working. This is what I did:
I created a text file that looks like this:
myText=text text text text
I created a movie clip in my main movie. It contains a dynamic text box called myText.
In the first frame of the main movie I put the following code:
loadVariables("mywebsite.com/myText.txt", "_root.box");
Any ideas? I would really appreciate any help.
-gamist
LoadVariables From Asp
Hi there, I'm using 'loadVariables("xxx.asp", _root); to get text into a dynamic text field. It works fine when I navigate to the .swf directly but not when embedded in the page.
I'm using Mac OS10.1.5 + ie 5.1.
Is this a problem specific to my platform or something else ?
Urls:
Page : http://www.freerideculture.com/eelad/index.html
.SWF : http://www.freerideculture.com/eelad/flash/menu.swf
The culprit is the news headline which should appear in red at the top...
This is just a test version before linking it with a database...
Loadvariables
HElp!! I'm adding a scrollable text loaded externally I always did in Flash5 but now it doesn't work anymore, tried and checked 100 times but no can do. I don't get this. I checked the form already and even convert the textbox and the scrollpane together in a movie and send the variable in to it:
loadVariables(news.txt, _root.mc);
but still nothing!!
I put in my 1st timeline cell the command but it doesn't seems to work anymore, the filetext is there and the variable checked..any help?
thanks
LoadVariables
Hi. I have some problem about loadVariables. Could you please help me? I want to loadVariables to _root from a text file called "data.txt". And "data.txt" contain the following text:
&ok=true
Then, in the first frame of the fla movie I write something like:
ok="false";
_root.loadVariables("data.txt");
trace(ok);
However when I test the movie, it output "false". It should output "true"! Could you please tell me if I have made something wrong? And how to solve this problem?
(I am using Flash MX)
LoadVariables
Hey everybody! I hope I'm not asking the same qerstion a million other people have asked before. (btw, is there some kind of "search board" funtion on this site?)
My problem is as follows:
I am reading (via php) from a database the titles of data sets in a given table. Those titles are given back to flash no problem.
Now i want the titles to be clickable (i.e. to be links), and after the user clicked the title the full entry will appear.
My thought originally was to define a function that will load the appropriate text (via <a href="asfunction:show_details,id"> ) .
Afte many hours I almost got it to work, but now I'm really stuck...
Frame 1 has the following actions:
function show_detail(number)
{
var transfer=0;
loadVariables("details.php?id="+number, "_root.text_field");
while (_root.text_field.ende<>1){}
transfer=_root.text_field.textfield;
_root.text_field.textfield=transfer;
stop();
}
loadVariables("overview.php", "_root.text_field");
where text_field is a MC containing a textfiel namen "textfield".
It shows the overview fine, which basically consists of the titles between <a href="asfunction:show_details, some_number_generaed_by_php"> Tags.
Clicking on the Links doesn't do ****, doubleclicking works fine though.
My questions:
- if I leave away this wild "transfer"-thing, nothing will work at all. why?
- Why do I have to doubleclick?
I just don't know anymore.... pleeeeeease help! Thank you in advance, I'll try not to write that much anymore....
Help Please, LoadVariables
hey, i need to load a textfile into a dynamic textbox for my site, my code doesn't work here it is
loadVariables("C:\limesite/textfiles/news.txt", news);
it is in the actions of a frame, and the dynamic text field has its instance and var name correct.
i get this in the text box:
_level0.menu1.news
please help,
Thank You in Advance,
Mr Eckted
[EDIT]
i also tried all the combinations of this:
loadVariablesNum("C:\limesite/textfiles/news.txt", ""\"_level0.menu1.news\""");
but again, no go.
also, in some configurations, it opens the text file in a new browser window
[/EDIT]
[Edited by mreckted on 08-30-2002 at 12:27 AM]
LoadVariables
Simply trying to use a variable loaded from an external txt file in a conditional statement, and it doesnt seem to be able to use the value as a comparison.
ie.
load the variable from txt file via loadVariables("txtfile.txt","");
trace("variableLoaded") <- can read the variable value
then I want to use it in an if statement like this;
if(variableLoaded == 1){
do this;
}else{
dont;
}
Even though the trace will show me the value of variableLoaded == 1, I cant seem to use that value in this statement.
HELP!
LoadVariables
Alright... I'm loading variables from a txt file, data.txt. it simply consists of:
numBars=7
Now, I can load it into a text input box when i use loadVariablesNum (not with just loadVariables, but that aint the problem), but i cant use the number afterwards in my loop like this:
for(i=0;i<numBars;i++) {
}
the loop dont even start. please help!
love,
chuckmo
LoadVariables In IE
Hi I have some problem with LoadVariables.
Please look at www.wykladzina.net then place your mouse on flash window in left site. Yellow window shows up and you should see details about product. It is not working.
But if you click on it new page load and then everything is working fine.
My code in button is
on (rollOver) {
_root.up.field._visible = 1;
loadVariables ("http://217.153.56.210/pl/get.php?kod=tali_classic", "_root.up.field");
tellTarget ("_root.up.field") {
gotoAndPlay (2);
}
}
on (rollOut) {
_root.up.field._visible = 0;
}
on (release) {
getURL (_root.cfgroot+"/?op=oferta&kod=tali_classic");
}
Instead of 217.153 ... should be _root.cfgroot (generally no diffrences)
Important yhing is: when I open swf from disk it works great! No problems.
Can you help me?
LoadVariables
Am having a problem loading Variables from a text file.
have a test file list1.txt containing:
text =
&rm101=test
&rm103=this
code to fill dynamic text box says,
loadVariables("list1.txt","&rm101", "_root.rooms.101.101txt");
this does not seem to work, am i doing the text file, the code or both wrong?
Thanks in advance!
Loadvariables And Php
I am somewhat new to actionscripting so I'll try to explain as plainly as possible.
I have a login system (works fine) and I have a part in my movie that displays the "Newest Member." I am trying to do this by using php to pull it from the db and have it displayed in a dynamic text box (users name, user #, and date joined -- 3 different boxes). So, here's what I am trying to use:
In the first frame:
Code:
_root.mem.loadVariables("test1.php");
_root.total.loadVariables("test.php");
_root.joined.loadVariables("test3.php");
stop();
Here's the php:
Code:
<?php
$host = "*****";
$user = "*****";
$pass = "*****";
$database = "*****";
$table = "*****";
// Connecting to the Database
$connect = @mysql_connect($host, $user, $pass) or die("could not connect to server");
// Selecting the Database for use
$db_select = @mysql_select_db($database) or die("could not select the database");
// Compose SQL command
$SQL = "SELECT * FROM $table";
// Query the Database
$result = @mysql_query($SQL) or die("could not complete your query");
// Note, results are returned as an
// Array - we cannot just print it out.
if($row = @mysql_fetch_array($result)) {
$id = $row["user_id"];
$name = $row["username"];
$date = $row["date"];
print "_root.mem=".$name;
}
?>
'mem' is the dynamic text box and test1.php is obviously the php file I am using. I have had this working once before but I lost the files. Can some one please point out what I am doing wrong?
Peace,
James
An Example Of LoadVariables And Php/asp?
i saw a while before an example of calling a php/asp file,
and reciving back an info from this pages!
does any 1 has example for it?
what i want to do is to recive answer for something that i send to the server!
thanks in advance
Peleg
Loadvariables ?
I have this script on a button :
on (release) {
loadVariables("cafe.txt", "text");
}
Then I have an mc, with a dynamic textfield, instancename "text"
Then I have a txt doc. called "cafe.txt", placed in the same folder as the swf.
Why does the text not load into the textfield, when I press the button ???
Thanks
Per Haar.
Loadvariables Where Are They?
Hello all.
Having trouble accessing variables loaded. In List variables at the testing stage I see all my variables at level0 like this..
_level0.variable1 = "whatever"
but this syntax will not access them in the movie e.g. when I have my gate script allowing the movie timeline to move when the variables are what is loaded.
Please help this is really ruining my weekend!
James
Loadvariables
I have a standalone that I am working on, it conects to my servers cgi bin. In part of this program I have a area were 20 people can put type in a name for a button and there information into two input txt boxes, one is called button1txt and the other input is called information. Now everything works great you put your information in and hit the submit button for that area and it stores it on my server. the problem I am having is that when someone else used the program I want the it to just bring in the name that was given to the button not the informaion, that is until you click on the button. I set up a loadvariable on a key frame but of course it brings all the variables in not just the button variable. Is there a way to get around this so I only get the button variable at the begining of the program?
This is being built in MX
Looking For Help With LoadVariables (MX)
Wowwww...this board sees some heavy traffic. I'll try giving some more detail and hopefully that'll help (assuming there's a simple answer *cross fingers*)
I'm making a trivia game to add some more fun to the learning experience for classes I teach. I've laid out a bunch of topic and question-storing variables in a manner such as the following:
Quote:
category0 = "Things you bake";
category0qa = [["As many people have been known to sing, someone left this out in the rain.",
"A hungry giant once wanted to grind the bones of a fellow named Jack, in order to make what?"],
["Cake",
"Bread"]];
The problem is, I'd like this to become a tool usable and customizable by others in my department. So ideally, I'd like all the question/answer data to be stored in an external text file. I can't use #include, because editing the text file still requires a recompilation of the SWF to see the changes take effect.
The LoadVariables function, on the other hand, looks rather daunting as I know nothing about putting something into "application/x-www-form-urlencoded" format.
I read something when scanning this board about it being possible to import variables without this format, but I haven't found details on that method yet.
Can anyone help me please?
Thanks!
-Jeff
Loadvariables
I have a dynamic textfield, in wich I load a .txt doc.
loadVariables("Mytext.txt", "textfield");
....and it works fine.
My Q is now....
Is it possible to write a worddoc. with 2 different fonts, and sizes,
save it as html, and load that in to my dynamic textfield ???
Thanks
Per Haar.
LoadVariables Help
Should I use the loadVariables function to add a score to a highscore board? I made a basic scoreboard using PHP and if the action == "add" it will add the score in the right position and bump everything else down. I tried adding the following dode to a button but all it did was freeze up...
Code:
on (release) {
action = "add";
loadVariables("myurl.php", "/", "GET");
gotoAndPlay("hsview")://this is where they can view the scoreboard and the farme s in the same scene as the button.
}
p.s. the button is a movie clip. Maybe I should try onClipEvent(mouseUp)?
LoadVariables() Not Getting There
PHP Code:
_root.LOGFILENAME = 'portfolioflash.log';
_global.sendLogData = function(logdata){
var mc = _root.createEmptyMovieClip('tempdataclip', 99999);
mc.nocache = Math.floor(Math.random() * 10000000);
mc.filename = _root.LOGFILENAME;
mc.logdata = logdata;
var scriptURL = "http://www.mydomain.com:8008/appendLog.php";
mc.loadVariables(scriptURL, _root.tempdataclip, "POST");
_root.tempdataclip.removeMovieClip();
}
This seems so simple, but for some reason the variables are not getting from the clip to the script! Does anyone see what I'm doing wrong?
Loadvariables ?ion
i have a text file im loading that has links in it with query strings as part of the links. the problem is flash reads these as separate variables instead of as whole links. is there anyway to get around this?
LoadVariables Help Please
ok in frame 1 on the root of my flash file I have the following code...
var arrText = new Array();
txtFile = "txtFile.txt";
for (i=1; i<=_level0.TotalNames; i++) {
loadVariables (txtFile, _level0.arrText[i]);
set ("_level0.Text"+i+".content", _level0.arrText[i]);
}
In the same frame I have a number of dynamic text movie clips that have the name Text# with the text variable called content.
in my text file I have...
arrText[1]=hello;
arrText[2]=there;
arrText[3]=every;
arrText[4]=body;
but none of these values gets through.
any one have any thoughts?
Where am i going wrong?
cheers in advance.
Loadvariables
I'm loading text as a variable using loadVariables(), but for some reason I can't get the "&" symbol to show up, either with & amp ; or & # 38; (I added the spaces so it reads in the forum) My text file says:
tune=Saturday Nights at 9pm/8CT on A& amp; E
And I get "Saturday Nights at 9pm/8CT on A"
What am I doing wrong???
LoadVariables
How can I load variables from a file and be able to manipulate them right away without user intervencion(like mouse events and so on...)?
All I get is "undefined"!!
I'm using flashMX...
LoadVariables Help :)
Hi,
Another basic question: when people use the loadVariables command to load external text and stuff, do they need to put a preloader for it? I mean, usually you use loadVariables to load .txt files, most of which are around 5-10 KB... still, do you need a preloader for them?
Thanks
LoadVariables(this.url); ?
I am looking for a way for lash to return the current url address of the html page you are on. Is there a function that could do this? Thanks in advance.
get_url(this); ?
loadVariables(this.url); ?
Something like this? Thanks in advance.
LoadVariables()? How Do I Do It?
My flash file has a movie clip - instance name 'loginApp'.
Inside this mc there is a button which when pressed - sends out a variable to a php script using:
loadVariables("myscript.php?username=bob", _level0.loginApp);
this php script then generates this:
username=bob&status=success&done=yes
there is a dynamic txt field with the variable name 'done' in the same mc and once the loadvariablee has done SHOULD make this txt field display "yes" BUT it DOESN'T!? I know the php file works as I have tested it. I really need help here. likely to pull my hair out!
LoadVariables Please
Well you see... I have this dynamic text block - var name - block, instance name block. And I have a something.txt file whit the requiered[sp?] html code in it. And I want the text in the *.txt to appear in the dynamic text block. In the actions panel i write:
loadVariables("something.txt", ?);
Where I put the "?" i don't know what to put. Please help me.
|