PDA

View Full Version : tweening hairline


zoltan
02-06-2006, 02:16 PM
Hi,
I have an MC on the stage, containing a 10pixel wide hairline. Whenever I try to expand it via a Tween, however, it instantly disappears. If I place another layer in the MC with some invisible content, it tweens just fine and the hairline expands just fine. But if its just the hairline stroke on its own, no good, another attempts to change the width cause it to disappear.

This is the actual code:

//import tween classes
import mx.transitions.Tween;
import mx.transitions.easing.*;

//
new Tween(horizline_mc, "_width", Strong.easeInOut, 10, 1000, 3, true);
//


I also tried an onClipEvent(enterFrame), with the same results. A hairline on its own couldnt be animated, but a hairline with other content (even if invisible) would vanish.

Help!:o

Morg
02-06-2006, 02:18 PM
it seems to work ok if your hairline isnt exactly horizontal... very strange....

Maybe just put a zero alpha block behind it all?

zoltan
02-06-2006, 02:24 PM
Hi Morg,
thats what I did, and that was how I got it to work eventually, by putting a a tiny mc with _alpha = 0 behind it :)

The problem with that is that its impossible to size an MC so that it matches the dimensions of a hairline stroke (since "hairline" seems to be almost a theoretical size, not an actual pixel value), so you might end up with positioning problems down the line. Thats why I'm hoping to find a solution that allows me to just keep the MC containing only a hairline stroke and nothing else.

Morg
02-06-2006, 02:29 PM
Yes, I see the problem here... Well, like you say, hairline is .25 of a pixel... It could well be the reason why its not working..

Im sure Jesse or Cyanblue could shed some more light on this subject. Now, if I could only remember my summoning spell to get them here. :p hehe.

Good luck! Keep us posted if you find anything else out.