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 {

Interactive developer, Author - iOS development with Swift - book coming 2017 https://manning.com/books/ios-development-with-swift

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: