首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 媒体动画 > flex >

一个 flex 登录成功后跳转有关问题

2012-04-07 
请教大家一个 flex 登录成功后跳转问题大家好:我用 flex 开发系统, 系统和一般的基于html web系统一样,有

请教大家一个 flex 登录成功后跳转问题
大家好:
  我用 flex 开发系统, 系统和一般的基于html web系统一样,有登录页面和主页面, 一般的 web系统 登录成功后是将 url地址转到主页面。在 flex 下 ,我填写了登录信息,点击登录后,该如何转到主页面啊?
  我的系统有一个 login Application, 一个主Application
  login Application 中是一个登录表单(用户名,密码,登录按钮),主Application 是系统功能“页”(一些功能菜单等)
  现在就在 login Application中提交登录信息, 如何转到 主Application 中?

[解决办法]
怎么两个 Application.

一个完全就可以了.

帮助文档有个例子:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle"
horizontalAlign="center" backgroundGradientColors="[0x000000,0x323232]" viewSourceURL="srcview/index.html">

<!-- The Application class states property defines the view states.-->
<mx:states>
<mx:State name="Register">
<!-- Add a TextInput control to the form. -->
<mx:AddChild relativeTo="{loginForm}" 
position="lastChild">
<mx:FormItem id="confirm" label="Confirm:">
<mx:TextInput/>
</mx:FormItem>
</mx:AddChild>

<!-- Set properties on the Panel container and Button control.-->
<mx:SetProperty target="{loginPanel}" 
name="title" value="Register"/>
<mx:SetProperty target="{loginButton}" 
name="label" value="Register"/>

<!-- Remove the existing LinkButton control.-->
<mx:RemoveChild target="{registerLink}"/>

<!-- Add a new LinkButton control to change view state 
back to the login form.-->
<mx:AddChild relativeTo="{spacer1}" position="before">
<mx:LinkButton label="Return to Login" 
click="currentState=''"/>
</mx:AddChild>
</mx:State>
</mx:states>

<mx:Panel id="loginPanel" 
title="Login" color="0xffffff" borderAlpha="0.15"
horizontalScrollPolicy="off" verticalScrollPolicy="off">

<mx:Form id="loginForm" color="0x323232">
<mx:FormItem label="Username:">
<mx:TextInput/>
</mx:FormItem>
<mx:FormItem label="Password:">
<mx:TextInput/>
</mx:FormItem>
</mx:Form>

<mx:ControlBar>
<!-- Use the LinkButton to change to the Register view state.-->
<mx:LinkButton id="registerLink" 
label="Need to Register?" 
click="currentState='Register'"/>
<mx:Spacer width="100%" id="spacer1"/>
<mx:Button label="Login" id="loginButton"/>
</mx:ControlBar>
</mx:Panel>
</mx:Application>

研究研究吧




[解决办法]
PopUpManager类,类里有方法可以调用主界面,调用后,把登陆界面remove掉

具体,可以看看API
------解决方案--------------------


我们做开发的时候也是只有一个Application,只要登录的时候是显示登录页面,正确登录后,将登录页面remove掉,然后调用并显示主页面

热点排行