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: https://manning.com/books/ios-development-with-swift video course: https://www.manning.com/livevideo/ios-development-with-swift-lv

Tagged with: ,
Posted in Flash

Leave a Reply

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

WordPress.com Logo

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

Facebook photo

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

Connecting to %s

%d bloggers like this: