I am trying to add an asset to a library in CS5, using the Library.store() method.
I tried the following:
var assetItemsArray:Array = new Array();
var asset:Asset = library.store(assetItemsArray);
but got this error message:
Error: Invalid value for parameter 'using' of method 'store'. Expected Array of PageItems, Movies, Sounds, Graphics or XMLElements, but received ((TextFrame)).
What am I doing wrong?
You are feeding it an array of arrays...
However that will give you nested items. You probably want this instead:
I see it's "Harbs to the rescue" again...
Indeed, I had tried
but it wouldn't compile in ActionScript, so I assumed that was not the way to go. Once you confirmed that that IS the solution, I tried
library.store(page.allPageItems as Array);
and that worked like a charm! And I DO need the nested items, thank you!