1 50 51 package org.openlaszlo.iv.flash.commands; 52 53 import org.openlaszlo.iv.flash.parser.*; 54 import org.openlaszlo.iv.flash.api.*; 55 import org.openlaszlo.iv.flash.util.*; 56 import org.openlaszlo.iv.flash.context.Context; 57 58 59 public class ReplaceSymbolCommand extends GenericCommand { 60 61 public ReplaceSymbolCommand() {} 62 63 public void doCommand( FlashFile file, Context context, Script parent, int frameNum ) throws IVException { 64 boolean replace = getBoolParameter( context, "replace", true ); 65 String name = getParameter( context, "name" ); 66 67 if( replace ) { 68 Script script = file.getScript(name); 69 if ( script == null ) { 70 throw new IVException( Resource.CMDSCRIPTNOTFOUND, new Object [] {name, getCommandName()} ); 71 } 72 script = script.copyScript(); 73 file.processScript(script, context); 74 75 Instance inst = getCommandInstance(file, context, parent, frameNum); 76 inst.setScript( script ); 77 } 78 } 79 80 } 81 | Popular Tags |