Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Create Buttons dynamically

Avatar

Level 1
Hi



I am pretty new to Flex and I am trying to populate buttons
dynamically that are in different colors and different label name
etc... I have cfc that returns an xml document with all the details
but how can I bind the data and layout the buttons on the canvas?
And each button need to have two events that need to be fired on
click. Can anyone help me with this?



Thanks
1 Reply

Avatar

Former Community Member
you need to create these by hand by 'looping' over your XML



something like var but:Button = new Button();

but.foo = bar;

but.bar = xxx;

but.x = somevalue;

but.y = somevalue;

...

...

somecanvas.addChild(but).



That's how we do it...



Ries