In AS3 rather than MXML you write

 

    ta.addEventListener("change", changeHandler)

 

or

 

    ta.addEventListener(Event.CHANGE, changeHandler);

 

and declare

 

    private function changeHandler(event:Event):void

    {

        // do something

    }

 

But have you looked at <mx:Repeater> for creating repeated instances in MXML?

 

- Gordon

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of 
camlinaeizerous
Sent: Thursday, November 16, 2006 10:55 AM
To: [email protected]
Subject: [flexcoders] Re: Dynamic TextArea fields or Grouping TextArea fields

 

To solve your first problem use an event listener after the "ta" has
been ceated. It should be something similar to the below line. I
believe it's syntax is correct and each time ta changes the event
listener should call someListenerFunction.

ta.addEventListener(change, someListenerFunction);

--- In [email protected] <mailto:flexcoders%40yahoogroups.com> , 
"debla1317" <[EMAIL PROTECTED]> wrote:
>
> That works perfect (THANK YOU), now I have two problems.
> 
> 1) If I would have created the textarea down in the MXML I would be 
> able to set a "change" property, but I can't figure out how to set 
> that in my actionscript code ta.change = doSomething(); does not 
> work.
> 
> 2) Later on I want to look back through the list of textarea fields 
> and properties and I think I am close by creating a new object, but 
> not quite there.
> 
> So I created another loop to reference the textarea objects:
> 
> for (var y:int = 0; y<returnPackage.length; y++)
> {
> var packageObject:Object = "packageID_" + y.toString();
> Alert.show(packageObject.text);
> }
> 
> Now my problem is that it is setting packageObject to a string 
> instead of accepting that I want packageObject to be equal to my 
> text field with the id of packageID_0, packageID_1, etc...
> 
> --- In [email protected] <mailto:flexcoders%40yahoogroups.com> , 
> "Dimitrios Gianninas" 
> <dimitrios.gianninas@> wrote:
> >
> > Something like:
> > 
> > var ta:TextArea = new TextArea();
> > ta.text = "val from call";
> > ta.id = "mytextID" + x;
> > ta.width = 400;
> > myView.addChild( ta );
> > 
> > Dimitrios Gianninas
> > RIA Developer
> > Optimal Payments Inc.
> > 
> > 
> > ________________________________
> > 
> > From: [email protected] <mailto:flexcoders%40yahoogroups.com>  
> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com> ] On 
> Behalf Of debla1317
> > Sent: Wednesday, November 15, 2006 3:13 PM
> > To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] Dynamic TextArea fields or Grouping TextArea 
> fields
> > 
> > 
> > 
> > I am making a call out to a remote object and sending back a query 
> of 
> > reportid, reportname, reportdescription, reportprice. In the 
> handler 
> > function I am trying to do a for loop and create textfields to 
> display 
> > this information. The last column would be a dynamic textarea 
> where 
> > the user is able to enter a quantity they want to order.
> > 
> > How do I go about creating these textareas (labels, whatever) and 
> name 
> > them dynamically using the reportid so that on the payment page I 
> am 
> > able to loop back through and check the text value (quantity) to 
> > multiply it by the price.
> > 
> > 
> > 
> > 
> > 
> > -- 
> > WARNING
> > -------
> > This electronic message and its attachments may contain 
> confidential, proprietary or legally privileged information, which 
> is solely for the use of the intended recipient. No privilege or 
> other rights are waived by any unintended transmission or 
> unauthorized retransmission of this message. If you are not the 
> intended recipient of this message, or if you have received it in 
> error, you should immediately stop reading this message and delete 
> it and all attachments from your system. The reading, distribution, 
> copying or other use of this message or its attachments by 
> unintended recipients is unauthorized and may be unlawful. If you 
> have received this e-mail in error, please notify the sender.
> > 
> > AVIS IMPORTANT
> > --------------
> > Ce message électronique et ses pièces jointes peuvent contenir des 
> renseignements confidentiels, exclusifs ou légalement privilégiés 
> destinés au seul usage du destinataire visé. L'expéditeur original 
> ne renonce à aucun privilège ou à aucun autre droit si le présent 
> message a été transmis involontairement ou s'il est retransmis sans 
> son autorisation. Si vous n'êtes pas le destinataire visé du 
> présent message ou si vous l'avez reçu par erreur, veuillez cesser 
> immédiatement de le lire et le supprimer, ainsi que toutes ses 
> pièces jointes, de votre système. La lecture, la distribution, la 
> copie ou tout autre usage du présent message ou de ses pièces 
> jointes par des personnes autres que le destinataire visé ne sont 
> pas autorisés et pourraient être illégaux. Si vous avez reçu ce 
> courrier électronique par erreur, veuillez en aviser l'expéditeur.
> >
>

 

Reply via email to