Restraining size properties to what's visible?
Posted on 2010-09-13
I was working on a simple AS2 rollover effect that simply makes the movieclip 102% larger and then reverts on rollout. As well the object had a movieclip play of a shine tweening left to right. The shine was masked to only appear in the area the button existed but started and ended outside that region.
The result was if you rolled in/out at certain points in the animation, the size of the object changed because the shine existed outside the visible region and moved, affecting the width as it moved through it and out again. If the object was 200px and I tell it to go back to that size on rollout, if the shine was outside of the visible area it would result in the button seeming to shrink far too small.
Beyond writing an algorithm to compensate for the shifting width, I could not figure out a solution. Is their a work around so that masked out objects do not affect the size?