I assumed the OP just want to use the feature not implement it.
To use the panel is as easy as:
- To copy two files to the WindowSWF folder;
- (Re)open Animate;
- Select the panel from the Extensions menu.
This is not hard.
It's indeed more complicated if you wish to code the panel for yourself. I just put the code as a reference just in case of some search engine adventurer is passing by.
I thought about the possibility you suggested but I really don't want to change the user's timeline and playback. Anyway, I would really like to see how you would implement this, k.
Regards,
JC
var tl = fl.getDocumentDOM().getTimeline();
tl.setSelectedFrames(0,0);
var layer_index = addLayerF();
playSoundF(nextSoundF(),layer_index);
removeLayerF(layer_index);
function playSoundF(si,layer_index) {
if(!si){
return;
}
tl.layers[layer_index].frames[0].soundLibraryItem = si;
if (tl.layers[layer_index].frameCount < 100) {
tl.insertFrames(100); // using the undo command in the ide is best way i can see to undo any timeline changes
tl.currentFrame = 0;
tl.startPlayback();
}
}
function nextSoundF() {
var siA = fl.getDocumentDOM().library.getSelectedItems();
if (siA.length==0) {
siA = fl.getDocumentDOM().library.items;
}
for (var i = 0; i < siA.length; i++) {
if (siA.itemType == 'sound') {
return siA;
}
}
alert('end library: no more sounds');
return null;
}
function addLayerF(s) {
return tl.addNewLayer();
}
function removeLayerF(n) {
tl.deleteLayer(n);
}