Ok,
i don't have questions often, but as this might be a bug,
i am out of ideas:
I have movieClip with a square in it, which has horizontal lines.
The caps of the lines i set to "none" as i will need to set/get
the width of that square without those bloody round caps
(was giving me headaches in the flash versions b4 8ball).
But even, if the caps are set to "none" the round ending
will render into the width of the MC the lines are in.
Is this a Bug, or is this working as inteded ?
Just incase i expressed myself unclearly i provide a fla.
Any other workaround, but setting mc._width = widthWanted+lineThickness?
My letters on the F1 key have faded, how are yours today?
I get it too, it's probably one of those cheap workarounds that Macromedia boys like taking... probably to cut out the rounds, the engine masks the lines (just guessing), or something else really dirty.
That's what I hate of Flash, it's just cheap, but it comes with and expensive pricetag!
Ascanio.
Altruism does not exist. Sustainability must be made profitable.
import flash.geom.Transform;
var trans1:Transform = new Transform (test1);
var trans2:Transform = new Transform (test2);
var trans3:Transform = new Transform (test3);
var rectObj1:Object = test1.getRect ();
var rectObj2:Object = test2.getRect ();
var rectObj3:Object = test3.getRect ();
t1.text = "_width="+rectObj1.xMax;
t2.text = "_width="+rectObj2.xMax;
t3.text = "_width="+rectObj3.xMax;
- The right of the People to create Flash movies shall not be infringed. -
Ok, that solves it for reading, good idea, i didn't know that getRect()
will get the correct values without the caps..
But mainly i want to set the width, not including the caps of course
And i don't see the new Rectangle class helping me here... but maybe i
worked too long to see the solution
[Edit] i could of course draw the obects by code, but
that will not comply with my coding, in which all
graphics are in the fla file.
My letters on the F1 key have faded, how are yours today?
Here is your formula to deal with that, for example if you want to increase size etc. wFactor derived from the original drawing size will be the factor you need to use to manipulate the size.
PHP Code:
var rectObj1:Object = test1.getRect ();
var rectObj2:Object = test2.getRect ();
var rectObj3:Object = test3.getRect ();
var wFactor1:Number = test1._width/rectObj1.xMax;
var wFactor2:Number = test2._width/rectObj2.xMax;
var wFactor3:Number = test3._width/rectObj3.xMax;
if (wFactor1>1) {
setProperty (test1, _width, 350*wFactor1);
trace("w1: "+test1._width);
} else {
setProperty (test1, _width, 350);
trace("w2: "+test1._width);
}
if (wFactor2>1) {
setProperty (test2, _width, 350*wFactor2);
trace("w1: "+test2._width);
} else {
setProperty (test2, _width, 350);
trace("w2: "+test2._width);
}
if (wFactor3>1) {
setProperty (test3, _width, 350*wFactor3);
trace("w1: "+test3._width);
} else {
setProperty (test3, _width, 350);
trace("w2: "+test3._width);
}