-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
437 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" minWidth="1024" minHeight="768"> | ||
|
||
</mx:Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:view="common.view.*"> | ||
|
||
<view:Register display="true"/> | ||
<view:Login id="login" display="true" login="login.display = false"/> | ||
|
||
<view:MainPanel> | ||
|
||
<mx:ViewStack id="stack" width="100%" height="100%"> | ||
<view:ShowAll/> | ||
<view:Show/> | ||
<view:Edit/> | ||
</mx:ViewStack> | ||
|
||
<mx:ControlBar> | ||
<mx:Button label="Create"/> | ||
<mx:Spacer width="100%"/> | ||
<view:Welcome/> | ||
</mx:ControlBar> | ||
</view:MainPanel> | ||
|
||
</mx:Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" minWidth="1024" minHeight="768"> | ||
|
||
</mx:Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" minWidth="1024" minHeight="768"> | ||
|
||
</mx:Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" minWidth="1024" minHeight="768"> | ||
|
||
</mx:Application> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<mx:Object xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:model="common.model.*"> | ||
|
||
<mx:ArrayCollection id="definitions"> | ||
<model:Definition word="Flex" definition="A sweet component framework for flash"/> | ||
<model:Definition word="ActionScript" definition="An ECMA-based language for flash"/> | ||
<model:Definition word="Deathmatch" definition="A competition in which only one framework can survive"/> | ||
<model:Definition word="Flash" definition="A runtime that's even better than silverlight"/> | ||
</mx:ArrayCollection> | ||
|
||
<mx:ArrayCollection> | ||
<model:User id="fakeUser" username="fake" password="fake"/> | ||
</mx:ArrayCollection> | ||
|
||
</mx:Object> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package common.model | ||
{ | ||
[Bindable] | ||
public class Definition | ||
{ | ||
public var word:String; | ||
public var definition:String; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package common.model | ||
{ | ||
public class Page | ||
{ | ||
public static const LIST:String = "list"; | ||
public static const CREATE:String = "create"; | ||
public static const EDIT:String = "edit"; | ||
public static const SHOW:String = "show"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package common.model | ||
{ | ||
[Bindable] | ||
public class User | ||
{ | ||
public var username:String; | ||
public var password:String; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"> | ||
|
||
<mx:Metadata> | ||
[Event(name="create", type="flash.events.Event")] | ||
[Event(name="cancel", type="flash.events.Event")] | ||
</mx:Metadata> | ||
|
||
<mx:Script> | ||
<![CDATA[ | ||
import common.model.Definition; | ||
[Bindable] public var definition:Definition; | ||
private function submit():void | ||
{ | ||
dispatchEvent(new Event("create")); | ||
} | ||
private function cancel():void | ||
{ | ||
dispatchEvent(new Event("cancel")); | ||
} | ||
]]> | ||
</mx:Script> | ||
|
||
<mx:Form> | ||
<mx:FormItem label="Word"> | ||
<mx:TextInput text="{definition.word}"/> | ||
</mx:FormItem> | ||
|
||
<mx:FormItem label="Definition"> | ||
<mx:TextArea text="{definition.definition}"/> | ||
</mx:FormItem> | ||
|
||
<mx:FormItem direction="horizontal"> | ||
<mx:Button label="Create" click="submit()"/> | ||
<mx:Button label="Cancel" click="cancel()"/> | ||
</mx:FormItem> | ||
</mx:Form> | ||
|
||
</mx:VBox> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%"> | ||
|
||
<mx:Metadata> | ||
[Event(name="update", type="flash.events.Event")] | ||
[Event(name="cancel", type="flash.events.Event")] | ||
[Event(name="remove", type="flash.events.Event")] | ||
</mx:Metadata> | ||
|
||
<mx:Script> | ||
<![CDATA[ | ||
import common.model.Definition; | ||
[Bindable] public var definition:Definition; | ||
private function submit():void | ||
{ | ||
dispatchEvent(new Event("update")); | ||
} | ||
private function cancel():void | ||
{ | ||
dispatchEvent(new Event("cancel")); | ||
} | ||
private function remove():void | ||
{ | ||
dispatchEvent(new Event("remove")); | ||
} | ||
]]> | ||
</mx:Script> | ||
|
||
<mx:Form> | ||
<mx:FormItem label="Word"> | ||
<mx:TextInput text="{definition.word}"/> | ||
</mx:FormItem> | ||
|
||
<mx:FormItem label="Definition"> | ||
<mx:TextArea text="{definition.definition}"/> | ||
</mx:FormItem> | ||
|
||
<mx:FormItem direction="horizontal"> | ||
<mx:Button label="Update" click="submit()"/> | ||
<mx:Button label="Delete" click="remove()"/> | ||
<mx:Button label="Cancel" click="cancel()"/> | ||
</mx:FormItem> | ||
</mx:Form> | ||
|
||
</mx:VBox> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:model="common.model.*"> | ||
|
||
<mx:Metadata> | ||
[Event(name="login", type="flash.events.Event")] | ||
[Event(name="register", type="flash.events.Event")] | ||
</mx:Metadata> | ||
|
||
<mx:Script> | ||
<![CDATA[ | ||
import mx.managers.PopUpManager; | ||
[Bindable] public var error:String; | ||
public function login():void | ||
{ | ||
dispatchEvent(new Event("login")); | ||
} | ||
public function register():void | ||
{ | ||
dispatchEvent(new Event("register")); | ||
} | ||
/** | ||
* Make this popup data-driven | ||
*/ | ||
public function set display(value:Boolean):void | ||
{ | ||
_display = value; | ||
_displayChange = true; | ||
invalidateProperties(); | ||
} | ||
protected var _display:Boolean = false; | ||
protected var _displayChange:Boolean = false; | ||
override protected function commitProperties() : void | ||
{ | ||
super.commitProperties(); | ||
if (_displayChange) | ||
{ | ||
_displayChange = false; | ||
if (_display) | ||
{ | ||
PopUpManager.addPopUp(popup, this, true); | ||
PopUpManager.centerPopUp(popup); | ||
} | ||
else | ||
{ | ||
PopUpManager.removePopUp(popup); | ||
} | ||
} | ||
} | ||
]]> | ||
</mx:Script> | ||
|
||
<model:User id="user"> | ||
<model:username>{username.text}</model:username> | ||
<model:password>{password.text}</model:password> | ||
</model:User> | ||
|
||
<!-- Putting it in an array prevents it from displaying --> | ||
<mx:Array> | ||
<mx:Panel id="popup" title="Login"> | ||
<mx:Form> | ||
<mx:FormItem label="Error" visible="{error != null}" includeInLayout="{error != null}"> | ||
<mx:Label text="{error}" color="#FF0000" fontWeight="bold"/> | ||
</mx:FormItem> | ||
<mx:FormItem label="Username"> | ||
<mx:TextInput id="username" enter="login()"/> | ||
</mx:FormItem> | ||
<mx:FormItem label="Password"> | ||
<mx:TextInput id="password" enter="login()"/> | ||
</mx:FormItem> | ||
</mx:Form> | ||
|
||
<mx:ControlBar> | ||
<mx:Button label="Login" click="login()"/> | ||
<mx:Button label="Create an Account" click="register()"/> | ||
</mx:ControlBar> | ||
</mx:Panel> | ||
</mx:Array> | ||
|
||
|
||
</mx:Canvas> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" verticalCenter="0" horizontalCenter="0" width="600" height="400" title="Dictionary"> | ||
|
||
</mx:Panel> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:model="common.model.*"> | ||
|
||
<mx:Metadata> | ||
[Event(name="register", type="flash.events.Event")] | ||
[Event(name="cancel", type="flash.events.Event")] | ||
</mx:Metadata> | ||
|
||
<mx:Script> | ||
<![CDATA[ | ||
import mx.managers.PopUpManager; | ||
[Bindable] public var error:String; | ||
public function register():void | ||
{ | ||
dispatchEvent(new Event("register")); | ||
} | ||
public function cancel():void | ||
{ | ||
dispatchEvent(new Event("cancel")); | ||
} | ||
/** | ||
* Make this popup data-driven | ||
*/ | ||
public function set display(value:Boolean):void | ||
{ | ||
_display = value; | ||
_displayChange = true; | ||
invalidateProperties(); | ||
} | ||
protected var _display:Boolean = false; | ||
protected var _displayChange:Boolean = false; | ||
override protected function commitProperties() : void | ||
{ | ||
super.commitProperties(); | ||
if (_displayChange) | ||
{ | ||
_displayChange = false; | ||
if (_display) | ||
{ | ||
PopUpManager.addPopUp(popup, this, true); | ||
PopUpManager.centerPopUp(popup); | ||
} | ||
else | ||
{ | ||
PopUpManager.removePopUp(popup); | ||
} | ||
} | ||
} | ||
]]> | ||
</mx:Script> | ||
|
||
<model:User id="user"> | ||
<model:username>{username.text}</model:username> | ||
<model:password>{password.text}</model:password> | ||
</model:User> | ||
|
||
<!-- Putting it in an array prevents it from displaying --> | ||
<mx:Array> | ||
<mx:Panel id="popup" title="Register"> | ||
<mx:Text text="Please choose a username and password" width="300" paddingLeft="10" paddingTop="10" paddingRight="10"/> | ||
<mx:Form> | ||
<mx:FormItem label="Error" visible="{error != null}" includeInLayout="{error != null}"> | ||
<mx:Label text="{error}" color="#FF0000" fontWeight="bold"/> | ||
</mx:FormItem> | ||
<mx:FormItem label="Username"> | ||
<mx:TextInput id="username"/> | ||
</mx:FormItem> | ||
<mx:FormItem label="Password"> | ||
<mx:TextInput id="password"/> | ||
</mx:FormItem> | ||
</mx:Form> | ||
|
||
<mx:ControlBar> | ||
<mx:Button label="Sign Me Up!" click="register()"/> | ||
<mx:LinkButton label="Cancel" click="cancel()"/> | ||
</mx:ControlBar> | ||
</mx:Panel> | ||
</mx:Array> | ||
|
||
</mx:Canvas> |
Oops, something went wrong.