Now the actual bug..
Kinda wanta do the bug fixing in another entry, although it's kinda simple bug.
The place where the combobox draws and animate the drop down is in
function displayDropdown(show:Boolean) : Void
Now.. this function takes show as a boolean to see if it should open or close the drop down.
To check if it's overflowing, it converts the local coordinate of the the drop down to global by
point.x = 0; point.y = height; localToGlobal(point);
That's all fine and dandy.. and it works.. however, right before the check:
point.y + dd.height > Stage.height;
it does this:
dd._parent.globalToLocal(point);
Why.. i don't know, but that certainly messes up the calculation.
So all i did is doing that after the check. Since you do that in both overflow or nonoverflow conditions, i make a boolean value of that condition and then do the conversion. And then just check the boolean.
...
dd.onTweenEnd = tweenEndShow;
var initVal;
var endVal;
var overflow:Boolean = point.y + dd.height > Stage.height;
dd._parent.globalToLocal(point);
if (overflow)
...
That's it... and everything works like it should.
0 Comments:
Post a Comment
<< Home