Reply to topic
Passing data from a Flash MX array to a Cold fusion MX page
dzyne02


Joined: 27 Jun 2004
Posts: 1
Location: UK
Reply with quote
Hi

I want to pass data from an Array built in flash to a cold fusion page, which then emails the information to a specified email address.

Im using Studio MX 2004 Professional

Currently, the flash action scripting frame looks like this:-

var sender = new LoadVars();
submit_pb.setClickHandler("submitForm");
function submitForm() {
if (firstname.text != "" and surname.text != "" and address1.text != "" and town.text != "" and postcode.text != "") {
sender.firstname = firstname.text;
sender.surname = surname.text;
sender.address1 = address1.text;
sender.town = town.text;
finalBasket=new Array();
sender.postcode = postcode.text;
for (i=1; i<=myCount; i++) {
sender.finalBasket = myBasketItemProduct;
}
sender.totalBasketItems = myCount;
sender.emailsubmit = "yes";
sender.send("flashtest.cfm", "", "POST");
} else {
gotoAndPlay("submitBAD");
}
}

myBasketItemProduct is the array that holds the basket items and in this example, is "orange" and "apple".

The cold fusion MX script looks like this:-

<cfset basket = ArrayNew(1)>
<cfloop from="1" to="#totalBasketItems#" index="counter">
<cfset basket[counter] = #finalBasket#>
</cfloop>

<CFMAIL
From="me@me.com"
Subject="Your shopping basket"
TO="you@you.com">
<CFMAILPARAM NAME="REPLY-TO" VALUE="me@me.com">
Dear #firstname# #surname#

Heres the contents of your basket:

#address1#
#town#
#postcode#

<cfloop from="1" to="#totalBasketItems#" index="i">
#i#) #basket#
</cfloop>

Regards
Me
</cfmail>


The submitted email looks like this:-

QUOTE
Dear Joe Bloggs

Heres the contents of your basket:

Tottenham Court Road
London
W1


1) Apple

2) Apple


Regards
Me
UNQUOTE


I can see why all the items in the list are being populated by the last item in the myBasketItemProduct flash array, but cant figure out how to fix this.

Any help much appreciated
loftboy
Forum Regular

Joined: 24 Jun 2004
Posts: 1129
Location: Colorado
Reply with quote
u dont need to set the array, just throw a loop around the cfmail tags
Passing data from a Flash MX array to a Cold fusion MX page
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic