Home Tutorials Forums Articles Blogs Movies Library Employment Press

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 11-28-2003, 12:54 PM   #1
Averroes
Member
 
Join Date: Oct 2003
Location: Paris, FRANCE
Posts: 69
Lightbulb loadVars.send without the 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("Aurora.php", "_blank", "POST");
or myVars.send ("Aurora.php", "", "POST"); gets me the same pop up window.

Any further help greatly appreciated.

Thanks
__________________
Wild & Innocent
Averroes is offline   Reply With Quote
Old 11-28-2003, 02:04 PM   #2
McGiver
Goldmember
 
McGiver's Avatar
 
Join Date: Feb 2003
Location: bavaria in germany
Posts: 1,627
Default

Loadvars isn't supposed to produce a popup. I think it is a problem with your php

myVars.send ("Aurora.php") should work

Last edited by McGiver; 11-28-2003 at 02:07 PM.
McGiver is offline   Reply With Quote
Old 11-28-2003, 02:27 PM   #3
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

If I remember correctly, that send() function has a bug(?) that opens new window... So, I normally use sendAndLoad() function and have the PHP return a dummy string back to Flash so that I can know that the script has been executed...

Oh... I didn't know if it was in 2004 forum... I do not know if that has been fixed or not, but I guess that's the way it is since you asked that question...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 11-28-2003, 02:47 PM   #4
marius
Registered User
 
Join Date: Feb 2003
Location: Bucharest, Romania
Posts: 76
Send a message via Yahoo to marius
Default

maybe i am misunderstanding the issue... but for me the loadvars.send always brought up a popup.

so what i saw as a way of solving the problem was loadvars.load(myurl) where myurl is something like
myurl=www.site.com/page.php?var1=bla&var2=bla

and this always did the trick for me...
marius is offline   Reply With Quote
Old 11-28-2003, 02:51 PM   #5
Averroes
Member
 
Join Date: Oct 2003
Location: Paris, FRANCE
Posts: 69
Default

Thank's for your quick answear !
Unfortunetly I have already tried that solution but it's not working. I'm not receiving any email ...

I have attached my code to make sure you have all parameters !

---------------
...
// this is not an instance button
userData = new LoadVars();
userData.company = company.text;
userData.email = email.text;
// Test of the v2 components
if (company.text eq "" or email.text eq "") {
stop();
} else {
userData.sendAndLoad("ContactC.php", 0, "POST");
gotoAndStop(2);

...
--------------------

Thank you again for your valuable time !
__________________
Wild & Innocent
Averroes is offline   Reply With Quote
Old 11-28-2003, 03:00 PM   #6
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Yes... That will do the job as well, marius...

Averroes... Your sendAndLoad(0 line should be like this...
ActionScript Code:
userData.sendAndLoad("ContactC.php", userData, "POST");
Have your PHP just echo out the text file for the incoming variables rather than running the mail() funciton to make sure that you are getting the variables right from the Flash...
Maybe you might want to post your PHP script as well if you still cannot fix it...

[useastags]
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Old 11-30-2003, 10:48 AM   #7
splict
spend my time in blender
 
splict's Avatar
 
Join Date: Oct 2003
Location: tampa, fl
Posts: 1,138
Default

Averroes,
Note: I am using Flash MX
I have been having the same problem as you over the last couple days and saw this thread while searching for a solution. In your first post you did not mention passing the loadVarsObject name like CyanBlue suggested later. this combined with sendAndLoad finally worked for me. example:
ActionScript Code:
loadVarsObject.sendAndLoad("mailer.php", loadVarsObject, "POST");
The solution I was previously using was similar to what marius suggested, however, I utilized the toString method to make things easier for me. The following uses the names of files etc that were in my project.
ActionScript Code:
formVariables = formData.toString; formData.load("php/dream.php?"+formVariables);
I've learned you have to be extra careful when using loadVars methods along with php's mail function. they often don't want to play nice together.

-splict

On a side note: Wow, my first post. Btw, Thanks CyanBlue - you are often the reason why I find my answers without having to post.
splict is offline   Reply With Quote
Old 11-30-2003, 11:10 AM   #8
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Thank you for the helpful information, splict...

Me the reason for not wasting your time??? Then, Um, I'll have to charge you... Wire me 2 cents to my secret Swiss bank account ASAP...

Glad to hear that somebody find that one useful...
I might do some update later if I have time and if I get 2004... No promise on that though...

Just got curious though... You mentioned that LoadVars doesn't get along with the PHP's mail() function... Can you be abit more specific on that???
CyanBlue is offline   Reply With Quote
Old 11-30-2003, 12:09 PM   #9
splict
spend my time in blender
 
splict's Avatar
 
Join Date: Oct 2003
Location: tampa, fl
Posts: 1,138
Default

By the way I forgot to mention to make sure all $_POST lines are changed to $_GET in the php file if the 2nd (formData.load) method is used.

CyanBlue: Money's on the way

What I meant by them not getting along isn't that they don't work right - they do of course. The problems are that when sending/loading external variables, etc. I could get away with code that would work fine. However, with mail() in the php file, it would either not send the mail or it would but it wouldn't have the sent variables.

I would then have to go back and make my code more proper (read: correct) to get it to work. If I can go back and replicate the problems later today I will do so and post a sample.

-splict
splict is offline   Reply With Quote
Old 11-30-2003, 01:10 PM   #10
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

Quote:
it would either not send the mail or it would but it wouldn't have the sent variables.
Ah... I see... Yeah... As a matter of fact, I've read several threads that goes with mail not working properly...
But all of them turned out that they were not using proper syntax to get the mail working...
If I remember correctly, it wasn't the issue of LoadVars() and mail() specific error though...

Money's on the way??? Yeehaa... I probably can buy another computer before I die...
CyanBlue is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:11 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.