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 {
Unknown's avatar

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 comment