作者HelloJimmy (揪~~竟,能不能考上?)
看板Flash
标题Re: [问题] views的状态维持??
时间Sun Nov 13 12:09:26 2011
您好:
我的程式结构如下:
main.mxml:ViewNavigatorApplication
inputData.mxml:view
inputNote.mxml:view
main.mxml////
<s:ViewNavigatorApplication xmlns:fx="
http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
firstView="views.inputDataView">
</s:ViewNavigatorApplication>
inputDataView.mxml///
<s:View xmlns:fx="
http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" >
<fx:Script>
<![CDATA[
private function Input(event:MouseEvent):void{
var slideTrans:SlideViewTransition=new SlideViewTransition();
slideTrans.direction="left";
navigator.defaultPushTransition=slideTrans;
navigator.pushView(views.functionView);
}
]]>
</fx:Script>
<s:TextInput id="txt_Data"/>
<s:Button id="btn_Input" label="输入" click="Input(event)"/>
</s:View>
inputNoteView.mxml///
<fx:Script>
<![CDATA[
var slideTrans:SlideViewTransition=new SlideViewTransition();
slideTrans.direction="right";
navigator.defaultPushTransition=slideTrans;
navigator.pushView(views.inputDataView);
]]>
</fx:Script>
简单说就是一个ViewNavigatorApplication,
首页是资料输入画面(inputDataView),
登入後要移转到补充资料输入(inputNoteView).
问题:
(1)从inputNoteView回到inputDataView时,inputDataView的输入资料都消失了,
该如何资料在页面移转时亦可维持?
(2)从inputNoteView回到inputDataView时,
navigator.defaultPushTransition=slideTrans;
程式错误,
flex显示Object不存在,
why?
写得落落长,
希望大家看得懂,
谢谢~
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.168.113.46
1F:→ ticore:原来是Flex Mobile App啊 11/14 00:24
3F:→ ticore:最简单的作法设置View destructionPolicy="never" 11/14 00:28