Here is an example that shows several options.  Note, since I created
this example, I have been moving toward using events more heavily.  The
example does not explore using events.
http://www.cflex.net/showFileDetails.cfm?ObjectID=558
Tracy

-----Original Message-----
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Ben Dover
Sent: Saturday, February 09, 2008 1:17 PM
To: [email protected]
Subject: [flexcomponents] Getting values from a tileList to appear on a
popup

Hello, I'm very new to flex, and I'm trying to develop an application
that acts lik an online store. In my program I am laying out my items
using tileList, and what I want it to do is that when I click each
object in the tileList, I want a pop up window to show up with
information about the product.

I'm having trouble understanding how to bind the selectedItem and
passing values from that to the popup window, pointing me in the right
direction or some form of an example would be extremely helpful.

Thanks in advance!!

-Hoi

--

Code for my main application "Test.mxml":

<mx:Application
xmlns:mx="http://www.adobe. com/2006/ mxml"
horizontalAlign= "center" verticalAlign= "middle"
width="960" height="540"
layout="absolute"
backgroundColor= "white"
>

<mx:Model id="products" source="products. xml"/>

<mx:Script>
<![CDATA[

import mx.managers. PopUpManager;
import mx.core.IFlexDispla yObject;

public var popUpWindow: IFlexDisplayObje ct;

public function showPopUp(): void
{
popUpWindow = PopUpManager. createPopUp( this, ViewWindow, true);
}

]]>
</mx:Script>

<mx:Panel
id="mainPanel1"
width="700" height="100% "
layout="horizontal"
headerHeight= "0" borderStyle= "solid"
shadowDistance= "0" borderThickness= "1" cornerRadius= "0" alpha="1"
borderColor= "#000000" >


<mx:TileList
id="List"

width="100%" height="100% "
rowHeight="200" columnWidth= "85"
verticalAlign= "middle" horizontalCenter= "5"
rollOverColor= "#000000" selectionColor= "#FFFFFF"

dataProvider= "{products. bottle}"
itemRenderer= "TileListItemRen derer"
itemClick="showPopU p();"
/>

</mx:Panel>

</mx:Application>

Code for my pop up window "ViewWindow. mxml":

<?xml version="1.0" ?>
<mx:TitleWindow
xmlns:mx="http://www.adobe. com/2006/ mxml"
creationComplete= "popUpCenter( );" showCloseButton= "true"
close="PopUpManager .removePopUp( this)"
width="800" height="450"
title="{data. selectedItem. brand}">
<mx:Script>
<![CDATA[
import mx.managers. PopUpManager;

private function popUpCenter( ):void
{
PopUpManager. centerPopUp( this);
}
]]>
</mx:Script>

<mx:VBox width="100%" verticalCenter= "0">
<mx:Image source="{data. selectedItem. thumb}"/>
</mx:VBox>


</mx:TitleWindow>



 
Yahoo! Groups Links





Reply via email to