Using the New Library and Definition Tags in Flex 4

4 Sep
2008
Delicious

So These Tags were in Ely’s Greenfield Video talking about how to make an Interactive List, Basically You can think of these tags as creating symbols or short definitions of a small component that you would like to make and keep reusing over and over again. Example: You want to construct a dozen panels and each of them has to have the same thing inside of them. It is a pretty simple concept once you see the code but could be pretty powerful. To better understand here is the code and the example. Need Flash Player 10 to view it, and I am using the Latest Flex 4 SDK.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="library:adobe/flex/halo"
	xmlns="http://ns.adobe.com/mxml/2009"
	xmlns:ns="library:adobe/flex/gumbo">
 
<Library>
	<Definition name="myNewSymbol">
		<!--So THe NEw Symbol Is just going to Contain an Button and a Text-->
		<ns:Group layout="flex.layout.VerticalLayout">
			<ns:TextGraphic text="Hello This Is Part of The Symbol"/>
			<ns:Button label="I am also Part of the Symbol"/>
		</ns:Group>
	</Definition>
</Library>
 
<!--So We instantiate the Symbol by calling the Definition 
                                                    Name and that is it-->
	<mx:Canvas>
		<myNewSymbol/>
	</mx:Canvas>
</mx:Application>

Visit the Forums if you have any other questions.
Example:

Incoming Search Terms :flex 4 library , flex 4 libraries , Flex 4 animate , library in flex 4 , how to make symbol definition in flex , flex library Definition tag , flex 4 using library , flex 4 mask , Flex 4 Application Library , xmlns:ns=”library:adobe/flex/gumbo

Share this story with a friend !
Join SherifAbdou's Rss Feed Stumble This Article! Add this to your Delicious Bookmarks! Digg this story ! Add this story to Reddit ! Tweet This Brush


1 Response to Using the New Library and Definition Tags in Flex 4

Avatar

supersevaNo Gravatar

September 5th, 2008 at 4:03 am

uh, that would be very nice, especialy if we get some AS metods with wich we can go through library , fetch some items dynamicaly, and stuff…I can see this can be very handy.

Comment Form