If you mean decompiling the push method itself, you can't because it's not
actioscript but a native code, implemented directly in the player.

If you mean how the push method is called, it'd be something like this:

Actionscript:

 function test():void {
  var i:int = 0;
  var arr:Array = new Array();
  arr.push(i);
 }

Disassembled bytecode:

    function test():void /* disp_id 0*/
    {
      // local_count=3 max_scope=1 max_stack=2 code_len=26
      0     getlocal0
      1     pushscope
      2     pushbyte       0
      4     setlocal1
      5     pushnull
      6     coerce         Array
      8     setlocal2
      9     pushbyte       0
      11    setlocal1
      12    findpropstrict Array
      14    constructprop  Array (0)
      17    coerce         Array
      19    setlocal2
      20    getlocal2
      21    getlocal1
      22    callpropvoid   http://adobe.com/AS3/2006/builtin::push (1)
      25    returnvoid
    }

The relevant part is this (local2 is the array and local1 the variable i)


      20    getlocal2
      21    getlocal1
      22    callpropvoid   http://adobe.com/AS3/2006/builtin::push (1)

Basically, you push the array onto the stack, then the arguments (the i
variable), and then use the callpropvoid native method. That method pops the
stack to get the arguments (the number of arguments is specified by the
caller, in this case it's 1 as you can see between the parens), and then it
pops the stack again to get the object (the array in this case). Then the
player calls the method passed to callpropvoid ("push"), on the array, and
passes the arguments to it (the variable i). If push returned a value,
callprop would have been used instead of callpropvoid.
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to