[flexcoders] Using arraycollection as text for a flex TextArea Component.

2011-12-26 Thread ZIONIST
Hello Guys i have an arraycollection that is populated dynamically and would 
like to use the same arraycollection as text for a TextArea component. Below is 
my array collection

[Bindable]
private var orderColl:ArrayCollection=new ArrayCollection();

/*** Create an object to hold the data ***/
var obj:Object=new Object();

/*** Assign the variables to it ***/
obj.Product=product.text;
obj.Price=price.text;
obj.Qty=1;
obj.OrderNumber=label1.text;

/*** Add the object to the list ***/
orderColl.addItemAt(obj, 0);

Then i have a TextArea component (id=cart) and i try to assign the 
arraycollection to it as text like this

var str:String = orderColl.source.join(\n);
cart.text = str;

The result in the textarea is [object object]. Any help guys?



[flexcoders] Re: Using arraycollection as text for a flex TextArea Component.

2011-12-26 Thread stephen_anson
It looks like you are 'joining' objects, into a string.
If you created a product class and provided a suitable toString() method I 
think that would solve the problem

--- In flexcoders@yahoogroups.com, ZIONIST stinasius@... wrote:

 Hello Guys i have an arraycollection that is populated dynamically and would 
 like to use the same arraycollection as text for a TextArea component. Below 
 is my array collection
 
 [Bindable]
 private var orderColl:ArrayCollection=new ArrayCollection();
 
 /*** Create an object to hold the data ***/
 var obj:Object=new Object();
   
 /*** Assign the variables to it ***/
 obj.Product=product.text;
 obj.Price=price.text;
 obj.Qty=1;
 obj.OrderNumber=label1.text;
   
 /*** Add the object to the list ***/
 orderColl.addItemAt(obj, 0);
 
 Then i have a TextArea component (id=cart) and i try to assign the 
 arraycollection to it as text like this
 
 var str:String = orderColl.source.join(\n);
 cart.text = str;
 
 The result in the textarea is [object object]. Any help guys?





Re: [flexcoders] Using arraycollection as text for a flex TextArea Component.

2011-12-26 Thread claudiu ursica
What do you want exactly in the text area? Do the formatting by hand:
Something like:


for all tiem in the collection
output:String = itmem.text  + item price + .. + /n;

Make sure to keep in sync with the collection.

C



 From: ZIONIST stinas...@yahoo.com
To: flexcoders@yahoogroups.com 
Sent: Monday, December 26, 2011 12:43 PM
Subject: [flexcoders] Using arraycollection as text for a flex TextArea 
Component.
 

  
Hello Guys i have an arraycollection that is populated dynamically and would 
like to use the same arraycollection as text for a TextArea component. Below is 
my array collection
  collec
[Bindable]
private var orderColl:ArrayCollection=new ArrayCollection();

/*** Create an object to hold the data ***/
var obj:Object=new Object();

/*** Assign the variables to it ***/
obj.Product=product.text;
obj.Price=price.text;
obj.Qty=1;
obj.OrderNumber=label1.text;

/*** Add the object to the list ***/
orderColl.addItemAt(obj, 0);

Then i have a TextArea component (id=cart) and i try to assign the 
arraycollection to it as text like this

var str:String = orderColl.source.join(\n);
cart.text = str;

The result in the textarea is [object object]. Any help guys?


 

[flexcoders] Re: Using arraycollection as text for a flex TextArea Component.

2011-12-26 Thread ZIONIST
What i want is that after the client has finished selecting the items he/she 
wants to buy (Items selected make up the arraycollection orderColl), he/she 
should be able to preview the list of items they selected. so i want the 
contents of orderColl to be the text of the TextArea. Hope its now clear what 
am tring to do.



[flexcoders] Re: Bug in C function caused AIR to crash

2011-12-26 Thread yanlilei64
No one know?


--- In flexcoders@yahoogroups.com, yanlilei64 yanlilei64@... wrote:

 I want to pass the James string to getTestString function, the first
 time, the string could return This is James without any error.
 Subsequently after the button is click, the application will just
 hang/crash (grey out), it seem there some bugs in this code?
 
 Screenshot: http://imagetwist.com/7896zupwtu97/a.jpg.html
 
 Code:
 
 FREObject getTestString(FREContext ctx, void* funcData, uint32_t argc,
 FREObject argv[]) {
FREObject result;
 
//Temporary values to hold our actionscript code.
uint32_t albumLength;
const uint8_t *str;
uint8_t *strAll;
 
//Turn our actionscrpt code into native code.
FREGetObjectAsUTF8(argv[0], albumLength, str);
strcpy(strAll,This is );
strcat(strAll,str);  //str is James
 
//const char *str = this is ;
FRENewObjectFromUTF8(strlen(strAll)+1, (uint8_t *)strAll,
 result); //UTF8 to object and return
 
return result;
 }





[flexcoders] Resize and Scale Window Content

2011-12-26 Thread hkondylk
Hello, 

I want to be able to resize my Window and the content to scale as the window 
resizes. Is this possible or do you have an example?

THanks in advnace.



Re: [flexcoders] Resize and Scale Window Content

2011-12-26 Thread claudiu ursica
In theory yes, by using percent width and height for components, in practice 
how much works out of the box depeds on every particular case.

C




 From: hkondylk kondy...@gmail.com
To: flexcoders@yahoogroups.com 
Sent: Monday, December 26, 2011 5:35 PM
Subject: [flexcoders] Resize and Scale Window Content
 

  
Hello, 

I want to be able to resize my Window and the content to scale as the window 
resizes. Is this possible or do you have an example?

THanks in advnace.


 

[flexcoders] Re: Using arraycollection as text for a flex TextArea Component.

2011-12-26 Thread ZIONIST
This is what i have come up with some far... Problem is that it only outputs 
the first entry in the ArrayCollection. So if a client selects more than one
item to buy, when he/she previews their selection, they will only see the first 
entry. Could someone please help me modify this to show all the entries
in the ArrayCollection.

[Bindable]
private var orderColl:ArrayCollection=new ArrayCollection();

/*** Create an object to hold the data ***/
var obj:Object=new Object();

/*** Assign the variables to it ***/
obj.Product=product.text;
obj.Price=price.text;
obj.Qty=1;
obj.OrderNumber=label1.text;

/*** Add the object to the list ***/
orderColl.addItemAt(obj, 0);

Then i have a TextArea component (id=cart) and i try to assign the 
arraycollection to it as text like this

var txt:String;
var n:int=orderColl.length;
for (var i:int=0; i  n; i++)
{
var entry:Object=orderColl.getItemAt(i);
txt = entry.OrderNumber +   + , +   + entry.Product +   + , + 
  + entry.Qty +   + , +   + entry.Price;
}
cart.text = txt.toString();