• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 396
  • Last Modified:

Need to implement Drawer Component in flex3?

Need to implement Drawer Component in flex3?
If possible provide me some sample code.

Below is the link for Drawer Component in flex4, but i need to implement this kind of functionality in flex3.
http://blog.gorillalogic.com/2010/06/01/drawer-component-in-flex-4/
Also provide me step by step process.

Thanks
Alam.
0
alamflex
Asked:
alamflex
1 Solution
 
dgofmanCommented:
You can write very simple implementation like this

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="onComplete()">
	
	<mx:Script>
		<![CDATA[
			private function onComplete():void{
				var s:Array = [];
				for(var i:uint = 65; i <= 122; i++)
					s.push(String.fromCharCode(i));
				txt1.text = s.join(" ").toUpperCase();
				txt2.text = s.join(" ").toLowerCase();
			}

			protected function clickHandler(event:MouseEvent):void{
				var originalY:Number = drawer.height - btn.height;
				moveEffect.end();
				moveEffect.yTo = (popup.y == originalY) ? drawer.height - popup.height : originalY;
				moveEffect.play();
			}

		]]>
	</mx:Script>
	<mx:Move id="moveEffect" target="{popup}"/>

	<mx:Canvas id="drawer" width="500" height="300" backgroundColor="#ffffff" borderStyle="solid" verticalScrollPolicy="off">
		<mx:Text id="txt1" width="100%" height="100%"/>
		<mx:VBox id="popup" x="30" height="100" width="{drawer.width - (popup.x * 2)}" y="{drawer.height - btn.height}" 
				 horizontalAlign="center" verticalGap="0">
			<mx:Button id="btn" label="^" width="20" height="15" cornerRadius="0" paddingLeft="0" paddingRight="0" click="clickHandler(event)"/>
			<mx:HBox width="100%" height="100%" backgroundColor="#cccccc" borderStyle="solid">
				<mx:Text id="txt2" width="100%" height="100%"/>
			</mx:HBox>
		</mx:VBox>
	</mx:Canvas>
</mx:Application>

Open in new window

0

Featured Post

NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now