swiz支持两种客户端持久化。如果你有一个WEB项目,可以使用SharedObjectBean、AIR SharedObjectBean 或EncryptedLocalStorageBean。
SharedObjectBean
要使用SharedObjectBean,必需先声明BeanLoader:
xmlns:swiz=""
xmlns:fx=""
xmlns:mx="library://ns.adobe.com/flex/halo"
xmlns:storage="org.swizframework.storage.*">
注入一个实例到你的模型类,并且声明一个绑定的getter/setter:
[Autowire]
public var so:ISharedObjectBean;
[Bindable]
public function get appIndex():int
{
// the second parameter is the initial value
return so.getInt("appIndex", 0);
}
public function set appIndex(index:int):void
{
so.setInt("appIndex", index);
}
For further information please check the ASDocs at
阅读(885) | 评论(0) | 转发(0) |