-private function calcPositionForIndexSelection
(i:Number,sel:Number,c:ChildPosition):void
{
var t:TiltingPane = _children[i];
var selected:TiltingPane = _children[sel];
var adjacent:TiltingPane;
var a:Number = _angle;
if(i == sel)
{
/* if the item we're calculating the
position for _is_ the
selected item,
* then we know exactly where it
goes...smack dab in the middle, at
full size, full scale,
* with an angle of 0.
*/
c.scale = 1;
c.x = unscaledWidth/2 -
t.getExplicitOrMeasuredWidth()/2;
c.y = unscaledHeight/2 -
t.getExplicitOrMeasuredHeight()/2;
c.angle = 0;
}
else if (i < sel)
{
/* otherwise, if it's to the left of the
selected item,
* we want to scale it down to make it
look like it's receding into
the background...
*/
c.scale = (1-_popout);
/* tilt it in towards the selected item */
c.angle = _angle;
/* and push it off to the left. To do that,
we need to calculate
it's position. Most of the children to the left just go a fixed
distance
* from the child to its right, and so we
don't care about their
actual size. But the first child immediately to the left of the
selected child
* is mostly visible, so we need to
position it so that only a
little bit overlaps. Which means we need to know it's size.
* so first, let's calculate the position
of that first child to
the left.
* that's going to be the left edge of the
selected item, minus
approximately 8/10th of the widths of the next item over (since we
want it to
* overlap by about 2/10ths.)
*/
adjacent= _children[sel-1];
var leftBase:Number = unscaledWidth/2 -
selected.widthForAngle(0)/
2 - (adjacent.getExplicitOrMeasuredWidth()/2 +adjacent.widthForAngle(a)
*2/10) * c.scale;
/* now that we know where that first item
to the left sits, we can
calculate the position of our child as a simple fixed distance based
on how many
* children sit between it and that first
item to the left
*/
c.x = leftBase - kPaneOverlap*(sel-1-i),
/* lastly, center it vertically */
c.y = unscaledHeight/2 -
t.getExplicitOrMeasuredHeight()* (1-
_popout)/2;
}
else
{
/* this is basically the same logic as
above, but for children to
the right of the selection. It sets it to
* a negative angle, and calculates the
position as a distance from
the first child to the right of the selection.
*/
c.scale = (1-_popout);
adjacent = _children[sel+1];
var rightBase:Number = unscaledWidth/2 +
selected.widthForAngle
(0)/2 + (adjacent.widthForAngle(-_angle)*3/10 -
adjacent.getExplicitOrMeasuredWidth()/2) * c.scale;
c.angle = -_angle;
c.x = rightBase + kPaneOverlap*(i-(sel+1));
c.y = unscaledHeight/2 -
t.getExplicitOrMeasuredHeight() * (1-
_popout)/2;
}
}
in displayshelf.as
i am not able to trace out problem for null, please help me anyone
knows
thanks in advance
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to flex_india@googlegroups.com
To unsubscribe from this group, send email to
flex_india+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---