title: Why can't I load this previously serialized object?
body: <p>This class is serializable:</p>
  
  <pre><code>   package com.things {
          public class MySerializableObject {
              public var intVals:Array;
              public var numVals:Array;
              public var stringVals:Array
  
              public function MySerializableObject() {
  
              }
  
              public function init(ints:Vector.&lt;int&gt;, nums:Vector.&lt;Number&gt;, strings:Vector.&lt;String&gt;) {
                  intVals = new Array();
                  for each (var i:int in ints) {
                      intVals.push(i);
                  }
                  numVals = new Array();
                  for each (var n:Number in nums) {
                      numVals.push(n);
                  }
                  stringVals = new Array();
                  for each (var s:String in strings) {
                      stringVals.push(s);
                  }
              }
          }
      }
  </code></pre>
  
  <p>We can do this:</p>
  
  <pre><code>registerClassAlias("com.things.MySerializableObject", MySerializableObject);
  </code></pre>
  
  <p>And then do this:</p>
  
  <pre><code>var sharedObject:SharedObject = SharedObject.getLocal(SAVE_NAME); //SAVE_NAME is a string constant
  var mso:MySerializableObject = getInitializedMSO();
  sharedObject.data.mso = mso;
  sharedObject.flush();
  
  var newMSO:MySerializableObject = sharedObject.data.mso as MySerializableObject;
  trace(newMSO); //outputs "[Object MySerializableObject]"
  </code></pre>
  
  <p>However, if we restart the application and do this:</p>
  
  <pre><code>var sharedObject:SharedObject = SharedObject.getLocal(SAVE_NAME); 
  registerClassAlias("com.things.MySerializableObject", MySerializableObject);
  var previouslySavedMSO:MySerializableObject = sharedObject.data.mso as MySerializableObject;
  trace(previouslySavedMSO); //outputs "null"
  </code></pre>
  
  <p>Flash apparently fails to read the saved object as a MySerializableObject after we close and re-open the application. We can see, by inspecting the SO in a debugger, that the data is still there, but Flash can't typecast it back into its original data type anymore. Is this the expected behavior? If not, what is the problem and how can we fix it?</p>