forked from: flash on 2010-2-6

by kuroro91 forked from flash on 2010-2-6 (diff: 1)
♥2 | Line 66 | Modified 2011-12-22 19:41:42 | MIT License
play

ActionScript3 source code

/**
 * Copyright kuroro91 ( http://wonderfl.net/user/kuroro91 )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/uO0O
 */

<?xml version="1.0" encoding="utf-8"?>
<!-- forked from marcsali's flash on 2010-2-6 -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
	<mx:states>
		<mx:State name="Logged In">
			<mx:SetProperty target="{panel1}" name="width"  value="95%"/>
			<mx:SetProperty target="{panel1}" name="height" value="95%"/>
			<mx:RemoveChild target="{password}"/>
			<mx:RemoveChild target="{username}"/>
			<mx:RemoveChild target="{label1}"/>
			<mx:RemoveChild target="{Submit}"/>
			<mx:RemoveChild target="{label2}"/>
			<mx:SetProperty target="{panel1}" name="title" value="Members Section"/>
			<mx:AddChild relativeTo="{panel1}" position="lastChild">
			<mx:Label x="10" y="10" text="Welcome to the Members Section!"/>
			</mx:AddChild>
			<mx:AddChild relativeTo="{panel1}" position="lastChild">
				<mx:Label x="10" y="36" text="Here you can do great things, like join the forums @ Viper Creations!"/>
			</mx:AddChild>
			<mx:AddChild relativeTo="{panel1}" position="lastChild">
				<mx:Label x="10" y="62" text="Label"/>
			</mx:AddChild>
		</mx:State>
	</mx:states>
	<mx:Script>
		<![CDATA[
			import mx.rpc.events.ResultEvent;
			
		]]>
	</mx:Script>
	<mx:Script>
	

<![CDATA[

private function checkLogin(evt:ResultEvent):void
{

	if(evt.result.loginsuccess == "yes")

	{

	currentState = "Logged In";

	}

	if(evt.result.loginsuccess == "no")

	{
		
	mx.controls.Alert.show('Invalid username/password');

	}		
}

]]>
</mx:Script>
<mx:HTTPService id="login_user" result="checkLogin(event)" showBusyCursor="true" method="POST" url="http://www.vipercreations.com/site_admin/login.php" useProxy="false">
	<mx:request xmlns="">
	<username>
	   {username.text}
	</username>
	<password>
	   {password.text}
	</password>
</mx:request>
</mx:HTTPService>
<mx:Panel resizeEffect="Resize" width="300" height="160" layout="absolute" title="Login System" horizontalCenter="0" verticalCenter="-2" id="panel1"  backgroundColor="#006699" >
<mx:Form id="loginForm" backgroundAlpha="0.5" backgroundColor="#116699" >
<mx:FormItem label="Username:" id="label1" >
<mx:TextInput id="username" />
</mx:FormItem>
<mx:FormItem label="Password:" id="label2" >
<mx:TextInput id="password" displayAsPassword="true"/>
</mx:FormItem>
</mx:Form>
<mx:Button x="120" y="90" label="Submit" id="Submit" click="login_user.send();"/>
</mx:Panel>
</mx:Application>