Flex4 Tree openDuration and openEasingFunction

Nov 30th, 2010 | Posted by Michael

Following example show Tree openDuration and openEasingFunction usage.

TreeDemo1.mxml

<?xml version="1.0" encoding="utf-8"?>
<!--created:Oct 24, 2010 file:TreeDemo1.mxml  author:Michael -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
			   xmlns:s="library://ns.adobe.com/flex/spark"
			   xmlns:mx="library://ns.adobe.com/flex/mx" viewSourceURL="srcview/index.html">
	<fx:Script>
		<![CDATA[
			import mx.events.ListEvent;
			import mx.effects.easing.Circular;

			[Bindable]
			public var selectedNode:XML;

			protected function myTree_itemClickHandler(e:ListEvent):void
			{
				selectedNode=Tree(e.target).selectedItem as XML;
			}
		]]>
	</fx:Script>

	<fx:Declarations>
		<fx:XMLList id="treeData">
			<node label="Mail Box">
				<node label="Inbox">
					<node label="Marketing"/>
					<node label="Product Management"/>
					<node label="Personal"/>
				</node>
				<node label="Outbox">
					<node label="Professional"/>
					<node label="Personal"/>
				</node>
				<node label="Spam"/>
				<node label="Sent"/>
			</node>
		</fx:XMLList>

	</fx:Declarations>

	<s:layout>
		<s:VerticalLayout horizontalAlign="center"
						  verticalAlign="middle"/>
	</s:layout>

	<mx:Tree id="myTree"
			 width="250"
			 height="400"
			 labelField="@label"
			 showRoot="false"
			 dataProvider="{treeData}"
			 itemClick="myTree_itemClickHandler(event)"
			 openDuration="600"
			 openEasingFunction="Circular.easeIn"
			 rollOverColor="0xf7e584"
			 selectionColor="0xabb08c"
			 borderVisible="false"/>

</s:Application>

Demo and Source

Originally posted 2010-10-28 14:49:12.

No comments yet.
*

Popular Arichives