I sometimes get this error during runtime and I have no idea
what cause it. The mouse disappears on the window. Anybody?

RangeError: Error #2006: The supplied index is out of bounds.

at flash.display::DisplayObjectContainer/addChildAt()

at mx.managers::WindowedSystemManager/
http://www.adobe.com/2006/flex/mx/internal::rawChildren_addChildAt()[E :\dev\3.0.x\frameworks\projects\airframework\src\mx\managers\WindowedS ystemManager.as:1568

at
mx.managers::WindowedSystemChildrenList/addChild()[E:\dev\3.0.x\frame works\projects\airframework\src\mx\managers\WindowedSystemChildrenList .as:111]

at
mx.managers::CursorManagerImpl/showCurrentCursor()[E:\dev\3.0.x\frame works\projects\framework\src\mx\managers\CursorManagerImpl.as:491]

at
mx.managers::CursorManagerImpl/setCursor()[E:\dev\3.0.x\frameworks\pr ojects\framework\src\mx\managers\CursorManagerImpl.as:351]

at mx.containers::DividedBox/
http://www.adobe.com/2006/flex/mx/internal::changeCursor()[E:\dev\3.0. x\frameworks\projects\framework\src\mx\containers\DividedBox.as:881

at
mx.containers.dividedBoxClasses::BoxDivider/mouseOverHandler()[E:\dev \3.0.x\frameworks\projects\framework\src\mx\containers\dividedBoxClass es\BoxDivider.as:312]

|||
A simple sample with source code reproducing the symptom
would be helpful.
|||
Hi! I have the exact same problem.

A very simple sample can be seen here:
http://www.norbykovacs.com/flextest/testLabel.html

Open up the popup, the close it, then move your mouse over
the handle of the divider. It throws the same error as above. Check
out the source, it’s nothing special unless I’m missing
something.
|||
Hi norbykov,

In your sample, you are calling createPopup() which will
create the popup and add it as well. If you comment out your call
to addPopup() your problem should be fixed. (Actually, you new
Pop() would be wasted because createPopup does that as well)

Ideally, you should remove the event listener for cancel as
well in your closeHandler (no anonymous event handlers please!) so
that garbage collector can free that memory .

Please see the code below:

<?xml version=”1.0″ encoding=”utf-8″?>

<mx:Application xmlns:mx=”
http://www.adobe.com/2006/mxml”
layout=”absolute” borderStyle=”inset”
viewSourceURL=”srcview/index.html”>

<mx:Script>

<![CDATA[

import flash.events.Event;

import flash.display.*;

import mx.managers.PopUpManager;

var popup:Pop;

private function closeHandler(evt:Event):void

{

PopUpManager.removePopUp(popup);

popup.removeEventListener("cancel", closeHandler);

popup = null;

}

private function openpop():void

{

popup = PopUpManager.createPopUp(this,Pop,true) as Pop;

popup.addEventListener("cancel", closeHandler);

}

]]>

</mx:Script>

<mx:HDividedBox x=”0″ y=”0″ width=”100%” height=”200″>

<mx:Canvas>

<mx:Label text=”asda” />

</mx:Canvas>

<mx:Canvas>

<mx:Button label=”open” click=”openpop()” />

</mx:Canvas>

</mx:HDividedBox>

</mx:Application>

|||
Thanks anirudhs,

I guess that’s what I get for not reading the documentation
thoroughly. :)

Thanks again!

Related posts:

  1. RangeError: Error #2006: The supplied index is out of bounds.
  2. The supplied DisplayObject must be a child of the caller.
  3. Argument Error
  4. TileList problem with effects – ‘RangeError: Index ‘8′ specified is out of bounds.’ error.
  5. Why alert casting error when module url changed?

Related posts brought to you by Yet Another Related Posts Plugin.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2012 free icons download Suffusion theme by Sayontan Sinha

Featuring Recent Posts WordPress Widget development by YD