Link to home
Start Free TrialLog in
Avatar of activeRoy
activeRoy

asked on

A button & image inside a tileList

                    <mx:TileList width="100%" height="100%" id="product_tile" itemRenderer="CustomItemRenderer" 
					columnCount="4" 
					styleName="tile1"
					itemClick="tileList_itemClick(event)">

Open in new window

private function tileList_itemClick(evt:ListEvent):void { 
                img = new Image(); 
                // img.width = 300; 
                // img.height = 300; 
                img.maintainAspectRatio = true; 
                img.addEventListener(Event.COMPLETE, image_complete); 
                img.addEventListener(ResizeEvent.RESIZE, image_resize); 
                img.addEventListener(MouseEvent.MOUSE_OUT, image_click); 
				img.addEventListener(MouseEvent.MOUSE_DOWN, image_start_drag);
				img.addEventListener(MouseEvent.MOUSE_UP, image_stop_drag);				
                img.source = "http://localhost/funktion/templates/index/productimg/big/" + noS(evt.itemRenderer.data.spic);
				//Alert.show(img.source.toString());
                img.setStyle("addedEffect", image_addedEffect); 
                img.setStyle("removedEffect", image_removedEffect); 
                if (evt.itemRenderer.data.spic != "no_photo80x80.gif") {
				PopUpManager.addPopUp(img, this, true); 
		}
				
            

Open in new window

<?xml version="1.0" encoding="utf-8"?> 
<!-- http://blog.flexexamples.com/2008/03/08/creating-a-simple-image-gallery-with-the-flex-tilelist-control/ --> 
<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" 
        horizontalAlign="center" 
        verticalAlign="middle" width="150" height="180">  
  

	<mx:Image source="http://localhost/funktion/templates/index/productimg/{data.spic}" />
    <mx:TextArea text="{data.name}" styleName="myFontStyle" wordWrap="true" editable="false" /> 
	<mx:Button label="details"  />


  
</mx:VBox>

Open in new window


The problem is, the tilelist itemClick will cover the button onclick or the image click function. that means,
i only want to click the image to enlarge the image, and click the button show alert box. But now, i click the button (actually clicking the tile item), will also enlarge the image and show the alert box....
ASKER CERTIFIED SOLUTION
Avatar of mbiqbal
mbiqbal
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of activeRoy
activeRoy

ASKER

RE:

I fixed my problem by myself........ thanks