The flag gets cleared later.

 

I filed a player issue for this.  localToGlobal is not correct when we
ask the player to scroll the contents.  You may simply have to add the
x,y to the vertical/horizontalScrollPosiition (and offset by viewMetrics
if necessary) as a workaround for now.

 

-Alex

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Rick Schmitty
Sent: Tuesday, November 13, 2007 11:11 AM
To: [email protected]
Subject: Re: [flexcoders] ScrollEvent.SCROLL -- what comes after?

 

I'm still lost by this... Shouldnt the updateCompletePendingFlag be
false when updateComplete event is fired

I tried to update the example application to make it more obvious, the
debug call shows the correct tracking point and false for the flag,
while updateComplete shows true for the flag and isnt in the correct
position

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> " layout="absolute">
<mx:Script>
<![CDATA[
import mx.events.ScrollEvent; 

private function onUpdateComplete():void {
trace("update green tracker");
trace(container.updateCompletePendingFlag);
var p:Point=getPoint();
canvas.graphics.clear();
drawPoint(p,0x00ff00);
} 

private function debug():void {
trace("debug blue tracker"); 
trace(container.updateCompletePendingFlag);
var p:Point=getPoint();
drawPoint(p,0x0000ff); 
} 

private function getPoint():Point {
// top left corner of box is always 0,0
var p:Point=new Point(0,0);
// return the canvas's xy position of box relative to stage 
var globalPoint:Point=box.localToGlobal(p);
trace(globalPoint);
return globalPoint;
}

private function drawPoint(p:Point,color:uint):void {
// canvas is
canvas.graphics.lineStyle(2,color);
canvas.graphics.drawCircle(p.x,p.y,4); 
}


]]>
</mx:Script>

<mx:Container id="container" width="500" height="500"
updateComplete="onUpdateComplete()" >

<!-- object we want to track -->
<mx:Box id="box" backgroundColor="0xff0000" backgroundAlpha="0.5"
x="100" y="100" width="200" height="200"/>

<!-- some large object to cause scrollbars -->
<mx:UIComponent width="800" height="800"/>

</mx:Container>

<mx:Button label="debug" click="debug()" x="550"/>

<!-- just something on top of everything else to see the graphics -->
<mx:Canvas id="canvas" x="0" y="0" width="100%" height="100%"/>

</mx:Application>

On Nov 8, 2007 2:16 PM, Rick Schmitty <[EMAIL PROTECTED]
<mailto:flexcode%40gmail.com> > wrote:
> 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]
<mailto:aharui%40adobe.com> > 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:flexcoders%40yahoogroups.com>
[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> > Behalf Of Rick Schmitty
> > Sent: Wednesday, November 07, 2007 3:31 PM
> > To: [email protected] <mailto:flexcoders%40yahoogroups.com>

> > 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
<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]
<mailto:aharui%40adobe.com> > wrote:
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > updateComplete
> > >
> > >
> > >
> > > ________________________________
> > >
> > >
> > > From: [email protected]
<mailto:flexcoders%40yahoogroups.com>
[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> > > Behalf Of Rick Schmitty
> > > Sent: Wednesday, November 07, 2007 1:42 PM
> > > To: [email protected]
<mailto:flexcoders%40yahoogroups.com> 
> > > 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!
> > >
> > >
> >
> >
> >
> > 
>

 

Reply via email to