Patterson Consulting, Inc
  • Blog
  • |
  • About
  • |
  • Labs
  • |
  • Published Work
  • |
  • Recent Projects
  • |
  • Presentations
  • |
  • Contact
Patterson Consutling, Inc

    Search


    Category

  • ActionScript
  • Adobe
  • AIR
  • Apollo
  • ColdFusion
  • Conferences
  • ECMAScript
  • Facebook
  • Flash
  • Flex
  • General
  • Javascript/DHTML
  • MN.swf
  • Silverlight
  • Technology
  • XML/XSLT/XML Schema

    Archive

  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • 2004


Adding Multiple Children in a Flex State

by Danny Patterson on January 25th, 2008

Many times I’ve had to add multiple children in a Flex state. Take the following simple example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
< ?xml version="1.0" encoding="utf-8"?>
<mx :Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
	<mx :Label id="topLabel" text="Top" />
	<mx :Button label="showChildren" click="currentState='children';" />
	</mx><mx :states>
		</mx><mx :State name="children">
			</mx><mx :AddChild relativeTo="{topLabel}" position="after">
				<mx :Label text="third" />
			</mx>
			<mx :AddChild relativeTo="{topLabel}" position="after">
				<mx :Label text="second" />
			</mx>
			<mx :AddChild relativeTo="{topLabel}" position="after">
				<mx :Label text="first" />
			</mx>

more…

3 Comments


Atom | RSS | © 2008 Patterson Consulting, Inc