Hello Flashcoders,

I'm building a scrollable list, and I keep track of the list items
with a Collection. I'm having some trouble with instance names, I
think, and the Collection is not populated properly.

Here's my function to add a list item:

        function addListItem(symbolName, props)
        {
                // Create the content (instance name: _itemX)
                var instanceName = this.createInstanceName();
                var item = listContainer.createClassObject(symbolName, 
instanceName,
this.getNextHighestDepth(), props);
                
                //add to list items
                listItems.addItem(item);
                
                trace("////////////////////////////////////////////");
                trace("debugging addItem");
                var iterator = listItems.getIterator();
                while(iterator.hasNext()) {
                        var thisitem = iterator.next();
                        trace("this item: "+thisitem+"; type: 
"+thisitem.className);
                }
                trace("////////////////////////////////////////////");
                
                return item;
        }


After adding 3 items, the debug trace looks like this:

////////////////////////////////////////////
debugging addItem
this item: ; type: undefined
this item: ; type: undefined
this item: _level0.QUESTION
PAD.contentWidget.questionList.scrollPane.spContentHolder._item2;
type: View
////////////////////////////////////////////

Only the last item added exists in the Collection. Am I overwriting
some instance name somewhere?

Thanks,
Matt.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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

Reply via email to