KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openlaszlo > iv > flash > api > action > Actions


1 /*
2  * $Id: Actions.java,v 1.3 2002/06/17 03:13:05 skavish Exp $
3  *
4  * ==========================================================================
5  *
6  * The JGenerator Software License, Version 1.0
7  *
8  * Copyright (c) 2000 Dmitry Skavish (skavish@usa.net). All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions are met:
12  *
13  * 1. Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  *
16  * 2. Redistributions in binary form must reproduce the above copyright
17  * notice, this list of conditions and the following disclaimer in
18  * the documentation and/or other materials provided with the
19  * distribution.
20  *
21  * 3. The end-user documentation included with the redistribution, if
22  * any, must include the following acknowlegement:
23  * "This product includes software developed by Dmitry Skavish
24  * (skavish@usa.net, http://www.flashgap.com/)."
25  * Alternately, this acknowlegement may appear in the software itself,
26  * if and wherever such third-party acknowlegements normally appear.
27  *
28  * 4. The name "The JGenerator" must not be used to endorse or promote
29  * products derived from this software without prior written permission.
30  * For written permission, please contact skavish@usa.net.
31  *
32  * 5. Products derived from this software may not be called "The JGenerator"
33  * nor may "The JGenerator" appear in their names without prior written
34  * permission of Dmitry Skavish.
35  *
36  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39  * DISCLAIMED. IN NO EVENT SHALL DMITRY SKAVISH OR THE OTHER
40  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47  * SUCH DAMAGE.
48  *
49  */

50
51 package org.openlaszlo.iv.flash.api.action;
52
53 import java.io.PrintStream JavaDoc;
54 import org.openlaszlo.iv.flash.util.*;
55 import org.openlaszlo.iv.flash.parser.*;
56 import org.openlaszlo.iv.flash.api.*;
57
58 /**
59  * Enumeration of all known actions
60  */

61 public class Actions {
62
63     public static final int None = 0x00;
64     public static final int NextFrame = 0x04;
65     public static final int PrevFrame = 0x05;
66     public static final int Play = 0x06;
67     public static final int Stop = 0x07;
68     public static final int ToggleQuality = 0x08;
69     public static final int StopSounds = 0x09;
70     public static final int Add = 0x0A;
71     public static final int Subtract = 0x0B;
72     public static final int Multiply = 0x0C;
73     public static final int Divide = 0x0D;
74     public static final int Equal = 0x0E;
75     public static final int LessThan = 0x0F;
76     public static final int LogicalAnd = 0x10;
77     public static final int LogicalOr = 0x11;
78     public static final int LogicalNot = 0x12;
79     public static final int StringEqual = 0x13;
80     public static final int StringLength = 0x14;
81     public static final int SubString = 0x15;
82     public static final int Pop = 0x17;
83     public static final int Int = 0x18;
84     public static final int Eval = 0x1C;
85     public static final int SetVariable = 0x1D;
86     public static final int SetTargetExpression = 0x20;
87     public static final int StringConcat = 0x21;
88     public static final int GetProperty = 0x22;
89     public static final int SetProperty = 0x23;
90     public static final int DuplicateClip = 0x24;
91     public static final int RemoveClip = 0x25;
92     public static final int Trace = 0x26;
93     public static final int StartDragMovie = 0x27;
94     public static final int StopDragMovie = 0x28;
95     public static final int StringLessThan = 0x29;
96     public static final int Random = 0x30;
97     public static final int MBLength = 0x31;
98     public static final int Ord = 0x32;
99     public static final int Chr = 0x33;
100     public static final int GetTimer = 0x34;
101     public static final int MBSubString = 0x35;
102     public static final int MBOrd = 0x36;
103     public static final int MBChr = 0x37;
104     public static final int GotoFrame = 0x81; // frame num (WORD)
105
public static final int GetURL = 0x83; // url (STR), window (STR)
106
public static final int WaitForFrame = 0x8A; // frame needed (WORD), actions to skip (BYTE)
107
public static final int SetTarget = 0x8B; // name (STR)
108
public static final int GotoLabel = 0x8C; // name (STR)
109
public static final int WaitForFrameExpression = 0x8D; // frame needed on stack, actions to skip (BYTE)
110
public static final int PushData = 0x96;
111     public static final int Jump = 0x99;
112     public static final int GetURL2 = 0x9A;
113     public static final int JumpIfTrue = 0x9D;
114     public static final int CallFrame = 0x9E;
115     public static final int GotoExpression = 0x9F;
116
117     // Flash 5 actions
118
public static final int Delete = 0x3A;
119     public static final int Delete2 = 0x3B;
120     public static final int DefineLocal = 0x3C;
121     public static final int CallFunction = 0x3D;
122     public static final int Return = 0x3E;
123     public static final int Modulo = 0x3F;
124     public static final int NewObject = 0x40;
125     public static final int DefineLocal2 = 0x41;
126     public static final int InitArray = 0x42;
127     public static final int InitObject = 0x43;
128     public static final int TypeOf = 0x44;
129     public static final int TargetPath = 0x45;
130     public static final int Enumerate = 0x46;
131     public static final int Add2 = 0x47;
132     public static final int Less2 = 0x48;
133     public static final int Equals2 = 0x49;
134     public static final int ObjectToNumber = 0x4A;
135     public static final int ObjectToString = 0x4B;
136     public static final int PushDuplicate = 0x4C;
137     public static final int StackSwap = 0x4D;
138     public static final int GetMember = 0x4E;
139     public static final int SetMember = 0x4F;
140     public static final int Increment = 0x50;
141     public static final int Decrement = 0x51;
142     public static final int CallMethod = 0x52;
143     public static final int NewMethod = 0x53;
144     public static final int BitAnd = 0x60;
145     public static final int BitOr = 0x61;
146     public static final int BitXor = 0x62;
147     public static final int BitLShift = 0x63;
148     public static final int BitRShift = 0x64;
149     public static final int BitURShift = 0x65;
150     public static final int StoreRegister = 0x87; // register number (byte)
151
public static final int ConstantPool = 0x88; // num (WORD), pool (STR*num)
152
public static final int With = 0x94; // withBlock (STR)
153
public static final int DefineFunction = 0x9B; // name (STR), parmsNum (WORD), parms (STR*parmsNum), codeSize (WORD), code (UI8*codeSize)
154

155     public static final String JavaDoc[] actionsNames = {
156         "None",
157         "NextFrame",
158         "PrevFrame",
159         "Play",
160         "Stop",
161         "ToggleQuality",
162         "StopSounds",
163         "Add",
164         "Subtract",
165         "Multiply",
166         "Divide",
167         "Equal",
168         "LessThan",
169         "LogicalAnd",
170         "LogicalOr",
171         "LogicalNot",
172         "StringEqual",
173         "StringLength",
174         "SubString",
175         "Pop",
176         "Int",
177         "Eval",
178         "SetVariable",
179         "SetTargetExpression",
180         "StringConcat",
181         "GetProperty",
182         "SetProperty",
183         "DuplicateClip",
184         "RemoveClip",
185         "Trace",
186         "StartDragMovie",
187         "StopDragMovie",
188         "StringLessThan",
189         "Random",
190         "MBLength",
191         "Ord",
192         "Chr",
193         "GetTimer",
194         "MBSubString",
195         "MBOrd",
196         "MBChr",
197         "GotoFrame",
198         "GetURL",
199         "WaitForFrame",
200         "SetTarget",
201         "GotoLabel",
202         "WaitForFrameExpression",
203         "PushData",
204         "Jump",
205         "GetURL2",
206         "JumpIfTrue",
207         "CallFrame",
208         "GotoExpression",
209         "Delete",
210         "Delete2",
211         "DefineLocal",
212         "CallFunction",
213         "Return",
214         "Modulo",
215         "NewObject",
216         "DefineLocal2",
217         "InitArray",
218         "InitObject",
219         "TypeOf",
220         "TargetPath",
221         "Enumerate",
222         "Add2",
223         "Less2",
224         "Equals2",
225         "ObjectToNumber",
226         "ObjectToString",
227         "PushDuplicate",
228         "StackSwap",
229         "GetMember",
230         "SetMember",
231         "Increment",
232         "Decrement",
233         "CallMethod",
234         "NewMethod",
235         "BitAnd",
236         "BitOr",
237         "BitXor",
238         "BitLShift",
239         "BitRShift",
240         "BitURShift",
241         "StoreRegister",
242         "ConstantPool",
243         "With",
244         "DefineFunction",
245     };
246
247     // names and indexes have to be in the same order
248
public static final int[] actionsIndexes = {
249         None,
250         NextFrame,
251         PrevFrame,
252         Play,
253         Stop,
254         ToggleQuality,
255         StopSounds,
256         Add,
257         Subtract,
258         Multiply,
259         Divide,
260         Equal,
261         LessThan,
262         LogicalAnd,
263         LogicalOr,
264         LogicalNot,
265         StringEqual,
266         StringLength,
267         SubString,
268         Pop,
269         Int,
270         Eval,
271         SetVariable,
272         SetTargetExpression,
273         StringConcat,
274         GetProperty,
275         SetProperty,
276         DuplicateClip,
277         RemoveClip,
278         Trace,
279         StartDragMovie,
280         StopDragMovie,
281         StringLessThan,
282         Random,
283         MBLength,
284         Ord,
285         Chr,
286         GetTimer,
287         MBSubString,
288         MBOrd,
289         MBChr,
290         GotoFrame,
291         GetURL,
292         WaitForFrame,
293         SetTarget,
294         GotoLabel,
295         WaitForFrameExpression,
296         PushData,
297         Jump,
298         GetURL2,
299         JumpIfTrue,
300         CallFrame,
301         GotoExpression,
302         Delete,
303         Delete2,
304         DefineLocal,
305         CallFunction,
306         Return,
307         Modulo,
308         NewObject,
309         DefineLocal2,
310         InitArray,
311         InitObject,
312         TypeOf,
313         TargetPath,
314         Enumerate,
315         Add2,
316         Less2,
317         Equals2,
318         ObjectToNumber,
319         ObjectToString,
320         PushDuplicate,
321         StackSwap,
322         GetMember,
323         SetMember,
324         Increment,
325         Decrement,
326         CallMethod,
327         NewMethod,
328         BitAnd,
329         BitOr,
330         BitXor,
331         BitLShift,
332         BitRShift,
333         BitURShift,
334         StoreRegister,
335         ConstantPool,
336         With,
337         DefineFunction,
338     };
339
340     public static String JavaDoc getActionName( int action ) {
341         for( int i=0; i<actionsIndexes.length; i++ ) {
342             if( action == actionsIndexes[i] ) return actionsNames[i];
343         }
344         return "<unknown>";
345     }
346
347 }
348
349
Popular Tags