0

I'm making a SWF panel to automate some file setup. I'm using the libraryPath JSFL command to point to some external libraries. How do I put an item from one of those external libraries onto the stage using JSFL?

I've tried:

fl.getDocumentDOM().library.addItemToDocument({x:0, y:0}, 'myItem');
Amarghosh
  • 58,710
  • 11
  • 92
  • 121
Chuck
  • 898
  • 1
  • 9
  • 20

2 Answers2

1

Isn't the libraryPath to SWC files as in compiled flex like libraries, not visual components swc files?

If you want to add component swcs, use the componentPanel object:

fl.componentsPanel.addItemToDocument({x:0, y:200}, "User Interface", "Button"); 
George Profenza
  • 50,687
  • 19
  • 144
  • 218
0

From Adobe's documentation :

var itemIndex = fl.getDocumentDOM().library.findItemIndex( "myItem" );
var theItem = fl.getDocumentDOM().library.items[itemIndex];
fl.getDocumentDOM().addItem( {x:0,y:0}, theItem );
jonsca
  • 10,218
  • 26
  • 54
  • 62