📄 actiontextwriter.java
字号:
String mode = null;
switch( loadMode )
{
case GET_URL_MODE_LOAD_MOVIE_INTO_LEVEL :
mode = "load movie into level";
break;
case GET_URL_MODE_LOAD_MOVIE_INTO_SPRITE:
mode = "load movie into sprite";
break;
case GET_URL_MODE_LOAD_VARS_INTO_LEVEL :
mode = "load vars into level";
break;
case GET_URL_MODE_LOAD_VARS_INTO_SPRITE:
mode = "load vars into sprite";
break;
default:
mode = "???";
break;
}
print( "getURL", new String[] { sendVars_, mode } );
}
public void gotoFrame( boolean play ) throws IOException
{
print( "gotoFrame", new String[] { play ? "and play" : "and stop" } );
}
public void setTarget() throws IOException
{
print( "setTarget", null );
}
public void getProperty() throws IOException
{
print( "getProperty", null );
}
public void setProperty() throws IOException
{
print( "setProperty", null );
}
public void cloneSprite() throws IOException
{
print( "cloneSprite", null );
}
public void removeSprite() throws IOException
{
print( "removeSprite", null );
}
public void startDrag() throws IOException
{
print( "startDrag", null );
}
public void endDrag() throws IOException
{
print( "endDrag", null );
}
public void trace() throws IOException
{
print( "trace", null );
}
public void getTime() throws IOException
{
print( "getTime", null );
}
public void randomNumber() throws IOException
{
print( "randomNumber", null );
}
public void lookupTable( String[] values ) throws IOException
{
print( "lookupTable", null );
for( int i = 0; i < values.length; i++ )
{
printer.print( indent + " " );
writePaddedString( Integer.toString( i ) + ":", 5 );
printer.println( "\"" + values[i] + "\"" );
}
}
public void callFunction() throws IOException
{
print( "callFunction", null );
}
public void callMethod() throws IOException
{
print( "callMethod", null );
}
public SWFActionBlock startFunction( String name, String[] paramNames ) throws IOException
{
String args = name + "(";
if( paramNames != null)
{
for( int i = 0; i < paramNames.length; i++ )
{
if( i > 0 ) args += ",";
args += " " + paramNames[i];
}
if( paramNames.length > 0 ) args += " ";
}
args += ")";
printer.println();
print( "defineFunction", new String[] { args } );
print( "{", null );
indent();
blockLevel++;
return this;
}
public SWFActionBlock startFunction2( String name,
int numRegistersToAllocate,
int preloadingFlags,
String[] paramNames,
int[] registersForArguments ) throws IOException {
String args = name + "(";
if( paramNames != null)
{
for( int i = 0; i < paramNames.length; i++ )
{
if( i > 0 ) args += ",";
args += " " + paramNames[i];
if( registersForArguments[i] != 0 ) {
args += " [reg " + registersForArguments[i] + "]";
}
}
if( paramNames.length > 0 ) args += " ";
}
args += ") num registers = ";
args += numRegistersToAllocate;
printer.println();
print( "defineFunction", new String[] { args } );
int reg = 1;
if( (preloadingFlags & START_FUNCTION2_PRELOAD_THIS ) != 0 ) print( " Preload this [reg " + (reg++) + "]", null );
if( (preloadingFlags & START_FUNCTION2_PRELOAD_ARGUMENTS) != 0 ) print( " Preload arguments [reg " + (reg++) + "]", null );
if( (preloadingFlags & START_FUNCTION2_PRELOAD_SUPER ) != 0 ) print( " Preload super [reg " + (reg++) + "]", null );
if( (preloadingFlags & START_FUNCTION2_PRELOAD_ROOT ) != 0 ) print( " Preload root [reg " + (reg++) + "]", null );
if( (preloadingFlags & START_FUNCTION2_PRELOAD_PARENT ) != 0 ) print( " Preload parent [reg " + (reg++) + "]", null );
if( (preloadingFlags & START_FUNCTION2_PRELOAD_GLOBAL ) != 0 ) print( " Preload global [reg " + (reg++) + "]", null );
if( (preloadingFlags & START_FUNCTION2_SUPRESS_SUPER ) != 0 ) print( " Supress super", null );
if( (preloadingFlags & START_FUNCTION2_SUPRESS_ARGUMENTS) != 0 ) print( " Supress arguments", null );
if( (preloadingFlags & START_FUNCTION2_SUPRESS_THIS ) != 0 ) print( " Supress this", null );
print( "{", null );
indent();
blockLevel++;
return this;
}
public void comment( String comment ) throws IOException
{
printer.println( indent + " // " + comment );
}
public void defineLocalValue() throws IOException
{
print( "defineLocalValue", null );
}
public void defineLocal() throws IOException
{
print( "defineLocal", null );
}
public void deleteProperty() throws IOException
{
print( "deleteProperty", null );
}
public void deleteThreadVars() throws IOException
{
print( "deleteThreadVars", null );
}
public void enumerate() throws IOException
{
print( "enumerate", null );
}
public void typedEquals() throws IOException
{
print( "typedEquals", null );
}
public void getMember() throws IOException
{
print( "getMember", null );
}
public void initObject() throws IOException
{
print( "initObject", null );
}
public void newMethod() throws IOException
{
print( "newMethod", null );
}
public void newObject() throws IOException
{
print( "newObject", null );
}
public void setMember() throws IOException
{
print( "setMember", null );
}
public void getTargetPath() throws IOException
{
print( "getTargetPath", null );
}
public SWFActionBlock startWith() throws IOException
{
printer.println();
print( "with", null );
print( "{", null );
indent();
blockLevel++;
return this;
}
public void duplicate() throws IOException
{
print( "duplicate", null );
}
public void returnValue() throws IOException
{
print( "return", null );
}
public void swap() throws IOException
{
print( "swap", null );
}
public void storeInRegister( int registerNumber ) throws IOException
{
print( "register", new String[] { Integer.toString( registerNumber ) } );
}
public void convertToNumber() throws IOException
{
print( "convertToNumber", null );
}
public void convertToString() throws IOException
{
print( "convertToString", null );
}
public void typeOf() throws IOException
{
print( "typeOf", null );
}
public void typedAdd() throws IOException
{
print( "typedAdd", null );
}
public void typedLessThan() throws IOException
{
print( "typedLessThan", null );
}
public void modulo() throws IOException
{
print( "modulo", null );
}
public void bitAnd() throws IOException
{
print( "bitAnd", null );
}
public void bitOr() throws IOException
{
print( "bitOr", null );
}
public void bitXor() throws IOException
{
print( "bitXor", null );
}
public void shiftLeft() throws IOException
{
print( "shiftLeft", null );
}
public void shiftRight() throws IOException
{
print( "shiftRight", null );
}
public void shiftRightUnsigned() throws IOException
{
print( "shiftRightUnsigned", null );
}
public void decrement() throws IOException
{
print( "decrement", null );
}
public void increment() throws IOException
{
print( "increment", null );
}
public void enumerateObject() throws IOException {
print( "enumerateObject", null );
}
public void greaterThan() throws IOException {
print( "greaterThan", null );
}
public void instanceOf() throws IOException {
print( "instanceOf", null );
}
public void strictEquals() throws IOException {
print( "strictEquals", null );
}
public void stringGreaterThan() throws IOException {
print( "greaterThan", null );
}
public void _extends() throws IOException {
print( "extends", null );
}
public void _implements() throws IOException {
print( "implements", null );
}
public void _throw() throws IOException {
print( "throw", null );
}
public void cast() throws IOException {
print( "cast", null );
}
public SWFActionBlock.TryCatchFinally _try( String var ) throws IOException {
return new TryImpl( var );
}
public SWFActionBlock.TryCatchFinally _try( int reg ) throws IOException {
return new TryImpl( "register " + reg );
}
private class TryImpl implements SWFActionBlock.TryCatchFinally {
private String mCatchName;
TryImpl( String catchName ) {
mCatchName = catchName;
}
public SWFActionBlock catchBlock() throws IOException {
print( "catch( " + mCatchName + " ) {", null );
indent();
blockLevel++;
return ActionTextWriter.this;
}
public void endTry() throws IOException {
//nada
}
public SWFActionBlock finallyBlock() throws IOException {
print( "finally {", null );
indent();
blockLevel++;
return ActionTextWriter.this;
}
public SWFActionBlock tryBlock() throws IOException {
print( "try {", null );
indent();
blockLevel++;
return ActionTextWriter.this;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -