Loadvars Problem?
Check out my code. What is my problem here? When i run it in my pc, it works well but when i publish it, it keeps telling "error loading data".. I've tried www.yahoo.com and etc.. it didn't work on publish!!!
ActionScript Code: cekTheUsr = new LoadVars();cekTheUsr.load("http://www.google.com.my");cekTheUsr.onLoad = function(success) { if (success) { trace(success); } else { trace("error loading data"); }};
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 07-12-2006, 11:07 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Preloading Loadvars + Code That Uses The Loadvars
Hey everyone
I can't find out how to do this.
I have a main file with a menu. When a menu button is pressed, and external SWF with the corresponding page is loaded into a container in the main movie. I use the MovieCliploader for this
In all my external files, I have a loadVars that gets XML-output from a PHP-file. In the onLoad handler, I have a buildPage() function that takes the variables and e.g. builds a news page and so on.
My question is how I make a preloader that preloads the loadVars + all the code inside my buildPage function? I mean - on big preloader for it all?
I guess it cannot be done with my moviecliploader inside my main movie?
thanx - Rune
Help LoadVars.send Vs. LoadVars.sendAndLoad
OK, my understanding is that if example 1 works so too should example 2:
Example 1:var my_lv:LoadVars = new LoadVars();
my_lv.overall_score = _root.overall_score;
my_lv.send("score.php", _blank, "GET");
Example 2:var my_lv:LoadVars = new LoadVars();
my_lv.overall_score = _root.overall_score;
my_lv.sendAndLoad("score.php", result_lv, "GET");
My understanding is however clearly wrong as example 1 will pass the variable quite happily to my php script which will update appropriately. In example 2, nothing. Nada. Variables aren't availabe to php and (therefore unsurprisingly) my_lv.onload isn't picking up any return.
Where am I going wrong this time?!
Cheers,
Andrew
[AS1][loadVars] Scope Trouble With LoadVars
Hi everybody,
I'm new on this server !
Is there a way to attach a file to my thread ?
You would find enclosed a ".zip" file in wich there's a ".fla" file, a ".txt" file and 6 ".jpg" images.
Frame 1 of the FLA only has a "Preload" class/constructor found on another site and works well.
Frame 2 launches the graphic interface construction.
The file "externalVar.txt" has one variable "maxVin" with a value of 6.
I would like to know WHY i can't acces this variable from outside of the loadVars object's scope (i would better say from outside of its ".onLoad" methode scope).
In fact, when i trace my variable "maxVinNum" from outside of this function, flash player return "undefined". Even if i declare "maxVinNum" on the _root (_root.maxVinNum).
For information, at the start of frame 2, i have let an instruction in comment :
//var maxVinNum = 6;
When we activate this instruction, then the variable is directely declared and everything works well. This test allow us to verify that scripts are not bugged.
Here is the script of frame 2, some of you may understand quickly what's wrong :
//var maxVinNum = 6;
var vignetteVars = new LoadVars();
vignetteVars.onLoad = function(ok) {
if (ok) {
trace(this.loaded);
maxVinNum = this.maxVin;
trace("maxVinNum = " + maxVinNum);
}
};
vignetteVars.load("externalVar.txt");
//
function buildArray (arrayLength) {
FileArray = new Array();
for (var i=0; i<maxVinNum; i++){
FileArray.push ("v_"+(i+1)+".jpg");
}
trace("FileArray : " + FileArray);
};
//
function buildSlide(){
vinKern = 1;
preloadSlide = new Preloader(load_indicator);
for (var i=0;i<FileArray.length;i++){
//Construction du slide
slide.vignette.duplicateMovieClip("vignette"+i,i);
slide["vignette"+i]._x += i*(slide.vignette._width + vinKern);
// ajoute à la file du preloader
preloadSlide.insert(FileArray[i], this.slide["vignette"+i].conteneur, i,"","","okload");
}
slide.vignette._visible=0;
};
buildArray(maxVinNum);
buildSlide()
stop();
I hope my english is not too bad, and my explaination not too long and understable.
thanks a lot for your help !
LoadVars.send VS LoadVars.sendAndLoad
Last edited by gkcohen : 2004-04-23 at 09:19.
can someone tell me what the difference is with these two. here is my problem. i am trying to submit some info to php script. i have my variables in text file.
if if loadVars.load("textFile.txt");
and then say loadVars.send(url, "_blank", "post") then it will work. but i dont want to load the resulting php page outside of flash. if instead i do loadVards.sendAndLoad(url, dataReceiver, "post") then it will not work. my dataReceiver will return blank, or i will get an error that the variables were not sent.
i guess that you cant loadVar from a text file and then use it with sendAndLoad, is that right?
the reason for using the text file is the real problem. the php script requires a variable 'group_ids[]' with an integer for a value. apparently, flash cant read the variable with the '[]' in it. i have tried different ways to get it formatted, but it wont work. i tried do something like loadVars.group_ids + "[]" = 1 but i get message stating the the object to the left of the operand must be a variable.
my only fix was to use a text file to load this variable. it works, but only when using the send and having a php srcipt popup.
i am not too familiar with php to modify the scipt, and i think that variable needs to be an array.
i dont know what else to do. HELP
gkc
[AS1][loadVars] Scope Trouble With LoadVars
Hi everybody,
I'm new on this server !
Is there a way to attach a file to my thread ?
You would find enclosed a ".zip" file in wich there's a ".fla" file, a ".txt" file and 6 ".jpg" images.
Frame 1 of the FLA only has a "Preload" class/constructor found on another site and works well.
Frame 2 launches the graphic interface construction.
The file "externalVar.txt" has one variable "maxVin" with a value of 6.
I would like to know WHY i can't acces this variable from outside of the loadVars object's scope (i would better say from outside of its ".onLoad" methode scope).
In fact, when i trace my variable "maxVinNum" from outside of this function, flash player return "undefined". Even if i declare "maxVinNum" on the _root (_root.maxVinNum).
For information, at the start of frame 2, i have let an instruction in comment :
//var maxVinNum = 6;
When we activate this instruction, then the variable is directely declared and everything works well. This test allow us to verify that scripts are not bugged.
Here is the script of frame 2, some of you may understand quickly what's wrong :
//var maxVinNum = 6;
var vignetteVars = new LoadVars();
vignetteVars.onLoad = function(ok) {
if (ok) {
trace(this.loaded);
maxVinNum = this.maxVin;
trace("maxVinNum = " + maxVinNum);
}
};
vignetteVars.load("externalVar.txt");
//
function buildArray (arrayLength) {
FileArray = new Array();
for (var i=0; i<maxVinNum; i++){
FileArray.push ("v_"+(i+1)+".jpg");
}
trace("FileArray : " + FileArray);
};
//
function buildSlide(){
vinKern = 1;
preloadSlide = new Preloader(load_indicator);
for (var i=0;i<FileArray.length;i++){
//Construction du slide
slide.vignette.duplicateMovieClip("vignette"+i,i);
slide["vignette"+i]._x += i*(slide.vignette._width + vinKern);
// ajoute à la file du preloader
preloadSlide.insert(FileArray[i], this.slide["vignette"+i].conteneur, i,"","","okload");
}
slide.vignette._visible=0;
};
buildArray(maxVinNum);
buildSlide()
stop();
I hope my english is not too bad, and my explaination not too long and understandable.
thanks a lot for your help !
LoadVars From URL
I'm using the following code to write a .txt file:
loadVariablesNum ("http://www.chefontheedge.com/PHP/counters/cotecounter.php?ran="+random(9), 0);
This code opens a file, reads a value, adds one to the value, then closes the file. No problems, it works just fine.
In the next frame I have the following code:
loadVariablesNum ("http://www.chefontheedge.com/PHP/counters/cote_counter.txt?ran="+random(9), 0);
All this does is read .txt file that the PHP script accessed in frame 1.
This swf works fine when it exists on the same domain (which is http://www.chefontheedge.com) as the scripts it is calling. However, even though I have used absolute references, if I move the script over to any other domain
(such as http://www.itsucks.com) and run it, the swf never loads the variable it is attempting to read/write in frame 1.
Anyone familiar with this problem? Is it a time factor in loading the variable? Can I fix it? Is it all wrong and needs to be re-thunk?
Any help would be appreciated.
LoadVars(); Help
Code:
myLoadVars = new loadVars();
myLoadVars.load("url");
myLoadVars.onLoad = function( success ) {
if ( success ) {
// do something here
} else {
trace("load failed");
}
}
By using this all my variables load into myLoadVars. I can't seem to access the variables through out my flash movie. Is there a way to load all the varibles in the main time line for easy access?
LoadVars()
I have a textfile with the text "count=3" in it(without the "").
I then have the code:
puppycount = new LoadVars();
puppycount.load("puppycount.txt")
inside a movieClip called "slider", which is inside a movieclip called "puppies". Also inside "slider" I have a dynamic textfield with variable set as "count"(without the "").
Why won't this work????
Loadvars From Asp
I have a simple asp page that gets text from a database.
This text is loaded into my flashmovie
container.load("http://intranet1/simple.asp");
The problem is that it has escape characters %20 all over the shop.
The asp page is below, is it possible to unescape it in the asp page?
thanks for you help
simon
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/employee_details.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_employee_details_STRING
Recordset1.Source = "SELECT * FROM TableFlashText"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
output = (Recordset1.Fields.Item("FlashText").Value)
Response.write output
Recordset1.Close()
Set Recordset1 = Nothing
%>
New LoadVars
Hey I am thinking about using the new LoadVars but I don't know what the sintax is. if I was going to load a simple data.txt into my flash how would I do it.
YO
New LoadVars ?
Ok, I have some sintax to start with but where do I go from here...
//
myLoadbleData = new LoadVars();
myLoadbleData.load("tima.txt");
myLoadbleData.onLoad = function(success) {
if (success) {
trace("yeppp");
trace(myLoadbleData.toString())
} else {
trace("yooo");
}
};
When I try and set myLoadbleData toString I am getting a bunch of trash. How can I set it my new object myLoadbleData to a text field.
Loadvars
I need help With Loadvars
I have an animation which must load variables from URL1 and then send the variables to URL2
Thanks
LoadVars Help
I have this script:
Mydata = new loadVars();
Mydata.load("http://www.myurl.com/getdata.asp");
Mydata.onLoad = function (success){
if(success){
_root.ID = this.Mydata ;
trace(Mydata + "ID");
}
else{
gotoAndPlay(3);
}
}
and I can't get just my variable from the asp page I'm calling, instead I get this:
108=&onLoad=%5Btype%20Function%5DID
Any help is appreciated.
Thanks,
Hypersdc
LoadVars... Then What?
i'm having a go with the LoadVars object, but not having much success. there doesn't seem to be a problem loading my external text file into the object (info in this case), but how do i get the contents to display in my text field? my text field is on the main timeline with an instance name of 'hello' and variable 'guestbook'.
no matter what i try, i can't display the text. if i try the old loadVariables method, the text appears but the scrollbar component doesn't work - i just can't win!!
LoadVars To Asp Bug?
Hey all.
I'm using loadvars to send some data to asp. works great when you click. but on browser refresh(f5 or refresh button) the variables are gone.
I'm using request.form("flashVar") in my asp to grab the vars. It's like the form gets wiped on refresh, any ideas.
thanks
HELP On LoadVars
Hello
I have an HTML page where I put some javascript with the :
myFlashMovie.setVariable('myVariable', 'Hello')
in it. In my flash movie I have :
var importVariables = new LoadVars();
importVariables.onLoad = function(){
TextWindow1.text = importVariables.bodyText;
}
importVariables.Load("http://www.thisplace.com");
But my textwindow does not get any value. What am I doing wrong. Please help....
LoadVars HELP
when loading variables from an external .txt file, how should they be written into the .txt file if you have more than one. I'm trying to load a selection of colours as variables, I tried listing them in the text file like this, but that doesn't seem to work.
red = 0xFF0000;
green = 0x00FF00;
blue = 0x0000FF;
LoadVars Vs. XML?
Hi,
I am currently developing a web app using Flash with PHP/MySQL. I've tried using AMFPHP, and it looks promising but for now I'm just sticking with using LoadVars to communicate between Flash and PHP/MySQL, and that's working fine. I've read a lot, however, about people using XML to move data between Flash and the server. I don't have any experience with XML, and for now I'm going to be sticking with using LoadVars for the time being, but I'm wondering whether using XML is a better solution in the long-run, in which case I might consider switching over to it later down the line. What do you think? What are the advantages/disadvantages of LoadVars vs. XML?
If it helps to know this, the data I'm moving from the database is all numbers and text, ranging from fields just a few characters long to fields thousands of characters long.
Thanks,
Rob
LoadVars On A Mac
I am using LoadVars to set some variables from a text file and everything works fine on a PC. My problem is that it is not working on a Mac. The Mac has Flash Player 6 installed but it is not the latest version. I don't remember off hand what the exact version is but I think it is 6.0.29. Has anyone else had a problem with this on a Mac? I am using this method to control menus on the new version of my site and want to be compatible with as many browsers as possible. Should I go back to loadVariables to be safe or is there something I am overlooking?
The code I am using is:
theSection = new LoadVars();
theSection.load("pageCounts.txt");
theSection.onLoad = updateGroup;
function updateGroup() {
_root.gotoAndStop(_root.group);
}
I navigate to a labelled frame once the variables have loaded.
Any help would be appreciated.
LoadVars
i'm learning about the new and very handy LoadVars (thanks MM!), but i can't seem to get it to work.
I have a CFML file that processes a function then returns a variable and it works great when i use loadVariablesNum.
Quote:
SendMail = new LoadVars();
SendMail.load("/db2flash.cfm?mailfor=submod36&do=mailplan&firstnam e="+_level36.firstname);
SendMail.onLoad = function(success){
if (SendMail.go == "1") {
_level36.txtemailsending._visible = false;
_level36.txtemailerror._visible = false;
_level36.txtemailsent._visible = true;
} else {
_level36.txtemailsending._visible = false;
_level36.txtemailerror._visible = true;
}
}
When this executes from a button release the ELSE statement executes in my check for the returned variable "go"
When you simply execute
Quote:
loadVariablesNum("/db2flash.cfm?mailfor=submod36&do=mailplan&firstnam e="+_level36.firstname, 36,"POST");
the variable _level36.go is equal to "1"
If you simply http to /db2flash.cfm?mailfor=submod36&do=mailplan&firstnam e=test
the output is &go=1
It is also important to note that the processing executed by the db2flash.cfm file does properly execute when using LoadVars - so I am guessing that the problem is solely the if statement for the variable. Somehow it is not finding the variable or somehow the value doesn't match.
What gives?
Loadvars
im having a problem with LoadVars()
plz have a look at the attached
this is what is in my session.php
PHP Code:
<?php
session_start();
echo "&sessid=".urlencode(SID);
?>
Also
can someone tell me the difference between this 3:
LoadVars.load (Does it load all the variables in the external file?)
LoadVars.send (What variables does it send?)
LoadVars.sendAndLoad(Is is a combination of load and send?)
Thanks
LoadVars Help
I am trying to send data to an ASP page and then act on the information it sends back but I am having problems with receiving the data.
I am using the following code:
Code:
updateAssessment = new LoadVars();
updateAssessment.aid = aid;
updateAssessment.qid = questionID;
updateAssessment.correct = result;
updateAssessment.time = _root.timeSpent;
updateAssessment.send(url+"?r="+parseInt(9999*Math.random())+"&command=update",updateAssessment,"POST")
I know this is working because the data is getting to the ASP page.
The ASP is returning: &done=yes&
I thought that any variables returned from the ASP would become properties of my updateAssessment LoadVars object so I tried:
Code:
If (updataAssessment.done == “yes”){
// data saved
} else {
//no data saved
}
but this didn’t work.
I have also tried setting up a separate object to receive the data but this didn’t work either.
Can anyone offer any help?
LoadVars Bug? (ASP+MX)
Im at a loss! my ASP page isnt recieving sent data, which i use to retrieve requested data from a database. Below is an example and explanation of what is happening
If i use the the send method:
AS:
getSections=new LoadVars()
getSections.sendSQL="SELECT * FROM sections WHERE Use=True;"
getSections.send( _global.siteAddress+"getSections.asp", "_Blank");
and Display the sent value:
ASP:
Response.Write Request.QueryString("sendSQL")
for the ASP file it works!
However if i use the sendAndLoad
AS:
getSections=new LoadVars()
getSections.sendSQL="SELECT * FROM sections WHERE Use=True;"
getSections.sendAndLoad( _global.siteAddress+"getSections.asp", getSections);
getSections.onLoad=function(success)
{
if(success)
{
trace(getSections.Var1+"/")
}
}
ASP:
Response.Write "Var1="&Request.QueryString("sendSQL")
I get BOT all back !!!!
I quote from the help files:
Quote:
Variables are posted in the same manner as LoadVars.send(). Variables are downloaded into targetObject in the same manner as LoadVars.load().
So surely this should work!!!
Im about to break something so any help would be most appreciated and save me replacing said broken things
LoadVars And PHP
oh man...Iu'm buggin out here. I built this app that uses the LoadVars Object to load in a txt file (text.txt).
Now the client has decided that their programmer wants to give me a PHP file instead....and I can't get Flash to load in the variables. The PHP file has the exact same data in it but when I test it in Flash I get the 'ol "A script in this movie is causing Flash Player to run slowly. If it continues to run, your computer may become unresponisev. Do you want to abort the script".
Now why is that? Does LoadVars not work withfiles other than .txt?
This is my AS:
Code:
function loadItUp(){
variables = new LoadVars();
variables.load("http://www.someURL.com/res-data.php");
//assign a function which fires when the data is loaded:
variables.onLoad = function(success) {
if (success) {
trace("done loading");
} else {
trace("not loaded");
}
};
}
loadItUp();
Is this wrong?
Any help would be GREATLY appreciated.
LoadVars
Hi,
I understand, its simple enough to fill a loadvars object with data from an array as such..
loadVars.anything = array.anything;
but what if the array, contains other arrays?
because this doesn't work..
loadVars.array2.anything = array.array2.anything;
Do I have to create an array of type array2, in the loadVars object, before I can move the data across?
thanks for any help.
boombanguk.
LoadVars Help Please
I am converting some actionscript that used to use loadVariableNum to post the movies variables and receive variables back.
I assume that the LoadVars object with sendAndLoad method does the trick, but I cannot get it to work.
Quote:
linkvar = "/db2flash.cfm";
SendMail = new LoadVars();
SendMail.onLoad = function(success){
if(success)
{
_level32.txtemailsending._visible = false;
_level32.txtemailerror._visible = false;
_level32.txtemailsent._visible = true;
} else {
_level32.txtemailsending._visible = false;
_level32.txtemailerror._visible = true;
}
}
SendMail.sendAndLoad(linkvar,_level32,"POST");
}
None of the code executes within the if(success) function.
The example I found used the SendMail object instead of _level32 to send the variables, but my variables aren't in that object. If i were to access them I'd do "level32.thevariable"
HELP PLZ!
LoadVars
myLoadVars = new LoadVars();
myLoadVars.load("ColdFusionSQL.cfm");
This is put in a movieclip that is on the stage in main time line. This SWF file is in the same dir as the cfm which calls the varriables with its select statement. I can display on the cfm directly with cfoutput the varriables. So why cant I see those variables in flash??? I cant seem to access the varriables in flash because im sucky at action script. Please help a brother out.
Dynamic text field should have Var named the Variable name as it is in the databse right? So if it goes SELECT * FROM TABLE
and TABLE has HP and Score in it that have contents. I should name my dynamic text field Var: Score
This should display contents of Score right? I've never got to see dynamic data yet in flash so im sure im missing something.
LoadVars()
Hey
I got two questions about the LoadVars class:
1.I have this script:
PHP Code:
test=new LoadVars();
test.one=1;
test.sendAndLoad("phpscript.php",test,"POST");
That works super but it doesn't work with
test.send("phpscript.php",test,"POST"); Why?
And in contradiction to .sendAndLoad .send opens a new browser window.Why?
2.When I send the variables and write them into a textfile the test.onLoad function is also sent and written into that file. Trying to load fails of course because in the text file is "&onload=[type Function]". How can I avoid sending this function to the script?
That's all I have trouble with. If you could help me I would be very thankful.
slapy
Loadvars Help
Hello,
I'm loading a text file "array.txt" by loadvariables method.
ru = new LoadVars();
ru.load("array.txt");
I'm not sure if i'm referring to the variable correctly or whatever but the text isn't displayed in the textfield. The textfield is placed inside a movieclip which is again placed inside another movieclip. I'm using the following syntax,
sometext.text = unescape(_root.ru.rus(_root.pageindex));
(pageindex evaluates to a integer).
Finally the textfield should display the text in variable "rus1".
pls help me it's urgent!!!!!
LoadVars()
I am loading a variable from an external .txt file. I was wondering if it is possible to put more than one variable in this .txt file and have flash load them in.
The problem I am having when loading more than one variable is that the variables and values all concatenate together. Does anybody know of a way to solve this problem?
Here is the flash code that I am working with:
----------------------------------------------
loadStart = new LoadVars();
loadStart.load("start.txt");
loadStart.onLoad = function() {
_root.path = this.homePage;
target_slider(this.new_z);
};
The .txt file looks like this:
------------------------------
homePage=swf/home.swf
new_z=z_3
If anyone could help me out I would really appreciate it. Thanks in advance.
LoadVars
I'm not sure... not in front of my computer at the moment but I was thinking. I think its loadVariablesNum....
But besides that... I can load the Variables from a text file fine. But how do I assign the text value of each variable to my textfield without making the textfield a variable? If I make it a variable, my scrollbar doesn't recognize it for scrolling. Is it as simple as just saying textfield.text = namedVariable;?
As always... any help is appreciated.
LoadVars And '%'
Hi,
I'm using loadvars using txt file with this line:
&varName=varValue text... text...&
Where varValue is % - and that causes the rest of the text not to appear.
What's the way to put a- % in the txt so it won't cause the trouble?
Thanks in advance,
Maya Malimovka.
LoadVars() How?
I have a function which has the loadVars command and onload of those variables I want to call another function. But it seems I am missing some critical logic here. Can anyone help please?
Here is the code below:
Code:
function drawBackground(Void):Void
{
Draw background first..then load variables from external txt file.
myVars = new LoadVars();
myVars.load("barvars.txt");
myVars.onLoad = function(success) {
if(success){
//trace(barVals);
drawCharts();
} else {
trace("no variables loaded");
}
}
}
function drawCharts()
{
Do something with the variable values recieved...
}
Should I mention, this code is in external AS file and am working on a component.
Thanks.
Using LoadVars()
alright. so i created a .txt file containing data points that are seperated by spaces.
Code:
dataLoad = new LoadVars();
dataLoad.onLoad = analyze;
dataLoad.load("danny.txt");
function analyze()
{
... ?
what would i do in the analyze function to be able to analyze one by one each data point in the file? (a data point can be any number of chars or numbers)
LoadVars Help
I'm trying to send variables to a php script with this:
on (release) {
passVar = new LoadVars();
passVar.txt1=txt1.text;
passVar.txt2=txt2.text;
passVar.txt3=txt3.text;
passVar.send("http://www.coldsite.net/dev/test1.php", "_parent", POST);
}
It sends them in the GET method no matter what. Anyone know what I can do to fix this?
LoadVars
I've been battling with loadVars for 2 days now.
Can anyone point me to a good tutorial or info on LoadVars?
thanks
LoadVars To .php
Hi, I'm dealing with a mailing list right now. I've a front end flash interface:
typical form with input fields. What I'm having problems with is getting the field variables passed to interface.php.
The loadVars object- "form" sends and interacts but when I check the database all I get is a comma , heheh.
please see the ,fla and .txt ( switched from .as cause it wouldn't upload)
I can only think that I'm misnaming my textFields or something,
and well, I don't think they are even hooked up to the object - "form" somehow. The field names need to be instantiated under "form".
my field names are derived from an existing .as file.
how do I go about this? I feel so close to getting it done..
Lemme know if you need any more info to make things clearer.
thanks so much in advance..
Jason
LoadVars Help
One of my clients has signed up with a mailing list service named Intellicontact.
I am trying to recreate their form in Flash (the website is Flash) and am stumped as to how to translate some of the the variables.
The following is the form:
Quote:
<form method=post action="http://www.intellicontact.com/icp/signup.pl">
<input type=text name="fields_email">
<input type=text name="fields_fname">
<input type=text name="fields_lname">
<input type=text name="fields_address1">
<input type=text name="fields_city">
<input type=text name="fields_state">
<input type=text name="fields_zip">
<input type=text name="fields_phone">
<input type=hidden name="listid" value="9830161">
<input type=hidden name="specialid:9830161" value="X4R5">
<input type=hidden name=reallistid value="1">
<input type="submit" name="Submit" value="Submit">
</form>
My attempt to recreate this form in Flash:
Quote:
mySendVars = new LoadVars();
myLoadVars = new LoadVars();
mySendVars.fields_fname = firstname;
mySendVars.fields_lname = lastname;
mySendVars.fields_address1 = address;
mySendVars.fields_city = city;
mySendVars.fields_state = state;
mySendVars.fields_zip = zip;
mySendVars.fields_email = email;
mySendVars.fields_phone = homephone;
mySendVars.listid = "9830161";
mySendVars.specialid:9830161 = "X4R5";
mySendVars.reallistid = "1";
mySendVars.icpsignup ;
mySendVars.sendAndLoad("http://www.intellicontact.com/icp/signup.pl", LoadVars, "POST");
I know main error lies with variable "specialid:9830161" but I do not know how to translate this into an actionscript variable.
Any help will be appreciated.
LoadVars() Help
Help!!
I am trying to make a simple guestbook for my site. It will use the POST method to transmit the data to a php file which will append the text to a file. I have read several tutorials and several documentations on the LoadVars() function and cannot get it to work!
Can anyone please help?
code:
this.onRelease = function(){
submit_lv = new LoadVars();
reply_lv = new LoadVars();
submit_lv.namef = this._parent.name_txt.text;
submit_lv.subjf = this._parent.subject_txt.text;
submit_lv.textf = this._parent.text_txt.text;
submit_lv.sendAndLoad("http://www.xerofive.com/cgi-bin/guestbook.php",reply_lv,"POST");
reply_lv.onLoad = _global.loadingF();
};
That is my submit button's code.
code:
_global.loadF = function(success){
if(success){
_root.box_txt.text = success;
} else {
_root.box_txt.text = success;
};
};
This was just some random code I wrote to try and see if it could even connect. The textbox "box_txt" does not change, as it should, so I'm convinced that my script cannot connect to the php file, which reads as follows:
PHP Code:
<?php
$name = $_POST("namef");
$subj = $_POST("subjf");
$text = $_POST("textf");
$file = fopen("http://www.xerofive.com/x5/test.txt","w+");
fwrite($file,$name);
fwrite($file,"
");
fwrite($file,$subj);
fclose($file);
?>
The above script does not do much, and it is currently not intended to. I was simply trying to get the script to output some sort of data to verify that there was a connection. No output from that script, either.
I don't know if my stupidity, or if a lack of understanding of either LoadVars() or php (I know nothing about php) is to blame.
Thanks in advance for any help
PHP And LoadVars Help Please :)
Okay, so I'm a C++/Java programmer, but I have almost no experience with Flash.
I'm trying to set up a website so that I can pipe in page content based from a PHP database. I'm done a little research on the subject and I feel comfortable with most of the implementation details, but I'm missing a step somewhere.
I've already got my php page set up and it's spitting out the appropriate data in the correct format, like so:
maxPages=142&LeftPage=left page stuff&RightPage=right page stuff
I'm also pretty clear on the fact that I need to use the LoadVars class in a manner such as the following:
Code:
var myLV = new LoadVars();
myLV.onLoad = processVariables;
myLV.load("pageContent.php");
function processVariables(success)
{
if (success)
{
_root.rightPage = this.rightPage;
_root.leftPage = this.leftPage;
}
}
I guess where I'm getting lost is the part where I connect all the front-end pieces together.
I have several movie clips with names like "page1", "page2", etc. and they all have just one frame. Each page has a dynamic text box, and I figure somehow it's supposed to know to put the variable text in there somehow, but that's the part I'm not getting.
I tried giving my text box an instance name like "rightPage" and putting the above code in the "Actions" code field (or whatever it's called), but I never got anything.
What am I missing?
Thanks.
PHP And LoadVars Help Please :)
I'm trying to set up a website so that I can pipe in page content based from a PHP database. I'm done a little research on the subject and I feel comfortable with most of the implementation details, but I'm missing a step somewhere.
I've already got my php page set up and it's spitting out the appropriate data in the correct format, like so:
maxPages=142&LeftPage=left page stuff&RightPage=right page stuff
I'm also pretty clear on the fact that I need to use the LoadVars class in a manner such as the following:
Code:
var myLV = new LoadVars();
myLV.onLoad = processVariables;
myLV.load("pageContent.php");
function processVariables(success)
{
if (success)
{
_root.rightPage = this.rightPage;
_root.leftPage = this.leftPage;
}
}
I guess where I'm getting lost is the part where I connect all the front-end pieces together.
I have several movie clips with names like "page1", "page2", etc. and they all have just one frame. Each page has a dynamic text box, and I figure somehow it's supposed to know to put the variable text in there somehow, but that's the part I'm not getting.
I tried giving my text box an instance name like "rightPage" and putting the above code in the "Actions" code field (or whatever it's called), but I never got anything.
What am I missing?
Thanks.
LoadVars
Is it possible to read a file from another server like this?
Code:
var lv = new LoadVars();
lv._parent = this;
lv.onData = function(inString){
trace(inString);
}
lv.load("http://otherserver.com/file");
It works locally but not when I upload it to my server. Does the file crossdomain.xml have to exist on the other server?
/Per-Henrik
LoadVars
Just a quick one...
can I post loadVars to an other server??
My client only has .asp and I want to try and host the mail.php file on my server.. is this possible? I don't have access to there server so can't test.
Mike
LoadVars & ASP
Hey,
I have a flash mailer form that uses ASP for the server side. I can get the email to send (finally) but when I get the email in, everything is 'undefined'. I understand that it is coming through like this because the variables that i am calling haven't been defined somewhere along the line.
So my question is, do the variables get defined in the actionscript or should they be defined in the ASP? If it is in ASP, I am trying to use the request.form to define them as they have been inputted in the flash txt boxes, but it doesnt work.
ASP code is
<%
Dim myMail, myBody
)
myBody = "Name: "&request.Form("fullname") & vbcrlf
myBody = myBody & "Nationality:" & request.Form("nationality") & vbcrlf
myBody = myBody & "Email:" & request.Form("email") & vbcrlf
myBody = myBody & "Enquiry:" & request.Form("enquiry") & vbcrlf
Set myMail = CreateObject("CDO.Message")
myMail.From = Email
myMail.To = "kevan@wishvancouver.com"
myMail.Subject = "Information Request"
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") _
="mail.wishvancouver.com"
'Server port
myMail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _
=2525
myMail.Configuration.Fields.Update
myMail.Send
set myMail=nothing
%>
Thanks!!
Kev
Loadvars Help
Hey, I've got a flash file in which i want it to import text from a .txt file but whenever i try it, i get some weird stuff. Here's my code
Frame 1
Code:
myLoadVar = new LoadVars ();
myLoadVar.load("test.txt");
Frame 3
Code:
myLoadVar.onLoad = function (success){
if (success == true) {
news=myLoadVar.news;
nextFrame();
} else {
prevFrame();
}
}
the instance and variable name of the dynamic text field is both "news" and the text file is named test.txt with the content of
Quote:
news=test news stuff&
However when i publish it, all i get in the text field is
Quote:
_level0.news
Help!!
LoadVars Help
something so simple, that i'm just not able to figure out.
i've got a .txt file with 5 variables.
i know this is how you load them...but assigning those variables to new ones.
Code:
var lowBracketQ:LoadVars = new LoadVars();
lowBracketQ.load("L_Bracket/q" + _questNumb + ".txt");
my txt file is set up like this.
Quote:
&q=Question&
&a1= answer1&
&a2= answer2&
&a3= answer3&
&a4= answer4&
Loadvars
hi
using loadvars to get some values from a db
my first frame has this code:
Code:
myvars=new LoadVars();
myvars.load("read-info.cfm");
myvars.onLoad = function(true) {
_root.gotoAndPlay(4);
}
stop()
the start of the next page is then
Code:
for (i=1;i<Number(_root.myvars.total)+1;i++){
myarray=_root.myvars["player"+i]
myarray=myarray.split(",");
this works so far but could someone please explain to me what is happening in this second page?
Loadvars
i have used the following two pieces of code.
the first uses data sent from a database, puts it into an array, creates a dynamic text box and presents the data in these.
Code:
for (i=1;i<Number(_root.myvars.total)+1;i++){
myarray=_root.myvars["player"+i]
myarray=myarray.split(",");
_root.createTextField("mytext"+i,i,300,200+(i*10),300,100);
_root["mytext"+i].multiline = true;
_root["mytext"+i].wordWrap = false;
_root["mytext"+i].border = false;
myformat = new TextFormat();
myformat.color = 0x000000;
myformat.font = "eurostile";
myformat.size = 10
myformat.bold = true
myformat.leading = 5
_root["mytext"+i].text = myarray[4];
_root["mytext"+i].setTextFormat(myformat);
}
i attmepted to adjust this code by creating a movie clip (list1) to present the data rather than create the text boxes. the movieclip contains 16 dynamic text fields myplayer1 down to myplayer16.
Code:
for (i=1;i<Number(_root.myvars.total)+1;i++){
myarray=_root.myvars["players"+i]
myarray=myarray.split(",");
myformat = new TextFormat();
myformat.color = 0x000000;
myformat.font = "eurostile";
myformat.size = 10
myformat.bold = true
myformat.leading = 5
list1["myplayer"+i].text = myarray[4];
list1["myplayer"+i].setTextFormat(myformat);
}
with the first code, the data is pushed through fine, but on the second, it comes up undefined. anybody know what im doing wrong?
thanks
LoadVars
been using loadVars throughout by work, with super results. However, my latest one just wont work whatever i do, all code is correct. There isnt a limit on the amount of times you can use it is there?
LoadVars Help. Please
Hello,
I would like to pass a variable from my view.php into my flash. Here is what I have;
The variable in my view.php is this;
$name = "admin/Music/XML/$thisshopID.xml" ;
And the $thisshopID checks what shop ID is being viewed, I have code above this varible that finds which ID is being viewed;
$thisshopID = $_REQUEST['shopIDField'];
now, I need that $name var to be in here;
playlist.load("path to xml file here"); or playlist.load($name);
See the variable finds out which ID is being called, and than puts that number infront of the .xml. All of the xml files are according to there ID, so the shop with ID = 1 will have 1.xml , and ID = 2 will be 2.xml .
Now when I view, view.php it passes a query string telling the variable $name which ID is being called;
http://localhost/Learn/view.php?shopIDField=1
so I want the name variable which would be if the id is 1 will be;
admin/Music/XML/1.xml
and than I need it so that playlist.load("path to xml here"); will be playlist.load("admin/Music/XML/$thisshopID.xml"); but instead of $thisshopID it will have the shopID of whatever one is passed.
I know this is possible with loadVars, but I dont know how to do it.
If someone could show me how, that would be sooo cool!
Thanks!
|