PDA

View Full Version : How to set properties of component instances


andersT
10-19-2004, 04:08 PM
How do I set properties of the selected component instance using jsfl ?
For instance, how to set the Label text of a button, or realy any property of any component ?

hangalot
10-20-2004, 01:00 PM
it has a properties array. check in the help

andersT
10-21-2004, 09:54 AM
fl.componentsPanel.addItemToDocument({x:100, y:100}, 'UI Components', 'Button');
var doc = fl.getDocumentDOM();

// Remember that selection is an array... :)
var componentInstance = doc.selection[0];

for(var i in componentInstance.parameters)
{
var p = componentInstance.parameters[i];
if(p.name == 'label')
{
p.value = 'My Button';
}
}