Home Tutorial Flex Flex4 Components Spark Container in Flex 4

 
 

Share on Google+Share on Google+
Spark Container in Flex 4
Posted on: April 24, 2010 at 12:00 AM
Advertisement
The container provides content area that contains its child component. The size of the content area is set by the container.

Spark Container in flex4:

The container provides content area that contains its child component. The size of the content area is set by the container. If you want to create a application then you require at least one container and after that you can added one or more child containers  of the main container. These child container also contain many of child container for developing a typical application.

There are two type of container in Flex 4 one is Spark Containers and other is MX containers but we have discuss about container.

In this example you can see how to use container in the application.

Example:

 

<?xml version="1.0" encoding="utf-8"?>

<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">

<s:Panel title="Container Example ">

<s:Button label="Submit" id="Sbutton"/>

</s:Panel>

</s:Application>

This example have two Spark Container one is application container and other is Spark panel container. The application container is parent container that contain panel container as a child. The user can set width and height properties for a container to define the content area for the childs component as you can see in this example. The user can set the layout for containers. The container have properties to set sizing and position for the components. There are two
type of containers used in typical application one is main container and other is child's container . In this example you can see application container is main container and panel container is child container.

Output:

Running Application:

To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.

Download this code

Advertisement

Related Tags for Spark Container in Flex 4:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 24, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com