Flex Folk,
I apologize for this lengthy posting but I'm struggling and could use
some help!
I've got got 20 custom components that I'm laying out in a spiral
pattern on a custom container. I'm trying to use the scaleX and scaleY
properties of the children to make the children on the outside of the
spiral larger than the children on the inside... but I'm striking out...
[:(]
I've implemented the measure method of the children as follows:
override protected function measure():void {
super.measure();
measuredWidth=110;
measuredMinWidth=50;
measuredHeight=110;
measuredMinHeight= 110;
}
In the updateDisplayList method of the container I'm setting the scaleX
and scaleY properties of each child in an attempt to gradually vary the
size of each child from larger than 110 px (scale greater than 1) to
smaller than 110 (scale less than 1) as the they go from the outer part
of the spiral to the inner part.
However, all the children appear exactly the same size... So I used
trace within a resize event handler on the children and the
updateDisplayList method of the container to try to figure out what's
going on... Here's what I found
The first output is from the resize handler on the children and looks
like what I'd expect-- measured at 110x110 with default scaling and
positioning
child resize event--> measured w/h: 110/110 explicit w/h: NaN/NaN normal
w/h: 110/110 x/y: 0/0 scaleX/Y: 1/1
child resize event--> measured w/h: 110/110 explicit w/h: NaN/NaN normal
w/h: 110/110 x/y: 0/0 scaleX/Y: 1/1
child resize event--> measured w/h: 110/110 explicit w/h: NaN/NaN normal
w/h: 110/110 x/y: 0/0 scaleX/Y: 1/1
...
Next I get this output from the parent's updateDisplayList method. The
dimensions are still what I expected. The updateDisplayList method
launches a Move effect on each child to move it to it's initial position
in the spiral so it makes sense that x/y are still at zero. The scale
properties are now set appropriately and I would expect the children to
be showing up at different sizes at this point:parent
updateDisplayList-->measured w/h: 110/110 explicit w/h: NaN/NaN normal
w/h: 110/110 x/y: 0/0 scaleX/Y: 0.5/0.5
parent updateDisplayList-->measured w/h: 110/110 explicit w/h: NaN/NaN
normal w/h: 110/110 x/y: 0/0 scaleX/Y: 0.535/0.535
parent updateDisplayList-->measured w/h: 110/110 explicit w/h: NaN/NaN
normal w/h: 110/110 x/y: 0/0 scaleX/Y:
0.5700000000000001/0.5700000000000001
...
OK, here's where I start getting confused... Now there's another resize
event handled by each of the children which gives the following output.
I'm not sure why/how the children are getting resized since I'm not
expliciting setting their width or height. Does setting the scale
properties cause a resize event?
child resize event--> measured w/h: 55/55 explicit w/h: NaN/NaN normal
w/h: 55/55 x/y: 3.4000000000000004/2.3000000000000003 scaleX/Y: 0.5/0.5
child resize event--> measured w/h: 58.85/58.85 explicit w/h: NaN/NaN
normal w/h: 58.85/58.85 x/y: 4.05/2 scaleX/Y: 0.535/0.535
child resize event--> measured w/h: 62.70000000000001/62.70000000000001
explicit w/h: NaN/NaN normal w/h: 62.70000000000001/62.70000000000001
x/y: 4.65/1.8 scaleX/Y: 0.5700000000000001/0.5700000000000001
...
>From here on out the only output is from the parent's updateDisplayList
method. Even though the w/h show 55, 58, 62, etc. on screen each
child is exactly the same size! Somehow the onscreen dimensions are
equal to the measured dimensions divided by the scale properties and I
don't know why the measuredWidth is changing at all in the first place!
parent updateDisplayList-->measured w/h: 55/55 explicit w/h: NaN/NaN
normal w/h: 55/55 x/y: 3.4000000000000004/2.3000000000000003 scaleX/Y:
0.5/0.5
parent updateDisplayList-->measured w/h: 58.85/58.85 explicit w/h:
NaN/NaN normal w/h: 58.85/58.85 x/y: 4.05/2 scaleX/Y: 0.535/0.535
parent updateDisplayList-->measured w/h:
62.70000000000001/62.70000000000001 explicit w/h: NaN/NaN normal w/h:
62.70000000000001/62.70000000000001 x/y: 4.65/1.8 scaleX/Y:
0.5700000000000001/0.5700000000000001Here's one more item I
encountered... I got fed up with scaling and tried to explicitly set
the width/height of each child but any time I explicitly set the
width/height of the children they just disappeared! Really not sure
why... This last bit was exceedingly frustrating!
I'm quite new to flex so if I'm going about things the wrong way please
let me know. This is great stuff and trying to get up to speed with
it... Any pointer on what's going on would be GREATLY appreciated!
Thanks!
-James