The instance names need to be unique. That goes for all components.
Nathan
http://www.nathanderksen.com
On Feb 9, 2006, at 9:28 PM, Srishti Bhatia wrote:
the problem i am facing is that :
the click event is always referring to the last checkbox
since they all have the same instance names .
The following is the function checkBox_Addition_in_ScrollPane()
for adding checkboxes in a scroll pane:
public function chk_func() {
trace("Change in checkbox '" + clip._name + "' to " +
clip.selected+clip.label);
}
function checkBox_Addition_in_ScrollPane() {
this.attachMovie("ScrollPane", "scrollpane1", 520);
scrollpane1.contentPath = "empty_mc";
var y:Number;
y = 10;
var depth:Number;
depth = 530;
for (var i = 0; i<datagrid.columnCount; i++) {
clip = scrollpane1.content.attachMovie("CheckBox",
"cb1", depth);
depth++;
clip._x = 10;
clip._y = y;
y = y+20;
clip.label = obj.d_array[i];
clip.addEventListener("click", Delegate.create(this,
chk_func));
}
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com