New Window Opening With LoadVars.send
Hi.
here's what's happening:
myVars.send("myfile.asp") does not work.
however,
myVars.send("myfile.asp","","POST") does work
but it opens myfile.asp in a new window.
Here is another quirk. If you submit this data 5 times, it opens 5 myfile.asp browser windows. but only the first 4 register in the database.
if you send this 7 times you get 7 open windows and only the first 6 register in the database.
etc. where the last (or most recent) request is not sending from myfile.asp to the database.
any ideas would be very helpful.
Thanks.
FlashKit > Flash Help > Flash MX
Posted on: 05-30-2003, 02:51 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Send LoadVars Without Opening Browser Window
I am trying to send data to a php program that inserts the value into a mysql database... everything works perfectly when i say c.send("insert.php","_self","POST"); but that opens a browser window. I heard you could use sendAndLoad to get past the browser window opening, but it doesn't run the php program when i do so. Any ideas?
var c = new LoadVars();
c.owner = cr_owner;
c.name = cr_name;
c.sendAndLoad("insert.php",_root,"POST");
Xml.send To Php Without Opening A New Window
I tried all the values (_top,_self,...) in the parameters of xml.send and it opens the PHP file. I need PHP only as backoffice for saving the xml file.
What can I do to stay with the Flash window?
Thanks
Send Data To Php Without Opening A New Window
Hi There...
I have a small question. Is it possible to send data, using loadVars to a php
script but not have a new window open up.
i have the following script
Code:
myData.send("store.php", "_self", "POST");
which is sending my data into a database. However when this script is executed
it opens up a new window(store.php of course)... i would like it to stay on the same page containing the .swf when the button is clicked to execute the above script. Is this possible with loadVars or should i be parsing XML?
any help would be much appreciated.
thanks
rob
Send Variables To Php Without Opening New Window
hi there
I want to send some varaibles to a php page without opening a new window and without having the php page replacing the flash one. For now, my php page is just writing some stuff (the variables) in a debug text file, nothing more.
The send(LoadVars) doc tells :
"If the target parameter is specified, the server's response is displayed in the browser frame window named target. If the target parameter is omitted, the server's response is discarded."
I tryed the following :
sendmix = new LoadVars();
sendmix.m1t1="A";
sendmix.m1t2="B";
sendmix.send(phpSendMix,"_blank","POST");
// opens new window, variables transmitted
sendmix.send(phpSendMix,"POST");
// opens new window, variables transmitted
sendmix.send(phpSendMix);
// nothing happens, variables not transmitted
sendmix.send(phpSendMix,"_self","POST");
//initial window gets blank, variables transmitted
sendmix.send(phpSendMix,"_top","POST");
//initial window gets blank, variables transmitted
sendmix.send(phpSendMix,"_parent","POST");
//initial window gets blank, variables transmitted
I also tryed the GET method, same result...
I must miss a basic thing. How is it possible to call and pass variables to a php page (that will write some stuff and execute things but not displaying anything) and then come back to the flash movie ? ? ? ? ? ? ? ? ?
Why what is written in the doc is not doing what expected ? ? ?
Any ideas ? ? ? (Flash MX, Flash Player 6)
I have already done something close with sendandload, but now, I don't need any variable feedback, and moreover, sendandload doesn't work now. I think it's because my flash movie is already listening to a mp3 radio stream, and I don't want to shut down this streaming.
Any help much appreciated.
GetURL Without Actually Opening A Window? LoadVars?
Hey is there any way to use the getURL command without it actually opening a new page? What I'm really doing is sending variables to a php page and inserting data into a database, but when i use LoadVars and LoadVars.send it's not workin for some reason. So I tried a simple getURL and that also sends the variables to the page and that works for me, but I don't want the users to see a new window popup or for the one theyre in to go to a new URL... Any thoughts? Maybe I'll post my LoadVars code too just to make sure I did that correctly... but I copied and pasted it from another LoadVars object in the same flash program that is working correctly (both sending AND loading variables)... thanks for any help!
How To Prevent Opening A Window When Using LoadVar.send
I have written these script in Flash
on (release) {
myLVSendObj = new LoadVars();
myLVSendObj.pageID = _root.pageID;
myLVSendObj.id = _root.id;
myLVSendObj.send(serverPath+"pageID.php","POST");
}
I simply want to pass some data to php and then save them to database, but when I click the button, it instead opens a window with the above URL. I have read the HELP dictionary of loadVars object and it says the SEND method have an argument "target".
myLoadVars.send(url[,target,method])
Does this affect? What does the target used for?
Thanks.
LoadVars.send Without Popup Browser Window?
I'm using very successfully the "loadVars.send()", using the POST method. BUT I did not expect to see a popup browser window!? I can shut it down using another javascript, but get a confirmation message (because I didn't open up that unwanted browser window using js)... Is there any way I can call a loadVars send without the popup browser window?
I am using: myVars.send ("Aurora.php", "POST");
Using: myVars.send("http://localhost/play/Sendinfo1.asp", "_blank", "POST");
or myVars.send ("http://localhost/play/Sendinfo1.asp", "", "POST"); gets me the same pop up window.
Any further help greatly appreciated.
Thanks
[CS3] Using LoadVars, Opening Website Through Txt File In Another Browser Window?
How can I open a NEW browser window when using getURL with LoadVars? This should be easy!
I have a .txt document with the code: link=http://www.mysite.com
I have this on my button:
on (release) {
newURL = new LoadVars();
newURL.onLoad = function() {
trace(newURL.link);
webSite = newURL.link;
getURL(webSite);
};
newURL.load("url.txt");
}
LoadVars.send Doesn't Send..
Hi people, It's a LONG time since my last Flash application, I'm just catching up.
I'm trying to build a Flash "driver" for a serverless chat client (this means I'm making it work with a database and a php script, but no socket server, as I don't have the money to have such a hosting that let's me use one).
Anyway, what I'm trying to do is to get Flash to query the php script, sending some data (like channel id, user id etc..) and retrieve the new messages.
I have debugged the php script and I can assure the problem is not there.
The script prints whatever request arguments it recieves into comments in the response page.
What I'm doing in flash is:
code:
Request = new LoadVars();
Request.my_var = "foo";
Request.send("http://blablabla....php", "_blank", "POST");
The darn thing doesn't send anything to the php script.
I've already seen that it is possible to add variables to the url string, and they get passed to the script, but I don't want to get so dirty...plus I want to use POST, because of potentially long messages being passed.
Does anyone know anything about this?
Gosh I have it when Flash comes to such stupid problems.
Php rules!
If I don't get it right within a few hours, I'll just build the whole thing in Javascript. I just don't want to have to build it for each and every browser on the web...
Cheers!
Page 2 - LoadVars.send Won't Send
It occurs to me that 'send' is not as useful and rarely better to use than 'sendAndLoad'. Even if you do not intend to use any returned variables, the 'sendAndLoad' method will notify Flash that your server side script has processed the information correctly.
Just check this commented code out and I think you will agree this is much better...
Code:
// Success/Failure function sends user on to new frame when called
test = function (success){
if (success){
gotoAndPlay("loaded");}
else{
gotoAndPlay("failed");
}
};
update=new LoadVars(); // create new LoadVars object called 'update'
update.data="value"; // assign the variable 'data' to the new LoadVars object
update.onLoad=test; // call the test function when the transfer is complete
update.sendAndLoad("update.php", reply, "POST"); // begin the transfer
stop(); // stop the movie (continues on calling the 'test' function)
In my example above is the 'sendAndLoad' line:
update.sendAndLoad("update.php", reply, "POST");
1. 'update.sendAndLoad' sends our 'update' LoadVars object.
2. 'update.php' is our script.
3. 'reply' is the LoadVars object any results will be returned in.
4. 'POST' is our method.
...as you can see, if the script processes the data correctly it will return a successful operation to Flash, where you can then continue your movie. It will also return a non-successful operation and allow you to forward to a Flash frame with some form of error message (which I think should be a requirement of any data transfer).
That would be the best advice I could offer, but if you are adamant about using just a 'send' command... try using your LoadVars object instead of a window target, as I think its is very odd the same object is apparently using different methods...
data.send("save2.pl", data, "POST");
Yeah, btw surely its 'POST' not 'GET' ...some data send/load objects will not work with the 'GET' method, so its wise to stick to 'POST' unless its necessary not too.
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
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
LoadVars.send Won't Send
I've been following this tutorial from actionscript.org as well as the reference from macromedia on how to use LoadVars to load variables from a text file into an object. I'm quite satisifed with how it loads, but I have been unable to use the ".send" aspect of it.
I'm starting to get really confused, since another thread on the board says that flash alone can not write variables to a text file.
My .FLA file can be found here, and my variable file can be found here.
(a short explanation for those that view the .fla: the movie loads the IP values from a text file, and the user is supposed to put a word in the input box next to each one. The input box refers to the variable within the "data" object, and when trace is used it shows that the values are updated for those variables, yet it still won't write to file.)
Please help me out, since this is my final art project for this semester and I'm really hoping on presenting it this monday.
LoadVars.send
I can't use loadvariables for my script, and loadVars.send pops us an IE window, with the script address, after the vars have been loaded.
Is there a way to avoid it? (avoiding the target frame param for server response doesn't help)
Loadvars.send()
every time i use loadvars.send() it always open a new window , how can i omit the opening window? any suggestion? thanks!
?loadVars.send With Asp?
Hiya,
could anyone run an eye over this script? its purpose is simply to send out an http header to an asp script. Am I using this object correctly?
---------------------------------------------------------------------------------------
on (press) {
header = new LoadVars();
headerstr =
"?lable1="+_root.firstname+
"&lable2="+_root.lastname+
"&lable3="+_root.address1+
"&lable4="+_root.address2+
"&lable5="+_root.address3+
"&lable6="+_root.postcode+
"&lable7="+_root.emailad+
"&label8="+_root.age;
header = headerstr;
header.send("http://www.nslaved.com/contact.asp",GET);
}
on (release) {
gotoAndStop(2);
}
----------------------------------------------------------------------------------------
all the _root.firstname etc. are input textfield var names.
Oh yes, and is this use of " + " recommended?
whadyathink?
A word or two of advice would be greatly appreciated,
Cheers,
Scott
LoadVars Send?
Hi,
I wan't to send some information to a php page that will transfer this to mySQL, I don't need a response so I used the Send function. But for some reason this pops up the php page in a new window. Can I get around that in any way, cause I don't wan't the page to pop up?
Cheers!
Magnus
LoadVars.send()
Hi, i try to make following:
I will control, if anybody visit my site with email notifikation.
1. I want in movie built script with LoadVars.send() or something similar to send for ASP page info (my variable), that now had anybody loaded this flash movie.
2. Then will be the ASP send email to me with following script:
//time_of_visit is variable, which will be loaded from my movie
Code:
<%
var_mail = request.form("time_of_visit")
set Mail = Server.CreateObject("CDONTS.NewMail")
Mail.From = "postmaster@flashmedia.cz"
Mail.To = "info@flashmedia.cz"
Mail.Subject = "Somebody loaded my movie"
Body ="°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°" & chr(13) & chr(10)
Body = Body & var_body & chr(13) & chr(10)
Body =Body & "°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°" & chr(13) & chr(10)
Mail.Body = Body
Mail.Send
set objRST = nothing
set Mail = nothing
%>
The problem is, that i canŽt still send variables to ASP page with LoadVars object.
Before i used e.g.
Code:
_root.loadVariables ("../forms/save_visitor.asp", "POST");
It worked, but i want to learn this LoadVars object.
In my book is'nt good explained.
Thanks Jan
LoadVars.send
I am desperate!!!!!!!!!!!!!!!!!
I have been trying to send information to a data base. i have tried the following:
getURL("http://scadev.kmionline.com/staemodules/emod108/m01/quizposter.asp?topicname=Organization%20Fundamenta ls&quizname=quiz1&quizscore="+q1answer, "
", "POST");
when i use this the information gets to the data base but opens another window. i don't want a response back.
so i tried:
var lv:LoadVars = new LoadVars();
lv.topicname = "Organization%20Fundamentals";
lv.quizname = "quiz1";
lv.quizscore = q1answer;//variable for the total score of quiz
lv.send("http://scadev.kmionline.com/staemodules/emod108/m01/quizposter.asp", "POST");
this does nothing.
i need to be able to send the information with out is opening another window or give me a response.
please, any help will be appreciated. thanks
dawn
LoadVars() ..... .send
ok I have a basic text echo text box (to try to get the damn .send methods to work)
frame one makes a new loadvars object by
I'm using flash 5 so I don't know if the old flash is a problem.
Quote:
text = new LoadVars()
then when they press enter (or the enter button) it goes to frame two where I have
Quote:
text = _root.input;
text.send("input_text.php" , "POST")
_root.input = "";
which makes the text loadvars object equal to whatever they typed in in the input box, and sends it to my php script, and then clears the input box for new input. However my php script or the send function are having trouble getting the damn variables. When I use getURL it works fine ( i recieve a text variable and an input variable in php with the same value, what the user put in) BUT I don't want it to use getURL, I want to use the text object I made. Am I doing something wrong? my php program writes whatever it gets to a text file, permissions are correct because I changed them all to work with getURL, but they dont work with send.
I'm so close but somthing is not right, help!
LoadVars.send() How To Use It?
I use for sending variables this:
Code:
this.loadVariables("../forms/singup.asp", "POST");
How can i use LoadVars class for sending variables?
Thanks
LoadVars.send() Help
I'm a little confused about how LoadVars.send() works. I have a form in Flash that has a text field (txtName) whose input I want to send to an ASP page.
btnSubmit.onRelease = function(){
var my_lv:LoadVars = new LoadVars();
my_lv.teacherName = txtName.text;
my_lv.send("http://www.mywebsite.com/test.asp", "_blank", "POST");
}
I guess my first question is my code correct? And my second question is what happens after this code is executed? Does it automatically run the script on my asp page without ever having to navigate to it? On my asp page I just have Name=Request.Form("teacherName") and then I insert that value into the DB.
Using Loadvars.send
Just wondering, if I have a text file with say... line1= &line2= &line3= etc, and I want to make a flash file with a button that will input stuff into this text file, what code will I need to use??
Loadvars() Send
Hi
i have made a login which send a email when a users logs in it loads some variables with this code and send them to email.php:
Code:
mail_vars = new LoadVars();
mail_vars.name1 = name1;
mail_vars.email = email;
mail_vars.body = body;
mail_vars.send("email.php", "POST");
after reaching the frame it send the email correctly and pop-up a blank window. So i read on the form that if you make the code like this it wont
pop -up:
Code:
mail_vars = new LoadVars();
mail_vars.name1 = name1;
mail_vars.email = email;
mail_vars.body = body;
mail_vars.send("email.php",newEmail,"POST");
but then it refuse to send the email someone got any idea searched the net for a day now without succes
thnx
LoadVars.Send To ASP
Hellow,
I'm trying to send content from flash to asp, but I dont know how to request for the data in asp,
This is my AScode:
Code:
var myLv:LoadVars = new LoadVars()
myLv.vr1 = vr1
myLv.vr2 = vr2
myLv.vr3 = vr3
myLv.zenderNaam = naam_txt.text
myLv.zenderEmail = email_txt.text
//
myLv.send("wedstrijd.asp","_blank","POST")
Anyone knows to call for these in asp?
thnxs!
Using Loadvars.send
Just wondering, if I have a text file with say... line1= &line2= &line3= etc, and I want to make a flash file with a button that will input stuff into this text file, what code will I need to use??
Tracing LoadVars.send?
Hiya,
Can anyone tell me if there is a way to trace the whole http header that is being sent on myLoadVars.send?
I'm simply sending the contents of 8 textfields out to an asp script...except it's not working!
------------------------------------------------------
on (press) {
header = new LoadVars();
headerstr="lable1="+_root.firstname+
"&lable2="+_root.lastname+
"&lable3="+_root.address1+
"&lable4="+_root.address2+
"&lable5="+_root.address3+
"&lable6="+_root.postcode+
"&lable7="+_root.emailad+
"&label8="+_root.age;
header = headerstr;
header.send("http://www.nslaved.com/contact.asp" ,POST);
}
on (release) {
gotoAndStop(2);
}
----------------------------
Any help would be great!!!!!!!!!!!!
LoadVars.send Enigma
Hello,
Has anyone got any ideas re this...
I can't get the LoadVarsObject.send method to call an asp script without the browser leaving the movie and hanging up on a blank page.
It HAS sent the variables but it's waiting to download nothing!
I thought that by omitting the second parameter (i.e.,target) then the server's response would be discarded - y'know...like it says in the 'HELP" files (?!?)
I'm tearing my hair here
yours with lovely bloodshot eyes,,
Scott
//code//
on (press) {
header = new LoadVars();
header.lable1 = textfields.firstname;
header.lable2 = textfields.lastname;
header.lable3 = textfields.address1;
header.lable4 = textfields.address2;
header.lable5 = textfields.address3;
header.lable6 = textfields.postcode;
header.lable7 = textfields.emailad;
header.lable8 = textfields.age;
}
on (release) {
headerstr = "http://www.nslaved.com/contact.asp";
header.send(headerstr,"","GET");
header.onLoad = function(success) {
if (success) {
output = header;
}
};
}
Problem With LoadVars.send()
Simple problem but potentially crippling...
I'm trying to send large amounts of POST data from my SWF to a PHP script using the send() method of the LoadVars object. When executing the script everytnig goes well (that is, my data successfully gets sent to the PHP script) except that after some arbitrary amount, the data gets cut off.
For example, if I send 200 characters, all characters will successfully be sent to the PHP script. However, if the number of characters bring sent from the SWF exceeds say, 500 characters, the PHP script will only recieve about 450 of them.
Initially I thought this might have something to do with the configuration of my Apache server but it would seem that by default, the maximum amount of POST data that Apache will process is set to unlimited.
My next thought was that Flash was sending data sing the GET method, which aparently caters to a maximum of 250 characters at once, but the documentation insists that the send() method uses the POST method unless otherwise directed. This is not to mention that I am in fact explicitly including the "POST" argument when calling the send() method.
As a final note, it seems strange that even though the documentation insists that send() uses the POST method to send data, the PHP $_POST array is empty when examined after data was sent from the SWF to the script. Very strange indeed...
So here I am now, looking for answers and it would seem that I can't find any solid answers to this problem of mine. Any help/suggestions would be greatly appreciated.
Best,
Ptolemy
Problems With LoadVars.send()
Hi I'm using the following script in my *.fla file
on (press){
_root.objLoad = new LoadVars();
_root.objLoad.FirstName = "name1";
_root.objLoad.LastName = "name2";
_root.objLoad.send("URL/login.asp");
}
and the following code in my *.asp file
<%
Dim fName
Dim lName
Dim DB
Set lName = Request("LastName")
Set fName = Request("FirstName")
Set DB = Server.CreateObject ("ADODB.Connection")
DB.Mode = adModeReadWrite
DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +"D:InetpubwwwrootStudents.mdb")
Dim RS
Set RS = Server.CreateObject ("ADODB.Recordset")
RS.Open "Students", DB, adOpenKeyset, adLockOptimistic
RS.AddNew
RS("FirstName") = fName
RS("LastName") = lName
RS.Update
%>
When I use the *.asp code with HTML form it works fine but when I use it with Flash it doesn't.Also when I use load instead of send the script writes blank line in my DataBase.
Can anyone tell me what's wrong
p.s. When I use the GET method it works too. So can anyone tell me how to use the POST metod with flash ???
Trouble With LoadVars.send
I'm having a little trouble with basic LoadVars.send in MX.
I'm just sending a variable to a database.
If I open a new window:
saveLoadVars.send("update.cfm","_blank","post")
everything works fine but I'd prefer not to open a window, I'd prefer to send my variables to a page that doesn't appear onscreen and allow my flash app to just keep running).
But if I just send the variables without specifying anything else:
saveLoadVars.send("update.cfm")
It doesn't write to the database (I have a second window open where I can monitor this).
I know this is a really basic thing to do, and I can't figure out what I'm doing wrong.
Any help would be appreciated.
LoadVars.send() Not Working
i have been able to get this to work using the geturl() but not with the loadvars object. trace prints what i would expect to see.
here is the code in my flash button.
code:
on (release) {
submit = new LoadVars();
submit.returnAddress = txt1.text;
submit.messageBody = txt2.text;
if (submit.returnAddress.length && submit.returnAddress.indexOf("@") != -1 && submit.returnAddress.indexOf(".") != -1 && submit.messageBody.length) {
sumbit.send("http://www.webaddresshere.com/submit.php","_blank","POST");
trace(submit);
}
}
and my php
PHP Code:
<?php
$toAddress="john@someaddress.com";
$subject="Message From Website";
$returnAddress=$HTTP_POST_VARS[returnAddress];
$message=$HTTP_POST_VARS[messageBody];
mail($toAddress, $subject, $message, "From:$returnAddress
");
?>
[CS3] LoadVars.send Question
Hi, I have for the first time made a form in Flash! (shows what a nub I am I guess)
Got everything working with my cgi script nicely, but to make it better I would like to control the pop-up window size I have that displays the positive or negative response returned by the cgi script.
I have tried using the regular javascript code that you would use for the getURL method, but this seems to make my cgi script not work by possibly altering the formdata that is being sent.
here is the code I am using currently which just opens up a "_blank" window:
Code:
this.submit_btn.onRelease = function() {
var formdata:LoadVars = new LoadVars();
formdata.entryname = entryname_txt.text;
formdata.address = address_txt.text;
formdata.postcode = postcode_txt.text;
formdata.email = email_txt.text;
formdata.telno = telno_txt.text;
formdata.mobno = mobno_txt.text;
formdata.hearts = hearts_txt.text;
formdata.send("http://www.highchelmershopping.co.uk/valentinesurprise/valentineentry.cgi","_blank","POST");
};
and this is the code I tried to use to open a sized window with javascript
Code:
this.submit_btn.onRelease = function() {
var formdata:LoadVars = new LoadVars();
formdata.entryname = entryname_txt.text;
formdata.address = address_txt.text;
formdata.postcode = postcode_txt.text;
formdata.email = email_txt.text;
formdata.telno = telno_txt.text;
formdata.mobno = mobno_txt.text;
formdata.hearts = hearts_txt.text;
formdata.send("javascript:NewWindow=window.open('http://www.highchelmershopping.co.uk/valentinesurprise/valentineentry.cgi','newWin','width=300,height=250')","","POST");
};
I guess it could just be a syntax problem, but the response this gives me is that the new window opens at the correct size, however the cgi script always returns a negative response (i.e. a response that it gives when not all fields have been completed correctly) even when the form has been correctly completed and the same data returns a correct response with the _blank method.
While I wait for someone to respond to this I will see if I can work out how to alter my cgi script to return a the boolean values for using LoadVars.sendAndLoad instead, as I guess that would be a more elegant solution should I be able to get that to work.
LoadVars.send()with No URL-8 Encoding
I am sending a form via LoadVars.send I have three variables that I am sending here is my code:
Code:
awardData.EDIT_AWARD = "http://www.editAwardSite.com";
awardData.ON_COMPLETION = ON_COMPLETION_URL;
escape(awardData.EDIT_AWARD);
awardData.Award = productNumber;
awardData.send(submitURL, "_blank", "GET");
The code is then sent to the appropriate URL, but it URL-8 encodes it. When the server receives the information it chokes on the passed info. It doesn't like having the underscore in the variable changed to %5F and the string within the variable (which happens to be a URL) changed to URL-8.
I have attempted to escape the string, but it doesn't work.
Is there a way to tell the LoadVars.send object NOT to use URL-8 encoding?
LoadVars Send To FormMail
I am trying to send a simple for to email using the FormMail program. However, the LoadVars object is converting the recipient email address to encoded characters (ie. myFUD%40octanner%2Ecom). I cannot find a setting in Flash nor method in the LoadVars object to not change the characters so that it does not encode those characters. Everything else is working. If I manually change the URL in the address bar and replace the encoded characters with the appropriate characters (@, ., etc), it works fine. I am stumped. How do I make it work?
LoadVars.send To A PopUp
Hi Folks,
I have an "Add to Cart" button in my Flash application and right now I have it running a LoadVars.send in an ActionScript to send the variables to a PHP file for further processing. Everything seems to be working but I'm trying to get the PHP file to load in a small HTML popup window (it's just a confirmation window). Does anyone know how to do that? My code looks something like this:
Code:
on (release) {
var my_lv:LoadVars = new LoadVars();
my_lv.BoxColor = boxColor;
my_lv.Font = fontVar;
my_lv.Text = typingtxt.text;
my_lv.ProductID = "bar-"+styleVar;
my_lv.send('confirm.php',"_self", "POST")
}
I tried to do something like this but it didn't work, obviously
Code:
my_lv.send(window.open('http://www.carvedsolutions.com/flash/confirm.php','_blank','toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=100,height=100,left = 462,top = 334'), "_new", "POST")
Please don't flame me. I'm a PHP programmer trying to work with someone else's Flash/ActionScript application. Thanks!
Warm regards,
James
Weird Loadvars Send
i has one TEXT INPUT with variable "sendsend".
if i input the string like "test 1 2 3"
with this code:
Code:
_root.button.onRelease = function(){
var c = new LoadVars();
c.varsend = sendsend;
c.send("flash.php","_self","POST");
}
i get all this text in flash.php when i make this echo $_POST['varsend']:
Code:
<TEXTFORMAT LEADING="2"><P ALIGN="CENTER"><FONT FACE="verdana" SIZE="10" COLOR="#FF0000" LETTERSPACING="0" KERNING="0">test 1 2 3</FONT></P></TEXTFORMAT>
why?
LoadVars.send() Not Working
here my code
var sendData:LoadVars = new LoadVars();
sendData["dataID"] = "MyDataID";
sendData.send("http://www.mydomain.com/submit.php", "_self", "POST");
when i'm running the swf and the php on same server, everythings ok.
once i'm moving the swf into another server with difference domain name
images.mydomain.com (where the swf locate)
www.mydomain.com (where the php page locate)
i call the LoadVars.send() with provide it absolute path to www.mydomain.com,
but there nothing happen when i press the button.
but it work if i place my swf in www.mydomain.com
any idea?
thanks a lot
Can't Send An Email Using ASP And LoadVars()
Hello,
I am trying to send an email after user inputs there information in a flash form. Everything seems to work a fine and the email sends off but only if i have hardcoded an email address in the "mail.From" in asp. I need it to collect the email address from the flash form (which it is doing because in the body i use the email variable and it sends the data fine), but for some reason when i put the variable name in the "mail.From" it doesn't send the email. Here is the code I am currently using:
////////////ASP
<%@language="VBSCRIPT"%>
<%
firstName = Request("fname")
lastName = Request("lname")
email = Request("email")
events = Request("events")
guests = Request("guests")
body = firstname & " " & lastname & " would like to be on the guestlist for "& events & " for " & guests & " people, email: " & email
Response.write(email)
Response.write(firstName)
Response.write(lastName)
server.ScriptTimeout = 300
Set myMail=CreateObject("CDO.Message")
myMail.Subject="sent from flash form"
myMail.From="admin@hotmail.com"
myMail.To="sogood@hotmail.com"
myMail.TextBody=body
myMail.Send
set myMail=nothing
Server.ScriptTimeout = 90
%>
///FLASH ACTIONSCRIPT
function sendForm() {
form = new LoadVars();
form.fname = fname.text;
form.lname = lname.text;
form.email = email.text;
form.events = event_input.getValue();
form.guests = guest_input.getValue();
form.sendAndLoad("contact/guestlist.asp" ,form, "POST");
_parent.gotoAndPlay("thank");
}
LoadVars.send() Asynchronous?
Does anybody know if LoadVars.send() is asynchronous? I can't find it documented anywhere. sendAndLoad() is asynchronous, but that's (at least) because it has a load() method in there. I assume that send() is asynchronous, but it returns a 'success' value. At first glance, I'd assume it couldn't return a success value if it were asynchronous, but at second glance it might be that the success value is simply whether or not the variables were sent or not. Anybody know if send() is asynchronous?
If it is asynchronous, I guess I'd have to use sendAndLoad() in order to find out when the variables went through.
Using LoadVars To Send Data?
I have some data which I am gathering throughout a program into an object that I want to send to an ASP page. I've heard that I can use a LoadVars object to send the data, but I've only used it to load data from another file. Do I have to separate out all the different data in the object into a query string before using the LoadVars object, or can the LoadVars object split everything out into the name-value pairs on its own?
Chris
Flash To PHP Using LoadVars.send
For the life of me, I've tried everything:
I've researched LoadVars on Adobe forum, used David Powers' books, googled 'flash to php', LoadVars, etc. and tried sendAndLoad, send, and using $_POST, $_GET, $_REQUEST. $HTTP_POSTVARS but I keep getting this same error. any advice please?
I have a Unix server running Apache/PHP 4 - LoadVars worked to load name-value pairs into an array -see thread)
My goal with this simple app is to prototype being able to pass a variable from flash to a variable in php.
Parse error: syntax error, unexpected T_VARIABLE in flash_to_SQL.php on line 5
Actionscript 2.0 code:
var c :LoadVars = new LoadVars();
c.testing = "123FOUR";
c.send ("
LoadVars Send Problem
I am struggling with what appears to be the simplest thing.
Please tell me why my highscores.php file doesnât open with â?playerscore=5413&playername=Rowanâ after it.
When tested in a browser or on my local server, it outputs like this: âhttp://localhost/GameTest/highscores.phpâ
When tested from Flash (ctrl+Enter), it works perfectly. My browser opens and displays: â///D:/Work/GameTest/highscores.php?playerscore=5413&playername=Rowanâ in the address bar.
What am I missing here? I used Dreamweaver to create the HTML file.
(Please download sample files here )
I am using CS3 but file must be published as v6.
Edited: 03/25/2008 at 03:25:24 AM by rwittels
Trouble With LoadVars.send
I'm having a little trouble with basic LoadVars.send in MX.
I'm just sending a variable to a database.
If I open a new window:
saveLoadVars.send("update.cfm","_blank","post")
everything works fine but I'd prefer not to open a window, I'd prefer to send my variables to a page that doesn't appear onscreen and allow my flash app to just keep running).
But if I just send the variables without specifying anything else:
saveLoadVars.send("update.cfm")
It doesn't write to the database (I have a second window open where I can monitor this).
I know this is a really basic thing to do, and I can't figure out what I'm doing wrong.
Any help would be appreciated.
LoadVars.send Question
Hi Kirupans,
I'm trying to use the send method of a LoadVars object to track statistics via a PHP script, but I have a small problem. Everything works fine when I specify a target in the send method, i.e.:
statsVars.send("write_stat.php", "_blank");
But nothing happens when I don't specify a target window. Now obviously I need the statistics tracking to be invisible, so I can't have another window opening up or the window changing to a php page. So is this possible? My understanding from the documentation is that the send method should work regardless.
If you have any information about this, please let me know! Thanks so much!
Trouble With LoadVars.send
I'm having a little trouble with basic LoadVars.send in MX.
I'm just sending a variable to a database.
If I open a new window:
saveLoadVars.send("update.cfm","_blank","post")
everything works fine but I'd prefer not to open a window, I'd prefer to send my variables to a page that doesn't appear onscreen and allow my flash app to just keep running).
But if I just send the variables without specifying anything else:
saveLoadVars.send("update.cfm")
It doesn't write to the database (I have a second window open where I can monitor this).
I know this is a really basic thing to do, and I can't figure out what I'm doing wrong.
Any help would be appreciated.
Help With Send(), SendAndLoad() Or LoadVars Please?
Hi, I have a form set up in flash pointing to a PHP script on my webspace.
I checked the PHP script and when viewed in a browser it returns the parameters OK so I presume it is working.
My problem is the variables captured by user input are not being sent to me.
Please can anyone check my actionscript below for errors.
I have tried send() and sendAndLoad() so I feel I may have an issue with my LoadVars.
Thanks in advance.
stop();
var fullName:TextField;
var fullAddress:TextField;
var postcode:TextField;
var telNumber:TextField;
var emailAddress:TextField;
fullName.restrict = "A-Za-zĂĂĄĂĂ©ĂȘĂĂãÔç ";
fullName.maxChars = 40;
fullAddress.restrict = "0-9A-Za-zĂĂĄĂĂ©ĂȘĂĂãÔç!?.+- ";
fullAddress.maxChars = 90;
postcode.restrict = "0-9A-Za-zĂĂĄĂĂ©ĂȘĂĂãÔç!?.+- ";
postcode.maxChars = 10;
telNumber.restrict = "0-9A-Za-zĂĂĄĂĂ©ĂȘĂĂãÔç!?.+- ";
telNumber.maxChars = 20;
emailAddress.restrict = "0-9A-Za-zĂĂĄĂĂ©ĂȘĂĂãÔç!?.+- ";
emailAddress.maxChars = 50;
function sendEmail(fullName, fullAddress, postcode, telNumber, emailAddress)
{
var myData:LoadVars = new LoadVars();
myData.fullName = fullName.text;
myData.fullAddress = fullAddress.text;
myData.postcode = postcode.text;
myData.telNumber = telNumber.text;
myData.emailAddress = emailAddress.text;
}
this.submitButton.onRelease = function()
{
if (fullName.text == "" || fullAddress.text == "" || postcode.text == "" || telNumber.text == "")
{
gotoAndStop("error");
}
else
{
sendEmail();
gotoAndStop("correct");
}
myData.send("http://www.mywebsite.co.uk/iopost.php", "POST");
};
LoadVars & Send Question
Good day.
I'm trying to pass a few variables from Flash combo box components to an existing URL from elsewhere. I was able to pass the variables fine when there were matching boxes with same instance names, but in this particular case I have to include the variables from Flash inside the search thread of the URL. Here's an example.
I have 3 combo boxes, theDay, theMonth, and theYear. Let's say the existing URL search thread is supposed to be:
http://yourdomain/foldername/0,11111,27-3-6,00.html
where 27-3-6 part is supposed to be the day, the month, and the year.
In JavaScript, a function is setup to read the variables from HTML's combo boxes and plug into a JavaScript funtion in such ways:
window.open("http://yourdomain/foldername/0,11111," + theDay + "-" + theMonth + "-" + theYear + ",00.html" + "");
How would I do this?
Anyone???
|