⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 welcome.mxml

📁 flex 实现的一个showcase 喜欢flex的朋友可以
💻 MXML
📖 第 1 页 / 共 2 页
字号:
					if (keyboardEvent.currentTarget == createEmailStep1) {
						if (signupFormIsValid == true) {
							signupAction();
						}
					}
				}
			}
			private function loginSignupClickHandler(mouseEvent:MouseEvent):void {
				loginSignup(createEmailStep1.text, createPasswordStep2.text);
			}
			private function passwordSaveButtonClickHandler(mouseEvent:MouseEvent):void {
				userService.user.changePassword.addEventListener(ResultEvent.RESULT, userPasswordSaveResultHandler);
				userService.user.changePassword.addEventListener(FaultEvent.FAULT, userPasswordSaveFaultHandler);
				
				userService.user.changePassword(createEmailStep1.text, createPasswordStep2.text, createNewPasswordStep3.text);
			}
			
			//services----------------------------------------
			
			private function userRegisterResultHandler(resultEvent:ResultEvent):void {
				userService.user.register.removeEventListener(ResultEvent.RESULT, userRegisterResultHandler);
				userService.user.register.removeEventListener(FaultEvent.FAULT, userRegisterFaultHandler);
				
				registerStep1.visible = false;
				registerStep2.visible = true;
				signupFormIsValid = false;
			}
			private function userRegisterFaultHandler(faultEvent:FaultEvent):void {
				userService.user.register.removeEventListener(ResultEvent.RESULT, userRegisterResultHandler);
				userService.user.register.removeEventListener(FaultEvent.FAULT, userRegisterFaultHandler);
				
				Alert.buttonHeight = 31;
				Alert.show("Account already exists.");
			}
			private function userSignupLoginResultHandler(resultEvent:ResultEvent):void {
				userService.user.login.removeEventListener(ResultEvent.RESULT, userSignupLoginResultHandler);
				userService.user.login.removeEventListener(FaultEvent.FAULT, userSignupLoginFaultHandler);
				
				signupUser = UserParser.parse(resultEvent.result);
				
				registerStep2.visible = false;
				registerStep3.visible = true;
				signupFormIsValid = false;
			}
			
			private function userSignupLoginFaultHandler(faultEvent:FaultEvent):void {
				userService.user.login.removeEventListener(ResultEvent.RESULT, userSignupLoginResultHandler);
				userService.user.login.removeEventListener(FaultEvent.FAULT, userSignupLoginFaultHandler);
				
				Alert.buttonHeight = 31;
				Alert.show("Wrong Password.");
			}
			private function userPasswordSaveResultHandler(resultEvent:ResultEvent):void {
				userService.user.changePassword.removeEventListener(ResultEvent.RESULT, userPasswordSaveResultHandler);
				userService.user.changePassword.removeEventListener(FaultEvent.FAULT, userPasswordSaveFaultHandler);
				
				Alert.buttonHeight = 31;
				Alert.show("Registration Complete!");
				
				User.setInstance(signupUser);
				
				show();
			}
			private function userPasswordSaveFaultHandler(faultEvent:FaultEvent):void {
				userService.user.changePassword.removeEventListener(ResultEvent.RESULT, userPasswordSaveResultHandler);
				userService.user.changePassword.removeEventListener(FaultEvent.FAULT, userPasswordSaveFaultHandler);
				
				Alert.buttonHeight = 31;
				Alert.show("Your Old Password did not match. Please try again.");
			}
			
			private function handleForgotMyPassword(mouseEvent:MouseEvent):void {
				forgotPasswordPanel.show();
			}
			
		]]>
	</mx:Script>
	
	
	<mx:EmailValidator id="loginEmailValidator" source="{loginEmail}" property="text" />
	<mx:StringValidator id="loginPasswordValidator" source="{loginPassword}" property="text" minLength="5" />
	<mx:EmailValidator id="signupEmailValidator" source="{createEmailStep1}" property="text" />
	
	<remote:UserService id="userService" flexShowcaseServiceConfig="{flexShowcaseServiceConfig}" />
	
	<mx:HBox width="100%" paddingLeft="47" paddingRight="47" paddingTop="25" horizontalScrollPolicy="off" verticalScrollPolicy="off">
		<mx:VBox id="leftCanvas" horizontalAlign="center" width="50%" paddingRight="40" backgroundAlpha="0" backgroundColor="0x990000">
			<mx:Label text="Welcome"  styleName="myriadBold"  width="100%" horizontalCenter="left" />
			<mx:Text styleName="myriadRegular" width="100%" text="To add a new application, please log in." />
			
			<mx:Spacer height="25" />
			
			<mx:HBox width="100%">
				<mx:HBox width="80" horizontalAlign="right">
					<mx:Label text="Email" styleName="flexLightLabel" />
				</mx:HBox>
				<mx:HBox width="100%">
					<mx:TextInput id="loginEmail" styleName="flexLightTextBox" width="100%" maxChars="{TextRestrictions.SMALL}" change="validateLoginForm(event)" />
				</mx:HBox>
			</mx:HBox>
			
			<mx:HBox width="100%">
				<mx:HBox width="80" horizontalAlign="right">
					<mx:Label styleName="flexLightLabel" text="Password" />
				</mx:HBox>
				<mx:HBox width="100%">
					<mx:TextInput id="loginPassword" styleName="flexLightTextBox" width="100%" maxChars="{TextRestrictions.SMALL}" displayAsPassword="true" change="validateLoginForm(event)" />
				</mx:HBox>
			</mx:HBox>
			
			<mx:Spacer height="10"/>
			
			<mx:Canvas width="100%">
				<mx:Image source="@Embed('/assets/images/backend/welcome/welcomeScreen_button_bg.png', scaleGridTop='5', scaleGridBottom='28', scaleGridLeft='6', scaleGridRight='278')" width="100%" maintainAspectRatio="false" />
				<mx:HBox width="100%"  horizontalAlign="center" verticalCenter="0">
					<mx:Button id="login" styleName="blackButton" label="Login" width="90"
						enabled="{loginFormIsValid}" buttonMode="{loginFormIsValid}" 
						click="loginClickHandler(event)" />
					<mx:Button id="forgotMyInfo" styleName="blackButton" label="Forgot My Password" 
						buttonMode="true" click="handleForgotMyPassword(event);" width="90"/>
				</mx:HBox>
			</mx:Canvas>
		</mx:VBox>
		
		<mx:VRule id="verticalRule" horizontalCenter="0" height="{rightCanvas.height}" />
		
		<mx:VBox id="rightCanvas" width="50%" paddingLeft="40" backgroundAlpha="0" backgroundColor="0x990000">
			<mx:Canvas width="100%">
				<mx:VBox width="100%">
					<mx:Label text="Sign up" styleName="myriadBold" />
					<mx:Text styleName="myriadRegular" width="100%" text="If you haven't added an application before, please create an account." />
				</mx:VBox>
				
				<mx:VBox id="registerStep1" y="83" width="100%" visible="true">
					<mx:Text styleName="myriadRegular" width="100%" color="0x990000" text="Enter your email address to sign up." />
					
					<mx:Spacer height="8"/>
					
					<mx:VBox width="100%">
						<mx:HBox width="100%">
							<mx:HBox width="83" horizontalAlign="right">
								<mx:Label styleName="flexLightLabel" text="Email" />
							</mx:HBox>
							<mx:HBox y="5" horizontalCenter="0" width="100%">
								<mx:TextInput id="createEmailStep1" styleName="flexLightTextBox" width="100%" change="validateSignupForm(event)" />
							</mx:HBox>
						</mx:HBox>
						
						<mx:Spacer height="10"/>
						
						<mx:Canvas width="100%">
							<mx:Image source="@Embed('/assets/images/backend/welcome/welcomeScreen_button_bg.png', scaleGridTop='5', scaleGridBottom='28', scaleGridLeft='6', scaleGridRight='278')" width="100%" maintainAspectRatio="false" />
							<mx:Button styleName="blackButton" horizontalCenter="0" verticalCenter="-1" 
								label="Sign Up" buttonMode="{signupFormIsValid}" width="90"
								enabled="{signupFormIsValid}" click="signupClickHandler(event)" />
						</mx:Canvas>
					</mx:VBox>
				</mx:VBox>
				<mx:VBox id="registerStep2" y="83" width="100%" visible="false">
					<mx:Text styleName="myriadRegular" width="100%" color="0x990000" text="You have been sent an email that contains a temporary password. Enter it below." />
					<mx:HBox width="100%">
						<mx:HBox width="83" horizontalAlign="right">
							<mx:Label styleName="flexLightLabel" text="Email" />
						</mx:HBox>
						<mx:HBox width="100%">
							<mx:TextInput id="createEmailStep2" styleName="flexLightTextBox" width="100%" enabled="false" text="{createEmailStep1.text}" />
						</mx:HBox>
					</mx:HBox> 
					<mx:HBox width="100%">
						<mx:HBox width="83" horizontalAlign="right">
							<mx:Label styleName="flexLightLabel" text="Temp Password" />
						</mx:HBox>
						<mx:HBox width="100%">
							<mx:TextInput id="createPasswordStep2" styleName="flexLightTextBox" width="100%" displayAsPassword="true" />
						</mx:HBox>
					</mx:HBox>
					
					<mx:Spacer height="10"/>
					
					<mx:Canvas width="100%">
						<mx:Image source="@Embed('/assets/images/backend/welcome/welcomeScreen_button_bg.png', scaleGridTop='5', scaleGridBottom='28', scaleGridLeft='6', scaleGridRight='278')" width="100%" maintainAspectRatio="false" />
						<mx:Button styleName="blackButton" horizontalCenter="0" verticalCenter="-1" label="Verify" buttonMode="true" click="loginSignupClickHandler(event)" />
					</mx:Canvas>
				</mx:VBox>
				<mx:VBox id="registerStep3" y="83" width="100%" visible="false">
					<mx:Text styleName="myriadRegular" width="100%" color="0x990000" text="Type in a new password to complete your registration." />
					
					<mx:Spacer height="8"/>
					
					<mx:HBox width="100%">
						<mx:HBox width="83" horizontalAlign="right">
							<mx:Label styleName="flexLightLabel" text="Email" />
						</mx:HBox>
						<mx:HBox width="100%">
							<mx:TextInput id="createEmailStep3" styleName="flexLightTextBox" width="100%" enabled="false" text="{createEmailStep1.text}" />
						</mx:HBox>
					</mx:HBox> 
					<mx:HBox width="100%">
						<mx:HBox width="83" horizontalAlign="right">
							<mx:Label styleName="flexLightLabel" text="Temp Password" />
						</mx:HBox>
						<mx:HBox width="100%">
							<mx:TextInput id="createPasswordStep3" styleName="flexLightTextBox" width="100%" enabled="false" displayAsPassword="true" text="{createPasswordStep2.text}" />
						</mx:HBox>
					</mx:HBox>
					<mx:HBox width="100%">
						<mx:HBox width="83" horizontalAlign="right">
							<mx:Label styleName="flexLightLabel" text="New Password" />
						</mx:HBox>
						<mx:HBox width="100%">
							<mx:TextInput id="createNewPasswordStep3" styleName="flexLightTextBox" width="100%" displayAsPassword="true" change="validateSignupForm(event)" />
						</mx:HBox>
					</mx:HBox> 
					<mx:HBox width="100%">
						<mx:HBox width="83" horizontalAlign="right">
							<mx:Label styleName="flexLightLabel" text="Confirm Password" />
						</mx:HBox>
						<mx:HBox width="100%">
							<mx:TextInput id="confirmNewPasswordStep3" styleName="flexLightTextBox" width="100%" displayAsPassword="true" change="validateSignupForm(event)" />
						</mx:HBox>
					</mx:HBox>
					
					<mx:Spacer height="10"/>
					
					<mx:Canvas width="100%">
						<mx:Image source="@Embed('/assets/images/backend/welcome/welcomeScreen_button_bg.png', scaleGridTop='5', scaleGridBottom='28', scaleGridLeft='6', scaleGridRight='278')" width="100%" maintainAspectRatio="false" />
						<mx:Button styleName="blackButton" horizontalCenter="0" verticalCenter="-1" 
							label="Change" buttonMode="{this.signupFormIsValid}" width="90"
							enabled="{this.signupFormIsValid}" click="passwordSaveButtonClickHandler(event)" />
					</mx:Canvas>
				</mx:VBox>
			</mx:Canvas>
		</mx:VBox>
	</mx:HBox>
	<panels:ForgotPasswordPanel id="forgotPasswordPanel" flexShowcaseServiceConfig="{flexShowcaseServiceConfig}" visible="false" alpha="0" />
	
</mx:Canvas>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -