📄 fsaction.java
字号:
<td>Deletes an object or variable, returning true if the object was deleted, false otherwise.</td>
<td nowrap>(name -- boolean)</td>
<td nowrap>("x" -- 1)</td></tr>
</table>
<h1 class="datasheet">Functions</h1>
<table class="actions">
<tr><th>Action</th><th>Description</th><th>Stack Notation</th><th>Example</th></tr>
<tr valign="top"><td>ExecuteFunction</td>
<td>Execute the built-in function.</td>
<td nowrap>(arg* functionName -- result*)</td>
<td nowrap>(12.3 "isFinite" -- "1")</td></tr>
<tr valign="top"><td>Return</td>
<td>Return control from the function.</td>
<td nowrap>(--)</td>
<td nowrap>(--)</td></tr>
</table>
<h1 class="datasheet">Objects</h1>
<table class="actions">
<tr><th>Action</th><th>Description</th><th>Stack Notation</th><th>Example</th></tr>
<tr valign="top"><td>GetAttribute</td>
<td>Push the value of an objects attribute on the stack</td>
<td nowrap>(string string -- value)</td>
<td nowrap>("Key" "SPACE" -- 32)</td></tr>
<tr valign="top"><td>SetAttribute</td>
<td>Set the value of a attribute of an object</td>
<td nowrap>(variable string value --)</td>
<td nowrap>(<_root> "variable" 1 --)</td></tr>
<tr valign="top"><td>ExecuteMethod</td>
<td>Execute a method of an object</td>
<td nowrap>(string string -- value)</td>
<td nowrap>("Key" "getCode" -- num)</td></tr>
<tr valign="top"><td>NewMethod</td>
<td>Define a new method for an object</td>
<td nowrap> </td>
<td nowrap> </td></tr>
<tr valign="top"><td>NamedObject</td>
<td>Construct an instance of a built-in object.</td>
<td nowrap>(arg* count className -- instance)</td>
<td nowrap>("My String" 1 "String" -- instance)</td></tr>
<tr valign="top"><td>NewObject</td>
<td>Define a new class.</td>
<td nowrap>((name value)* count -- instance)</td>
<td nowrap>("Account" "123456" 1 -- value)</td></tr>
<tr valign="top"><td>Enumerate</td>
<td>Enumerate through the attributes of the object referenced by the name of the variable on the stack.</td>
<td nowrap>( "var" -- )</td>
<td nowrap>( -- )</td></tr>
<tr valign="top"><td>EnumerateObject</td>
<td>Enumerate through the attributes of the object on the stack.</td>
<td nowrap>( "var" -- )</td>
<td nowrap>( -- )</td></tr>
</table>
<h1 class="datasheet">Movie Control</h1>
<table class="actions">
<tr><th>Action</th><th>Description</th><th>Stack Notation</th><th>Example</th></tr>
<tr valign="top"><td>GetTarget</td>
<td>Returns a string representing the path to the movie clip in which the current action is executed.</td>
<td nowrap>(-- clipName )</td>
<td nowrap>( -- "_root/MovieClip")</td></tr>
<tr valign="top"><td>SetTarget2</td>
<td>Change the context of the Flash Player so subsequent actions are applied to the movie clip, <i>clipName</i>.</td>
<td nowrap>(clipName -- )</td>
<td nowrap>("MovieClip" --)</td></tr>
<tr valign="top"><td>GetProperty</td>
<td>Push the value of the specified property on the stack. Properties are identified by reserved values, see the FSPush class for more details.</td>
<td nowrap>(value -- value)</td>
<td nowrap>( <_totalframes> -- 36 )</td></tr>
<tr valign="top"><td>SetProperty</td>
<td>Set the value of a property</td>
<td nowrap>(value propertyName --)</td>
<td nowrap>( 8000 <_width> -- )</td></tr>
<tr valign="top"><td>CloneSprite</td>
<td>Duplicate a movie clip <i>clipName</i>, on the display list layer <i>depth</i> with the name <i>newName</i>.</td>
<td nowrap>( depth clipName newName --)</td>
<td nowrap>( 19 "_root/MovieClip" "newClip" -- )</td></tr>
<tr valign="top"><td>RemoveSprite</td>
<td>Delete a movie clip</td>
<td nowrap>( clipName --)</td>
<td nowrap>( "_root/MovieClip" -- )</td></tr>
<tr valign="top"><td>StartDrag</td>
<td>Starts dragging a movie clip with an optional constraining rectangle defined by the corner points (x1,y1), (x2,y2).</td>
<td nowrap>( x1 y1 x2 y2 1 clipName --)<br><br>( 0 clipName --)</td>
<td nowrap>( 0 0 400 400 1 "movieClip" - )<br><br>( 0 "movieClip" - )</td></tr>
<tr valign="top"><td>EndDrag</td>
<td>Stops dragging a movie clip</td>
<td nowrap>(--)</td>
<td nowrap> </td></tr>
<tr valign="top"><td>NextFrame</td>
<td>Go to the next frame of the current movie</td>
<td nowrap>(--)</td>
<td nowrap> </td></tr>
<tr valign="top"><td>PreviousFrame</td>
<td>Go to the previous frame of the current movie</td>
<td nowrap>(-- )</td >
<td nowrap> </td></tr>
<tr valign="top"><td>Play</td>
<td>Start playing the current movie at the current frame</td>
<td nowrap>(--)</td>
<td nowrap> </td></tr>
<tr valign="top"><td>Stop</td>
<td>Stop playing the current movie</td>
<td nowrap>(--)</td>
<td nowrap> </td></tr>
<tr valign="top"><td>ToggleQuality</td>
<td>Toggle the movie between high and low quality</td>
<td nowrap>(--)</td>
<td nowrap> </td></tr>
<tr valign="top"><td>StopSounds</td>
<td>Stop playing all sounds</td>
<td nowrap>(--)</td>
<td nowrap> </td></tr>
</table>
<h1 class="datasheet">ActionScript 2.0</h1>
<p>Starting with Flash 6 Macromedia extended the syntax of ActionScript to make
it more object-oriented, moving the language closer to Java than JavaScript.
Several actions were added to support the new keywords introduced into ActionScript
2.0.</p>
<table class="actions">
<tr><th>Action</th><th>Description</th><th>Stack Notation</th><th>Example</th></tr>
<tr valign="top"><td>InstanceOf</td>
<td>Return true or false to the stack if the object can be created using the constructor function.</td>
<td nowrap>( object function -- true | false)</td>
<td nowrap> </td></tr>
<tr valign="top"><td>Implements</td>
<td>Identifies a class implements a defined interface.</td>
<td nowrap>( (function) count function --)</td>
<td nowrap> </td></tr>
<tr valign="top"><td>Extends</td>
<td>Identifies that a class inherits from a class - used to increase the execution speed of ActionScript code.</td>
<td nowrap>( subclass superclass --)</td>
<td nowrap> </td></tr>
<tr valign="top"><td>Cast</td>
<td>Casts the type of an object on the stack, returning the object if it is the same type as the constructor function, null otherwise.</td>
<td nowrap>(function object -- object | null)</td>
<td nowrap> </td></tr>
<tr valign="top"><td>Throw</td>
<td>Throw an exception.</td>
<td nowrap>(--)</td>
<td nowrap> </td></tr>
</table>
<h1 class="datasheet">Miscellaneous</h1>
<table class="actions">
<tr><th>Action</th><th>Description</th><th>Stack Notation</th><th>Example</th></tr>
<tr valign="top"><td>Trace</td>
<td>Append value to debugging window</td>
<td nowrap>(value --)</td>
<td nowrap>("X = 3" --)</td></tr>
<tr valign="top"><td>GetTime</td>
<td>Push the number of milliseconds that have elapsed since the player started on the stack.</td>
<td nowrap>(-- num)</td>
<td nowrap>(-- 1274832)</td></tr>
<tr valign="top"><td>RandomNumber</td>
<td>Push a random number on the stack.</td>
<td nowrap>(maximumValue -- num)</td>
<td nowrap>(10 -- 3)</td></tr>
</table>
<p><b>Notes</b></p>
<ul>
<li>The Add action was updated in Flash 5 so it can be used to perform arithmetic add and string concatenation depending on whether the values on the stack can be interpreted as numeric values or strings. The original add action (Code = 10) should not be used.</li>
<li>For the division operation, if a divide by zero error occurs then the string "#ERROR" is pushed onto the stack.</li>
<li>The Equals and Less actions were updated in Flash 5 so it can be used to perform arithmetic and string comparison depending on whether the values on the stack can be interpreted as numeric values or strings. The original Less action (code = 15) and Equals action (code = 14) should not be used.</li>
<li>Type conversion of string characters is now handled by the String object, introduced in Flash 5. The ToInteger action is now supported by the Math object also introduced in Flash 5. The type conversion functions are only included for completeness.</li>
<li>Flash version 5 supports built-in and user defined objects. For a full description of the objects supported please consult an ActionScript 5 reference guide.</li>
</ul>
<h1 class="datasheet">Examples</h1>
<p>The FSActionObject class defines a series of constants that lists the type of actions supported in the current release. Actions may be created by specifying the action type in the constructor:</p>
<pre>
FSAction anAction = new FSAction(FSAction.Add);
</pre>
<p>The FSPush class is used to push values onto the Flash Player's stack before an action is executed. For example to execute the expression (1+2)*3 when a frame is displayed the following sequence of actions are created:</p>
<pre>
FSDoAction frameAction = new FSDoAction();
frameAction.add(new FSPush(1));
frameAction.add(new FSPush(2));
frameAction.add(new FSAction(FSAction.Add));
frameAction.add(new FSPush(3));
frameAction.add(new FSAction(FSAction.Multiply));
</pre>
<p>The Flash Player also supported classes and object that represent different complex data types and system resources such as the mouse. These objects and the functions they support are referenced by name. String containing the names and the values (and number) of the arguments required are pushed onto the stack:</p>
<pre>
// Push the arguments followed by the number of arguments onto the stack
frameAction.add(new FSPush(aValue));
frameAction.add(new FSPush(aValue));
frameAction.add(new FSPush(2));
// Place the name on the stack then execute the function.
frameAction.add(new FSPush("FunctionName"));
frameAction.add(new FSAction(FSAction.ExecuteFunction));
</pre>
<p>To execute a method on a given object a reference to the object is retrieved and the name of the method and any arguments are specified. For example to play a movie clip starting at a named frame:</p>
<pre>
// Push the arguments followed by the number of arguments onto the stack
frameAction.add(new FSPush("frameName"));
frameAction.add(new FSPush(1));
// Get a reference to the object.
frameAction.add(new FSPush("_root"));
frameAction.add(new FSPush("movieClip"));
frameAction.add(new FSAction(FSAction.GetAttribute));
// Place the name of the method on the stack then execute it.
frameAction.add(new FSPush("gotoAndPlay"));
frameAction.add(new FSAction(FSAction.ExecuteMethod));
</pre>
<p>Note: The FSPush class allows more than one value to be pushed onto the stack at a time. In the above examples separate FSPush objects are created to make the code a little more readable.</p>
*/
public class FSAction extends FSActionObject
{
/** Type identifying a NextFrame stack-based action. */
public static final int NextFrame = 4;
/** Type identifying a PrevFrame stack-based action. */
public static final int PrevFrame = 5;
/** Type identifying a Play stack-based action. */
public static final int Play = 6;
/** Type identifying a Stop stack-based action. */
public static final int Stop = 7;
/** Type identifying a ToggleQuality stack-based action. */
public static final int ToggleQuality = 8;
/** Type identifying a StopSounds stack-based action. */
public static final int StopSounds = 9;
// Flash 4
/// Type identifying an IntegerAdd stack-based action.
public static final int IntegerAdd = 10;
/// Type identifying a Subtract stack-based action.
public static final int Subtract = 11;
/// Type identifying a Multiply stack-based action.
public static final int Multiply = 12;
/// Type identifying a Divide stack-based action.
public static final int Divide = 13;
/// Type identifying an IntegerEquals stack-based action.
public static final int IntegerEquals = 14;
/// Type identifying an IntegerLess stack-based action.
public static final int IntegerLess = 15;
/// Type identifying an And stack-based action.
public static final int And = 16;
/// Type identifying an Or stack-based action.
public static final int Or = 17;
/// Type identifying a Not stack-based action.
public static final int Not = 18;
/// Type identifying a StringEquals stack-based action.
public static final int StringEquals = 19;
/// Type identifying a StringLength stack-based action.
public static final int StringLength = 20;
/// Type identifying a StringExtract stack-based action.
public static final int StringExtract = 21;
/// Type identifying a Pop stack-based action.
public static final int Pop = 23;
/// Type identifying a ToInteger stack-based action.
public static final int ToInteger = 24;
/// Type identifying a GetVariable stack-based action.
public static final int GetVariable = 28;
/// Type identifying a SetVariable stack-based action.
public static final int SetVariable = 29;
/// Type identifying a SetTarget2 stack-based action.
public static final int SetTarget2 = 32;
/// Type identifying a StringAdd stack-based action.
public static final int StringAdd = 33;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -