Skip to content
wezside edited this page Apr 7, 2011 · 2 revisions

There are a number of components built with the Toolkit architecture. Below is a list with a short example of how to use each one. Each component follows the life-cycle of the UIElement which is the core architecture for building Toolkit components. Read more on the life-cycle and structure here.

Accordion

A bare-bones Accordion component. Extend Accordion and AccordionItem to customise this component and add animations when state changes.

	var itemA:IAccordionItem = new AccordionItem();
	itemA.header = headerDisplayObject;
	itemA.content = contentDisplayObject; 
		
	var acc:Accordion = new Accordion();
	acc.addItem( itemA );
	addChild( acc );

Gallery

A framework for building advanced Gallery components. Supports grid layouts and custom transitions. Useful just as is or with extended functionality. The creation policy for this component is to construct and purge a gallery per page. This allows for only loading the images required on screen. This impacts transitions where it is required to have the next items visible on screen before the current gallery items have been removed.

	gallery = new Gallery();
	gallery.debug = false;
	gallery.reflectionRowHeight = 1;
	gallery.columns = 4;
	gallery.rows = 3;
	gallery.horizontalGap = 1;
	gallery.verticalGap = 1;
	gallery.init( items );
	gallery.x = 30;
	gallery.y = 30;	
	gallery.addEventListener( GalleryEvent.ARRANGE_COMPLETE, galleryArrangeComplete );
	addChildAt( gallery, 0 );
Clone this wiki locally