how to work registerClassAlias() method for custom mxml components

前端 未结 2 1958
走了就别回头了
走了就别回头了 2020-12-20 07:42

I have flex mxml custom component(Graphic).According to requirement a need to copy them as copy or cut operation.but problem in the registerClassAlias() method,how i

2条回答
  •  自闭症患者
    2020-12-20 08:28

    Ok, this blog post has a simple solution... you use getDefinitionByName():

    So something like this in your code:

    var className:String = getQualifiedClassName(zorder.getItemAt(0));
                _saveIn.clear();
    
                registerClassAlias(className, getDefinitionByName(className) as Class);
                _saveIn   =     SharedObject.getLocal("save");
                _saveIn.data.value1 = new ByteArray();
                _saveIn.data.value1.writeObject(zorder.getItemAt(0));
                _saveIn.data.value1.position = 0;
                _saveIn.flush();
    

提交回复
热议问题