views:

2534

answers:

1

Hello,

in my flex application, I created a Tilelist. In this Tilelist, I am using an ItemRenderer to create a box consisting of an image and an VSlider in each tile.

The tile need to be dragable when you click on the image, but not dragable when you slide the slider. How can I achieve this ? I have been scratching my head searching on Google for one day and I have really no idea.

I look forward to your help. Thank you.

+1  A: 

Hello, I found a solution to my problem, however it may not be the best one.

Using this :

        public var overImage:Boolean = false;

        public function checkAllow(evt:DragEvent):void {

            if(overImage == false)
            {
             evt.preventDefault()
            }
        }

        public function isOverImage():void {
            overImage = true;
        }

        public function isOutImage():void {
            overImage = false;
        }

I call those functions like this :

On my image component

mouseOver="outerDocument.isOverImage()" mouseOut="outerDocument.isOutImage()"

And for my tilelist I did this

Tiles.addEventListener(DragEvent.DRAG_START, checkAllow);

Hope it helps some people.

Blizter