Did you ever get an answer for this or figure out a solution? I'm getting
the samething.
If I create a new Sprite() it works, but if I create a new UIComponent() I
get this same error.
Thoughts?
On 10/9/06, shuell2000 <[EMAIL PROTECTED]> wrote:
I have something that was working and now is throwing an index out of
range error. I have a simple canvas with multiple components
(DisplayObjects) in it. I am looping through them and applying a move
effect to roll them off stage one at a time so that they all start at
different intervals, after the last one on the screen moves off, I set
the ones below the screen automatically instead of moving them then
call the addeventlistener on the move object. What Im trying to
accomplish is to nicely scroll the objects out of sight then kick off
a process that brings in a new set of objects. Here is the code snippet:
var moveOut:Move = null;
var scroller:ThumbnailScroller;
var notified:Boolean = false;
for(var i:Number = 0; i < this.numChildren; i++){
scroller = ThumbnailScroller(this.getChildAt(i));
if(scroller.y < this.height && scroller.visible){
moveOut = new Move(scroller);
moveOut.startDelay = i * 500;
moveOut.xTo = (scroller.width+10)*-1;
moveOut.duration = 2000;
moveOut.play();
}else if(scroller.y > this.height){
if(!notified){
moveOut.addEventListener(EffectEvent.EFFECT_END,
notifyCleanUpComplete);
notified = true;
}
}
}
I am getting the following error:
RangeError: Error #2006: The supplied index is out of bounds.
at flash.display::DisplayObjectContainer/getChildAt()
at mx.core::Container/getChildAt()
at mx.containers.utilityClasses::CanvasLayout/updateDisplayList()
at mx.containers::Canvas/mx.containers:Canvas::updateDisplayList()
at mx.core::UIComponent/validateDisplayList()
at mx.core::Container/validateDisplayList()
at mx.managers::LayoutManager/::validateDisplayList()
at mx.managers::LayoutManager/::doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/::callLaterDispatcher2()
I am at a complete loss as to why this is happening, it was at one
time working as designed but I must have changed something (what, I
cannot tell) that has brought this about. Can anyone see any issues,
especially race-conditions in this setup? I am unschooled in the ways
of effect instances and the documentation on them is sketchy at best.
Can anyone shed some light on this issue or tell me a better more
solid way of accomplishing this? Thanks for listening
John Shuell
--
[ JPG ]