PDA

View Full Version : setDataProvider() problem


pickels5980
01-21-2003, 06:37 AM
I create an empty movieclip then attach a function to it that attaches a combobox. The combobox displays ok but it has no contents. Does flash mx have a bug when it comes to attaching comboboxes on emptymovieclips?


_root.createEmptyMovieClip("comboHolder", 1);
_root.comboHolder.initCombo = function()
{
this.initialization = { editable:false, rowCount:8 }
this.attachMovie("FComboBoxSymbol", "combobox", 100, initialization);
this.contentArray = new Array('1','2','3','4','5','6','7','8','9','10');
this.combobox.setDataProvider(contentArray);
}

comboHolder.initCombo();

Mortimer Jazz
01-21-2003, 08:16 AM
No bug, just a pathing issue.
Replace
this.combobox.setDataProvider(contentArray);
with
this.combobox.setDataProvider(this.contentArray);

:)

Mortimer Jazz
01-21-2003, 08:28 AM
pickels, I have a quick question for you :)

Is this line this.initialization = { editable:false, rowCount:8 }; a shorthand way to create an object instance?

Does it essentially do the same as this:
function Initialize (edit,rc){
this.editable = edit;
this.rowCount = rc;
}

this.initialization = new Initialize(false,8);

Thanks,
Mort