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




AS1 - LoadVars.send Method Does Not Work In Browser



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 my 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?

(Please see attached files)
I am using CS3 but file must be published as v6.















Attached Files



Ultrashock Forums > Flash > ActionScript
Posted on: 2008-03-25


View Complete Forum Thread with Replies

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

Flash LoadVars.send Method
I'm sending three variables from Flash to a database using the LoadVars.send method. My code to send the variables is:

coordinates.send("coordinates.asp", "post");

Even though there is no '_target' it still opens the results in a new window.

Is there any way to stop it from doing this?

[F8] Send Method - It's Me Or It Really Doesnt Work Right?
Hey there!

Well, I really get upset and feel stupid when something aparently simple doesnt work, despite I do exactly the same way as the Help example tells me to do.

I just need to move to a new PHP page after to click a button in Flash while I pass a few variables by POST method. Ok, the Help example 'teaches' me to do like showed below, I did, but it just doesnt work right. I would like to know if it's me or if it really doensnt work as it should!

code:
on (release)
{
dataSender = new LoadVars();
dataSender.myvar = 10;
dataSender.send("http://www.mydomain.com/myscript.php","_self","POST");
}

The problem is that it just keep sending var by GET method (attached to the URL).
What am I doing wrong????

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

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");

Help, Method Wont Work Properly In Browser
Last edited by rcairns : 2006-04-30 at 07:30.
























Hi,

I've written a class for loading in images.

One of the methods takes the loaded image and creates a bitmapfill from it.

This method works when I'm testing the movie, even when I do an html preview locally. But when I load it up to my webserver (+html file). The method does not work! Ahh, I'm tearing my hair out with this! I've not got a clue why it does not work...

The Method is below:

ActionScript Code:
public function createBackground(xSize:Number, ySize:Number):Void
    {
                
        //Position holder_mc (which was created by the class when it loaded the image)
        holder_mc._x = 0;
        holder_mc._y = 0;
        //Create new BitmapData with the size of mc1 and transparentx pixels
        var backgroundbmp:BitmapData = new BitmapData(holder_mc._width, holder_mc._he
ight, true, 0x00FFFFFF);
       
        //Make this new BitmapData object from holder_mc
        backgroundbmp.draw(holder_mc);
       
        with (holder_mc) {
            beginBitmapFill(backgroundbmp);
            moveTo(0, 0);
            lineTo(0, ySize);
            lineTo(xSize, ySize);
            lineTo(xSize, 0);
            lineTo(0, 0);
            endFill();
        }
       
    }


I've ran out of idea's to try and fix it.

Does anyone know why this is? Or had a similar problem?


Ross

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

How To Send To Send An Action Between Browser Frames
my doubt may look silly. but pls help me.

I have a left frame with a swf movie containing buttons. And when when I click the buttons I want the movie in the right frame to go and play a particular frame.

how do I do this?

Send() Method
i have an swf embedded in an html and on that swf i have a button instance.. that button has


ActionScript Code:
on(release){
lv = new loadVars();
lv.somevar = 'var';
lv.send('file.php','_self','post');
}


on the file.php, i echo out


PHP Code:



$_SERVER['HTTP_REFERER']; 




;

on firefox i get the referer, on ie i dont..

why is this so? any ways around it ?

XML Send Or Load Method?
I am trying to set up an online quiz in flash mx with the questions delivered by xml file - so that the client can quickly update them without having to re-write the swf. Can anyone help or suggest any online tutorials that might be of use? Basically the quis is currently set up so you click on a button and a question appears via actionscripting out of the swf
Thanks
M

LoadVars Has A Dud Method
I've spent way too much time trying to get the loadVars.send method to work, it seems it will only pass vars if I post it to a new window, any attempt to send vars with out opening a new browser window did not work!

I was able to finally send vars using the sendAndLoad method, it send in the backgroud fine, then I just take the vars it returns and delete them, this is a crappy work around, has anyone else had this problem


MyVars.send("http://www..."); // does not send vars
myVars.send("http://www...", "POST") // no good eighter
myVars.send("http://www...","_blank", "POST") // works but opens a new window?

LoadVars Method
Hi all

I'm trying to use the LoadVars method to load some text from a file.txt into a textbox

textbox has variable 'text' attached to it

textfile has: &text=blah blah...

here's my code:

onClipEvent (load) {

// create loadVars object
myData = new LoadVars();

// load data
myData.load("file.txt");
}

I can output the text using trace, but i can't get the text to load into the textbox (?)

* this is what I used before (and it works):

LoadVariables("file.txt", this);

but I want to use the newer method

any help is welcome

LocalConnection.send Method Arguments
Hi,

I wonder if the send method of LocalConnection only supports strings.
I've been trying to send object instances of my own class but all
the properties are "undefined" on the other end. It works if i send
each property as a string and as a separate argument though.
Is it a different procedure for sending complex objects as
opposed to strings?

/ Thanks

Special Chars & Xml Send Method
I'm sending an xml file from flash to php, so php can save it to the servers filesystem.
It works great, except when there's a node with a special char like a quote in it.

My actionscript code is like this:

Code:
xmlExport.xmlDecl = "xml=";
xmlExport.sendAndLoad("xmlexport.php", xmlExportStatus);
And my php code is like this:

PHP Code:



fwrite($handle, stripslashes(urldecode($_POST['xml']))); 




Both somewhat simplified, but this is what matters I think.
I'm not sure about the urldecode part, but I've got this problem always, no matter if I use it or not.

I've traced the xml object, and I see that the quote is converted to ' then. That's great, but when php writes it, it stops there, so I end with only half of an xml file.

Using The Post Method To Send Vars To Php Actually Sends Get ?
Ok i have a site where people can send large amounts of text through to a mysql db from flash it goes from flash to php to mysql. here is the flash code

Code:
var senderLoad = new LoadVars();
sender.onRelease = function()
{

senderLoad.theName = testiname.text;
senderLoad.theEmail = testiloc.text;
senderLoad.theMessage = testimsg.text;
senderLoad.objtype = "testimonial";
trace("Sending... " + senderLoad.theName + " " + senderLoad.theEmail);
senderLoad.send("sendflash.php",senderLoad,"POST");



}
Now this all goes to the sendflash.php which gets the variables using the $var=$_GET['theName']; etc. Yes that is Get but in my code i have POST for some reson it is not sent POST ?? but get i can see it in my browser after i hit the sender button it makes all the vars go into the url. Why dose it do this ? as you all already know sending large amounts of text through the get method is not a very good way to go about things anyone know why this code works this way ? I have tried putting get into the actionscript and i think if memory serves it didnt post anything ??
thanks in advance

oh if it helps the original tutorial where i got this code was from gotoandlearn it had a senderLoad.sendAndLoad("sendflash.php",receiveLoad ); this dose not even pass the variables for some reason i even tried all the original code with the original php file he supplied in the tutorial and it just sent blanks to php. It was a send email form so i made it work the only way i could get it to and made it into a insert message to db form.

Send Method In SharedObject Is Block Or Unblock?
send method in SharedObject is block or unblock?
is it the same in local mode and remote mode ?
thx a lot.

How To Get And Send Values In AICC - HACP Method
I am new to AICC. Is anybody know how to get and send values in AICC - HACP method ?

LoadVars POST Method Not Working?
I'm trying to use the POST method of the LoadVars object, but it don't seems to work


Code:
var source = '<dock><height>25</height><cube><x>0</x><y>0</y></cube></dock>';
var dock_lv = new LoadVars();
dock_lv.dockXml = source;

dock_lv.send("http://localhost/CanDock/setDock.asp", "_blank", "POST");
It always seems to send it using the GET method. It shouldn't be a problem (it's not confidential data), but it seems there a limit on the amount of caracter I can send using the GET method (I usally used the POST method, so I never experienced this before).

Anyone can help ?

CFK

[F8] LoadVars/PHP Problem - SendAndLoad Method
I'm trying to send variables from a Flash movie to a PHP script and just can't get it to work.

Say I have a LoadVars object called myVars, and I'm assigning variables to it in the following way;
code:
myVars.val1 = value;
myVars.val2 = value;

...and so on. I then attempt to send these values to a PHP script as follows:
code:
myVars.sendAndLoad("myscript.php");

As I understand it, my variables should then be available to the PHP script via the $_POST array, but this isn't working. Does anyone have any ideas?!

Problem With LoadVars LoadAndSend Method
Hi...

I am having a small problem...

I am using the following code to send the text generated in a dynamic text box to myself in an email:

this.submit_btn.onRelease = function() {
var emailResponse:LoadVars = new LoadVars();
emailResponse.onLoad = function(success:Boolean) {
if (success) {
debug_txt.text = "your poem has been submitted";
} else {
debug_txt.text = "there has been an error";
}
};
var email:LoadVars = new LoadVars();
email.recipient = "contact@fourinchesofego.com";
email.subject = "new_ann_coulter_poem";
email.themessage = poem_txt.text;
email.sendAndLoad("

Problem With LoadVars In A Class Method
Hi, this is my first post here.

I have been going totally crazy with this problem since yesterday and I hope someone here can help me with this.


I am writing a custom class called diagram and I have a method called readDiagramTextFile() which reads from a text file (path passed as a parameter to the method) and returns a variable read from the text file. I'm using LoadVars for this. Here is the code for the method:


Code:
function readDiagramTextFile(filePath:String):String{
var diagramLV:LoadVars = new LoadVars();
var returnText:String;

diagramLV.onLoad = function(success:Boolean){
if(success){
returnText = this.variableName;
trace(returnText);
} else {
trace("Error while loading the text.");
}
}

diagramLV.load(filePath);

trace(returnText);
return returnText;
}

I want this method to return the value of the variable from the text file. However it is not working as it should. The onLoad() gets executed after the "return" statement, hence the function ends up returning an empty string.

The first trace (inside the onLoad) returns the text I want but the second trace (above the return) gives "undefined".

Is there any way to make sure the load is complete before I return the value? Is this a problem with scope? It's driving me crazy and I have already spent almost 10 hours trying various things getting this to work!

Any help will be greatly appreciated!

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??

Send Data Usig POST Method But In NON Unicode
system.useCodepage is for text files
I want something like this sending data using POST.
I know how to do in HTML form, but how does it look in FLASH?

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?

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