Hi Guys I fixed it I added the container as addChildAt(container,0).
Thanks for ur patience.
Anuj

On Fri, Mar 28, 2008 at 2:17 PM, anuj sharma <[EMAIL PROTECTED]> wrote:

> Hi
> I am trying to check if objects of 2 different type overlaps or not. I
> have a CameraStartDrag which is activated by on press of MovieClip. I have
> some container of type Sprite which contains UI Loader component. All i need
> is if user takes CameraStartDrag on top of UILoader, the CameraStartDrag's
> index should come on top of UILoader. Currently CameraStartDrag is going
> back of UILoader. Attached is the code.
> Please help me out as this problem is making me crazy.
> Thanks
>
>
> for (var j:Number=1; j<=16; j++)
> {
>     var CameraStartDrag;
>
>     //Getting all the thumbnails by Name for dragging on stage
>     CameraStartDrag=getChildByName("Thumbnail_"+j);
> }
> CameraStartDrag.addEventListener(MouseEvent.MOUSE_DOWN,CamStartDragTN);
> var container:Sprite=new Sprite();
> function CamStartDragTN(event:MouseEvent):void
> {
> var CameraStartDrag=event.target;
>         CameraStartDrag.startDrag();
>         if(container.numChildren>0)
>         {
>         for (var z:Number=0; z<=container.numChildren-1; z++)
>         {
>             var Child:DisplayObject=container.getChildAt(z);
>             if(CameraStartDrag.hitTestObject(Child))
>             {
>                 trace("Object Hit");
>             }
>         }
>         }
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to