The 2nd option didnt move the tracking graphics for me and the first option produced the same results: updateComplete placement was lagged behind where the debug button places it.
Here is the traceoutput if you cant run it, my notes in ** The x,y values is where I trace the variable p which is generated by the same localToGlobal function ** movie done loading ** update green (x=200, y=200) ** next i scroll the container ** update green (x=200, y=200) update green (x=193, y=200) update green (x=188, y=200) ** now I click the debug button a few seconds later and do not touch anything else ** debug blue (x=181, y=200) ** in this case updateComplete was 7 pixels off where the object stopped actually scrolling ** On Nov 7, 2007 9:49 PM, Alex Harui <[EMAIL PROTECTED]> wrote: > > I didn't run it, but I think you're off a level. Normally you either do: > > > > var p:Point=box.localToGlobal(new Point(box.width,box.height)) > > > > or > > > > var p:Point=box.parent.localToGlobal(new > Point(box.x+box.width,box.y+box.height)) > > > > because 'local' is local to box or box.parent. > > > > ________________________________ > > > From: [email protected] [mailto:[EMAIL PROTECTED] On > Behalf Of Rick Schmitty > Sent: Wednesday, November 07, 2007 3:31 PM > To: [email protected] > Subject: Re: [flexcoders] ScrollEvent.SCROLL -- what comes after? > > > > > > > > > Am I using/understanding updateComplete correctly? If you run this > sample file, scroll with the mousewheel or the scrollbars it will > trace the scroll and updateComplete values. But if you hit the debug > button it shows things arent the same. Sometimes within a few pixels > othertimes up to 24 pixel difference > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > layout="absolute"> > <mx:Script> > <![CDATA[ > private function update():void { > trace("update green"); > var p:Point=box.localToGlobal(new Point(box.x+box.width,box.y+box.height)) > trace(p); // lower right corner of box > canvas.graphics.clear(); > canvas.graphics.lineStyle(2,0x00ff00); > canvas.graphics.drawCircle(p.x,p.y,4); > } > > private function debug():void { > trace("debug blue"); > var p:Point=box.localToGlobal(new Point(box.x+box.width,box.y+box.height)) > trace(p); // lower right corner of box > canvas.graphics.lineStyle(2,0x0000ff); > canvas.graphics.drawCircle(p.x,p.y,4); > } > ]]> > </mx:Script> > > <mx:Canvas width="500" height="500" updateComplete="update()"> > > <!-- object we want to track --> > <mx:Canvas id="box" backgroundColor="0xff0000" backgroundAlpha="0.5" > width="200" height="200"/> > > <!-- some large object to cause scrollbars --> > <mx:Canvas width="800" height="800" backgroundColor="0xff0000" > backgroundAlpha="0.1"/> > > </mx:Canvas> > > <mx:Button label="debug" click="debug()" x="550"/> > > <!-- just something on top of everything else to see the graphics --> > <mx:Canvas id="canvas"/> > > </mx:Application> > > On Nov 7, 2007 2:13 PM, Alex Harui <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > > > > > > > updateComplete > > > > > > > > ________________________________ > > > > > > From: [email protected] [mailto:[EMAIL PROTECTED] On > > Behalf Of Rick Schmitty > > Sent: Wednesday, November 07, 2007 1:42 PM > > To: [email protected] > > Subject: [flexcoders] ScrollEvent.SCROLL -- what comes after? > > > > > > > > > > > > > > > > From the docs it says "At the time when this event is dispatched, the > > scrollbar has been updated to the new position, but the container's > > child objects have not been shifted to reflect the new scroll > > position." What should I be listening for when the container's child > > object have finished shifting? > > > > Thanks in advance! > > > > > > > >

