[Flashcoders] Form AS3 - variable name brackets []

2008-01-23 Thread Nick Terry

Hello,

I'm trying to set up a newsletter, sending some variables to a PHP 
script in AS3.  The problem is that one of the variable Name/IDs has 
brackets [] in it and flash does not like this, so I've put the variable 
in the URLRequest - but it doesn't work either.  I'm interested if 
anyone has any ideas in how to pass this variable to the PHP file. 

Should I put group_ids[]=2 in a text file and load that text file in 
the flash and then pass it to the PHP with the other variables?  If so, 
ideas in how?  Thanks for any help.


-Nick

Here's the code I have so far:

   var variables:URLVariables = new URLVariables();
   var varSend:URLRequest = new 
URLRequest(manage/public/listmessenger.php?group_ids[]=2);
   //var varSend:URLRequest = new 
URLRequest(manage/public/listmessenger.php);

   var varLoader:URLLoader = new URLLoader;
   varSend.method = URLRequestMethod.POST;
   varSend.data = variables;

   emailSubmit.addEventListener(MouseEvent.CLICK, sendActions);
   varLoader.addEventListener(Event.COMPLETE, loadComplete);

   function sendActions(event:MouseEvent):void {
   variables.email_address = email_txt.text;
   variables.action = String('subscribe');
   //variables.group_ids[] = String('2');
   varLoader.load(varSend);
   trace(variables.email_address);
   trace(variables.action);
   }

   function loadComplete(event:Event) {
   trace(Your message was sent.);
   }


--
Nick Terry
Designer

[EMAIL PROTECTED] | www.nickterry.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


RE: [Flashcoders] Form AS3 - variable name brackets []

2008-01-23 Thread Cor
Hi Nick,

group_ids[] indicates that you are referencing an Array, and it also needs a
index.

HTH
Cor 

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Nick Terry
Verzonden: woensdag 23 januari 2008 7:36
Aan: Flash Coders List
Onderwerp: [Flashcoders] Form AS3 - variable name brackets []

Hello,

I'm trying to set up a newsletter, sending some variables to a PHP script in
AS3.  The problem is that one of the variable Name/IDs has brackets [] in it
and flash does not like this, so I've put the variable in the URLRequest -
but it doesn't work either.  I'm interested if anyone has any ideas in how
to pass this variable to the PHP file. 

Should I put group_ids[]=2 in a text file and load that text file in the
flash and then pass it to the PHP with the other variables?  If so, ideas in
how?  Thanks for any help.

-Nick

Here's the code I have so far:

var variables:URLVariables = new URLVariables();
var varSend:URLRequest = new
URLRequest(manage/public/listmessenger.php?group_ids[]=2);
//var varSend:URLRequest = new
URLRequest(manage/public/listmessenger.php);
var varLoader:URLLoader = new URLLoader;
varSend.method = URLRequestMethod.POST;
varSend.data = variables;

emailSubmit.addEventListener(MouseEvent.CLICK, sendActions);
varLoader.addEventListener(Event.COMPLETE, loadComplete);

function sendActions(event:MouseEvent):void {
variables.email_address = email_txt.text;
variables.action = String('subscribe');
//variables.group_ids[] = String('2');
varLoader.load(varSend);
trace(variables.email_address);
trace(variables.action);
}

function loadComplete(event:Event) {
trace(Your message was sent.);
}


--
Nick Terry
Designer

[EMAIL PROTECTED] | www.nickterry.com

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


--
No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.9/1238 - Release Date: 22-1-2008
20:12


No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.9/1238 - Release Date: 22-1-2008
20:12
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.19.9/1238 - Release Date: 22-1-2008
20:12
 

___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] Form AS3 - variable name brackets []

2008-01-23 Thread Cory Petosky
Try:
variables[group_ids[]] = String('2');

On 1/23/08, Cor [EMAIL PROTECTED] wrote:
 Hi Nick,

 group_ids[] indicates that you are referencing an Array, and it also needs a
 index.

 HTH
 Cor

 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Namens Nick Terry
 Verzonden: woensdag 23 januari 2008 7:36
 Aan: Flash Coders List
 Onderwerp: [Flashcoders] Form AS3 - variable name brackets []

 Hello,

 I'm trying to set up a newsletter, sending some variables to a PHP script in
 AS3.  The problem is that one of the variable Name/IDs has brackets [] in it
 and flash does not like this, so I've put the variable in the URLRequest -
 but it doesn't work either.  I'm interested if anyone has any ideas in how
 to pass this variable to the PHP file.

 Should I put group_ids[]=2 in a text file and load that text file in the
 flash and then pass it to the PHP with the other variables?  If so, ideas in
 how?  Thanks for any help.

 -Nick

 Here's the code I have so far:

 var variables:URLVariables = new URLVariables();
 var varSend:URLRequest = new
 URLRequest(manage/public/listmessenger.php?group_ids[]=2);
 //var varSend:URLRequest = new
 URLRequest(manage/public/listmessenger.php);
 var varLoader:URLLoader = new URLLoader;
 varSend.method = URLRequestMethod.POST;
 varSend.data = variables;

 emailSubmit.addEventListener(MouseEvent.CLICK, sendActions);
 varLoader.addEventListener(Event.COMPLETE, loadComplete);

 function sendActions(event:MouseEvent):void {
 variables.email_address = email_txt.text;
 variables.action = String('subscribe');
 //variables.group_ids[] = String('2');
 varLoader.load(varSend);
 trace(variables.email_address);
 trace(variables.action);
 }

 function loadComplete(event:Event) {
 trace(Your message was sent.);
 }


 --
 Nick Terry
 Designer

 [EMAIL PROTECTED] | www.nickterry.com

 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


 --
 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.516 / Virus Database: 269.19.9/1238 - Release Date: 22-1-2008
 20:12


 No virus found in this incoming message.
 Checked by AVG Free Edition.
 Version: 7.5.516 / Virus Database: 269.19.9/1238 - Release Date: 22-1-2008
 20:12


 No virus found in this outgoing message.
 Checked by AVG Free Edition.
 Version: 7.5.516 / Virus Database: 269.19.9/1238 - Release Date: 22-1-2008
 20:12


 ___
 Flashcoders mailing list
 Flashcoders@chattyfig.figleaf.com
 http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



-- 
Cory Petosky : Lead Developer : PUNY
1618 Central Ave NE Suite 130
Minneapolis, MN 55413
Office: 612.216.3924
Mobile: 240.422.9652
Fax: 612.605.9216
http://www.punyentertainment.com
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders