Example #1
0
 /// <summary>
 /// Implements the ActionScript cast operator, which allows the casting from 
 /// one data type to another. ActionCastOp pops an object off the stack and 
 /// attempts to convert the object to an instance of the class or to the 
 /// interface represented by the constructor function.
 /// </summary>
 public ActionCastOp()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_Object );
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_Function );
     _StackOps[ 2 ] = new StackPush( AVM1DataTypes.AVM_Object );
 }
Example #2
0
 /// <summary>
 /// Performs a bitwise OR operation.
 /// </summary>
 public ActionBitOr()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_integer );
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_integer );
     _StackOps[ 2 ] = new StackPush( AVM1DataTypes.AVM_integer );
 }
 /// <summary>
 /// is similar to ActionEquals2, but the two arguments must be of the same 
 /// type in order to be considered equal. Implements the ‘===’ operator 
 /// from the ActionScript language.
 /// </summary>
 public ActionStrictEquals()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_ANY );
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_ANY );
     _StackOps[ 2 ] = new StackPush( AVM1DataTypes.AVM_boolean );
 }
Example #4
0
        /// <summary>
        /// Instructs Flash Player to get the URL that 
        /// UrlString specifies. The URL can be of any type, 
        /// including an HTML file, an image or another 
        /// Swf file. If the file is playing in a browser, 
        /// the URL is displayed in the frame that TargetString 
        /// specifies. The "_level0" and "_level1" special 
        /// target names are used to load another Swf file 
        /// into levels 0 and 1 respectively
        /// </summary>
        public ActionGetURL()
        {
            this._URL = "";
            this._target = "";

            _StackOps = new StackChange[ 0 ];
        }
Example #5
0
 /// <summary>
 /// Divides two numbers and pushes the result back to the stack.
 /// </summary>
 public ActionDivide()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_float );
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_float );
     _StackOps[ 2 ] = new StackPush( AVM1DataTypes.AVM_float );
 }
 /// <summary>
 /// Clones a sprite.
 /// </summary>
 public ActionCloneSprite()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_String ); // depth
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_String ); // target
     _StackOps[ 2 ] = new StackPop( AVM1DataTypes.AVM_String );  // source
 }
 /// <summary>
 /// Tests two strings for equality
 /// </summary>
 public ActionStringEquals()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_String );
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_String );
     _StackOps[ 2 ] = new StackPush( AVM1DataTypes.AVM_String );
 }
Example #8
0
 /// <summary>
 /// Compares if arg2 > arg1
 /// </summary>
 public ActionGreater()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_ANY );
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_ANY );
     _StackOps[ 2 ] = new StackPush( AVM1DataTypes.AVM_boolean );
 }
        /// <summary>
        /// Waits for a frame to be loaded and is stack based
        /// </summary>
        public ActionWaitForFrame()
        {
            _frame = 0;
            _skipCount = 0;

            _StackOps = new StackChange[ 0 ];
        }
Example #10
0
 /// <summary>
 /// Sets a file property
 /// </summary>
 public ActionSetProperty()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_ANY ); // value
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_String ); // index
     _StackOps[ 2 ] = new StackPop( AVM1DataTypes.AVM_String ); // target
 }
        /// <summary>
        /// Creates a new constant pool, and replaces the old constant pool if one already exists
        /// </summary>
        public ActionConstantPool()
        {
            this._numConstants = 0;
            this._constants = new List<string>();

            _StackOps = new StackChange[ 0 ];
        }
Example #12
0
 /// <summary>
 /// Performs a bitwise left shift
 /// </summary>
 public ActionBitLShift()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_integer ); // arg
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_integer ); // shift value
     _StackOps[ 2 ] = new StackPush( AVM1DataTypes.AVM_integer );
 }
Example #13
0
 /// <summary>
 /// retrieves a named property from an object, and 
 /// pushes the value of the property onto the stack
 /// </summary>
 public ActionGetMember()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_String ); // name
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_Object ); // object
     _StackOps[ 2 ] = new StackPush( AVM1DataTypes.AVM_ANY );
 }
Example #14
0
 /// <summary>
 /// Is similar to ActionAdd, but performs the addition differently, 
 /// according to the data types of the arguments. The addition 
 /// operator algorithm in ECMA-262 Section 11.6.1 is used. 
 /// If string concatenation is applied, the concatenated string 
 /// is arg2 followed by arg1
 /// </summary>
 public ActionAdd2()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_ANY );
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_ANY );
     _StackOps[ 2 ] = new StackPush( AVM1DataTypes.AVM_ANY );
 }
Example #15
0
 /// <summary>
 /// Performs a logical NOT of a number
 /// </summary>
 public ActionNot()
 {
     _StackOps = new StackChange[ 2 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_String );
     // default to version >=5
     _StackOps[ 1 ] = new StackPush( AVM1DataTypes.AVM_boolean );
 }
Example #16
0
 /// <summary>
 /// Converts a value to an integer
 /// </summary>
 public ActionToInteger()
 {
     _StackOps = new StackChange[ 2 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_ANY );
     // default version >= 5
     _StackOps[ 1 ] = new StackPush( AVM1DataTypes.AVM_integer );
 }
        /// <summary>
        /// Waits for a frame to be loaded and is stack based
        /// </summary>
        public ActionWaitForFrame2()
        {
            this._skipCount = 0;

            _StackOps = new StackChange[ 1 ];
            _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_String ); // frame
        }
Example #18
0
 /// <summary>
 /// Gets a file property
 /// </summary>
 public ActionGetProperty()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_String ); // index (as string)
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_String ); // target
     _StackOps[ 2 ] = new StackPush( AVM1DataTypes.AVM_ANY );
 }
Example #19
0
 /// <summary>
 /// Tests two numbers for equality
 /// </summary>
 public ActionEquals()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_String );
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_String );
     // defaults to version 5 or higher
     _StackOps[ 2 ] = new StackPush( AVM1DataTypes.AVM_boolean );
 }
Example #20
0
 /// <summary>
 /// Tests to see if a string is less than another string
 /// </summary>
 public ActionStringLess()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_String );
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_String );
     // default version >= 5
     _StackOps[ 2 ] = new StackPush( AVM1DataTypes.AVM_boolean );
 }
Example #21
0
 /// <summary>
 /// Performs a logical AND
 /// </summary>
 public ActionAnd()
 {
     _StackOps = new StackChange[ 3 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_String );
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_String );
     // default to Version 5 and higher
     _StackOps[ 2 ] = new StackPush( AVM1DataTypes.AVM_boolean );
 }
 /// <summary>
 /// Extracts a substring from a string
 /// </summary>
 public ActionStringExtract()
 {
     _StackOps = new StackChange[ 4 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_String ); // count
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_String ); // index
     _StackOps[ 2 ] = new StackPop( AVM1DataTypes.AVM_String ); // the string
     _StackOps[ 3 ] = new StackPush( AVM1DataTypes.AVM_String ); // the substring (result)
 }
        /// <summary>
        /// ActionDefineFunction defines a function with a given name and body size.
        /// </summary>
        public ActionDefineFunction()
        {
            this._functionName = "";
            this._parameterName = new List<string>();
            this._codeSize = 0;

            _StackOps = new StackChange[ 0 ];
        }
Example #24
0
 /// <summary>
 /// Swaps the top two ScriptAtoms on the stack
 /// </summary>
 public ActionStackSwap()
 {
     _StackOps = new StackChange[ 4 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_ANY ); // a
     _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_ANY ); // b
     _StackOps[ 2 ] = new StackPush( AVM1DataTypes.AVM_ANY ); // a
     _StackOps[ 3 ] = new StackPush( AVM1DataTypes.AVM_ANY ); // b
 }
Example #25
0
        /// <summary>
        /// Goes to a frame and is stack based
        /// </summary>
        public ActionGotoFrame2()
        {
            this._sceneBias = false;
            this._play = false;
            this._sceneBiasAmount = 0;

            _StackOps = new StackChange[ 1 ];
            _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_String ); // frame number of string
        }
Example #26
0
        /// <summary>
        /// 
        /// </summary>
        public ActionGetURL2()
        {
            this._sendVarsMethod = SendVarsMethods.Method_GET;
            this._loadTargetFlag = false;
            this._loadVariablesFlag = false;

            _StackOps = new StackChange[ 2 ];
            _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_String ); // target
            _StackOps[ 1 ] = new StackPop( AVM1DataTypes.AVM_String ); // URL
        }
Example #27
0
        /// <summary>
        /// Try defines handlers for exceptional conditions, 
        /// implementing the ActionScript try, catch, and finally keywords.
        /// </summary>
        public ActionTry()
        {
            this._CatchInRegisterFlag = false;
            this._FinallyBlockFlag = false;
            this._trySize = 0;
            this._catchSize = 0;
            this._catchName = "";
            this._catchRegister = 0;

            _StackOps = new StackChange[ 0 ];
        }
Example #28
0
 /// <summary>
 /// Pops a value from the stack and discards it
 /// </summary>
 public ActionPop()
 {
     _StackOps = new StackChange[ 1 ];
     _StackOps[ 0 ] = new StackPop();
 }
Example #29
0
 /// <summary>
 /// Sets the current context and is stack based
 /// </summary>
 public ActionSetTarget2()
 {
     _StackOps = new StackChange[ 1 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_String );
 }
 /// <summary>
 /// Converts character code to ASCII and is multi-byte aware
 /// </summary>
 public ActionMBCharToAscii()
 {
     _StackOps = new StackChange[ 2 ];
     _StackOps[ 0 ] = new StackPop( AVM1DataTypes.AVM_String );
     _StackOps[ 1 ] = new StackPush( AVM1DataTypes.AVM_String );
 }