Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-09-2004, 06:40 PM   #1
OneSeventeen
New User
 
Join Date: Apr 2004
Location: Albuquerque, NM, USA
Posts: 28
Default Sending POST data to another window

Right now I'm doing the following to post to a shopping cart for paypal:
PHP Code:
p= new LoadVars();
p.cmd="_cart";
p.business="[email protected]";
p.item_name="T-Shirt";
p.item_number=sid+_root.size+_root.current_color;
p.amount=_root.theprice;
var 
add_var="add";
p[add_var]=1
p
.send("https://www.paypal.com/cgi-bin/webscr""paypal"POST); 
and the way it works is paypal wants their window to stay open all the time, because every time I add something to the cart and click "continue shopping" it simply sets the focus to the parent page.
I figured the send() would send the post data to the "paypal" window, as specified in the function arguments, but instead it appears as though it tests to see if the window is open, and if it is, it doesn't do anything....
If I close the paypal window and use the flash function to add another item it works perfectly, but not everyone going to the site knows this.

Is there anyway to have 2 windows open and have the flash window post into another window?

Window "foo":
[flash animation with 'add to cart' button submitting to "bar"]

Window "bar":
[paypal site waiting to receive more items to be purchased by "foo"]

You can see an example at http://www.wumk.com/shirt/9760002/xxl
(Disclaimer: I don't personally care for the site and wouldn't go there if you are easily offended like I am)

Just try to add the same item to your cart two or three times without closing the paypal window, if you can.

Last edited by CyanBlue; 05-10-2004 at 03:35 PM. Reason: PHP tag is applied
OneSeventeen is offline   Reply With Quote
Old 05-10-2004, 01:16 PM   #2
Slowburn
[Invent:Design:Create]
 
Join Date: Sep 2002
Location: Toronto, ON
Posts: 2,068
Default

instead of doing it this way, could you not just have the person add the items to the cart without leaving Flash...then once the user is done "shopping" they could hit a button to checkout. this would forward all the items they have bought to that window. This way, the user won't have many wiondows open at one time. I know that is annoying for me.
__________________
o Please do a search before you post
o Please use the [ as][ /as] tag for your code (so we can read it clearly)
Slowburn is offline   Reply With Quote
Old 05-10-2004, 01:32 PM   #3
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 26,666
Default

What Slowburn said is pretty much how those PayPal components are handling the job... You take care of all the transaction until the user checks out the cart and send out the all the information to PayPal to process...
__________________
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 05-10-2004, 01:59 PM   #4
Slowburn
[Invent:Design:Create]
 
Join Date: Sep 2002
Location: Toronto, ON
Posts: 2,068
Default

Cheers for making that more clear. :P
__________________
o Please do a search before you post
o Please use the [ as][ /as] tag for your code (so we can read it clearly)
Slowburn is offline   Reply With Quote
Old 05-10-2004, 03:22 PM   #5
petefs
Fried Onions
 
petefs's Avatar
 
Join Date: Apr 2004
Location: Chicago, IL
Posts: 1,328
Send a message via AIM to petefs Send a message via MSN to petefs Send a message via Yahoo to petefs
Default

I agree with cyanblue/slowburn.

For posterity, though, I came across this when developing a content server that uses multiple windows with localconnections to communicate. The concept is that only one of the three windows needs to be open for the application to continue working. 1) content browser, 2) playlist, 3) player/display. To detect when windows were opened or closed and whether or not to focus them or reposition them I found that using fscommand was my best bet. All window opening/closeing is handled by js commands initiated by flash. If their suggestions just don't do it for ya, that's your best bet ^_^
petefs is offline   Reply With Quote
Old 05-11-2004, 10:05 AM   #6
OneSeventeen
New User
 
Join Date: Apr 2004
Location: Albuquerque, NM, USA
Posts: 28
Default

I think I might look into this fscommand thing, because the only problem I'm having with the external window is that the user will use the flash animation to determine the color of their shirt, add it to the cart, then they may want to go to the home page again and select another slogan, choose another shirt, and add that item to the cart as well, so they won't be staying on the same flash script the whole time.
I'm looking into having PHP add the items to the cart, and let flash say "added to cart" or something, then fade it out, if the item was successfully added. Then PHP would be doing all the cart work, and hopefully wouldn't need to open up a new window.

I just really don't want to develop a new shopping cart when I can just use paypal's.
OneSeventeen 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 09:29 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.