the trick for registering a class for shared object

registerClassAlias is a great way for SharedObject to recognise the class type that you’re storing rather than just a random object. However – something that seems to be undocumented – I’ve discovered that the constructor of the class you’re registering either has to have NO parameters OR default values for all parameters.

So: for example, if you’re trying to store a class and its constructor looks like this:

function user(userName:String,userID:String):void {

it won’t work until you give the parameters defaults, for example:

function user(userName:String='',userID:String=''):void {

iOS development with Swift - book: video course:

Tagged with: ,
Posted in Flash

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: