0% found this document useful (0 votes)
21 views1 page

Tile

This document contains an MXML application that uses a Repeater component to display 9 buttons in a 3x3 grid layout using a Tile container. The Repeater loops through an array data provider to generate a button for each item, displaying its index as the label. When clicked, an alert pops up with the button's index.

Uploaded by

Enrique Barrios
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views1 page

Tile

This document contains an MXML application that uses a Repeater component to display 9 buttons in a 3x3 grid layout using a Tile container. The Repeater loops through an array data provider to generate a button for each item, displaying its index as the label. When clicked, an alert pops up with the button's index.

Uploaded by

Enrique Barrios
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

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

>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
<mx:Script>
<![CDATA[

import mx.controls.Alert;

[Bindable]
private var dp:Array = [1, 2, 3, 4, 5, 6, 7, 8, 9];

]]>
</mx:Script>

<mx:Panel title="Repeater Example" width="75%" height="75%"


paddingTop="10" paddingLeft="10" paddingRight="10"
paddingBottom="10">

<mx:Text width="100%" color="blue"


text="Use the Repeater class to create 9 Button controls in a
3 by 3 Tile container."/>

<mx:Tile direction="horizontal" borderStyle="inset"


horizontalGap="10" verticalGap="15"
paddingLeft="10" paddingTop="10" paddingBottom="10"
paddingRight="10">

<mx:Repeater id="rp" dataProvider="{dp}">


<mx:Button height="49" width="50"
label="{String(rp.currentItem)}"

click="Alert.show(String(event.currentTarget.getRepeaterItem()) + '
pressed')"/>
</mx:Repeater>
</mx:Tile>

</mx:Panel>

</mx:Application>

You might also like