PDA

View Full Version : Deleting Multiple Frames' Action Script


AdemoS
03-23-2005, 04:42 AM
I have huge number of frame (about 200) that all have incorrect action script. All I want to do is clear all action script in those frames. Is there any command or method for killing multiple frames' action script, all at once?

EDIT: Tried searching, no results revelvant to my problem.

CyanBlue
03-23-2005, 05:04 AM
I don't think that's possible to my knowledge unless somebody creates JSFL to do that... But it will probably take more time to make that script than deleting them manually... :D

deadbeat
03-23-2005, 05:12 PM
I agree it would have to be JSFL...but I don't think scripting it would be that difficult...something like this - assuming your actionscript is on a layer named "code":


var timeline = fl.getDocumentDOM().getTimeline();
var layerIndex=timeline.findLayerIndex("code");
var frames=timeline.layers[layerIndex].frames;

for(var f=0;f<frames.length;f++){
frames[f].actionScript='';
}


I haven't tested this, so I'm not sure if this will work exactly as is, but that's the basic idea...

Check out the JSFL documentation for more info...
http://www.macromedia.com/livedocs/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=Part_JSAPI.html#wp73028

K.

hangalot
03-24-2005, 12:45 PM
var timeline = fl.getDocumentDOM().getTimeline();
var layers = timeLine.layers;
var layerLen = layers.length;
var layerFrames , frameLen;
for(var i = 0 ; i < layerLen ; i++)
{
layerFrames = layers[i].frames;
frameLen = layerFrames.length;

for(var z = 0 ; z < frameLen ; z++)
{
layerFrames[z].actionScript = "";
}
}