AS3 error when serializing arrays
                
                Brought to you by:
                
                    sephiroth_tmm
                    
                
            
            
        
        
        
    When serializing an array it serializes as an Object, this is due to the order in which the code gets executed.
Checking whether something is an object happens before checking whether it is an array, and since all arrays are objects, the code for arrays will never be executed.
This can be prevented by simply switching the execution order in the code.
Logged In: NO
As is stated here, Arrays are indeed typed as objects when using typeof
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/operators.html#typeof
I changed the execution order as stated above and this seems to work, however I don't understand how this is possible as the typeof on an array returns object. So how could it ever execute the if array part?
Logged In: YES
user_id=2085810
Originator: YES
When using the 'is' keyword, I'm not to sure typeof value is really used, I'm thinking it's more like checking whether something has all the necessary properties and methods to be of the desired type.
So an array IS an object, but an object IS NOT necessarely an array, hence you needed to switch the order :)