If anyone can help me with this, I would be extremely grateful. It’s driving me insane.
If I run this code:
var mySprite:Sprite = new Sprite();
trace(“mySprite 1:”, mySprite.width, mySprite.height);
numericStepper = new NumericStepper();
trace(“numericStepper 2:”, numericStepper.width, numericStepper.height);
mySprite.addChild(numericStepper);
trace(“mySprite 3:”, mySprite.width, mySprite.height);
I expect this output:
mySprite 1: 0 0
numericStepper 2: 80 22
mySprite 3: 80 22
But I get this output:
mySprite 1: 0 0
numericStepper 2: 80 22
mySprite 3: 100 100
If instead I do this:
mySprite = new Sprite();
trace(“mySprite 1:”, mySprite.width, mySprite.height);
numericStepper = new NumericStepper();
trace(“numericStepper 2:”, numericStepper.width, numericStepper.height);
mySprite.addChild(numericStepper);
trace(“mySprite 3:”, mySprite.width, mySprite.height);
mySprite.width = 80;
mySprite.height = 22;
Then the numericStepper is drawn as if it is squished to 20% its normal height.
If I pre-set mySprite width and height before adding the numericstepper, the trace output is 0,0 after adding it and it is not displayed at all.
Is there some way I can make the sprite only adjust to correctly fit the numericStepper OR resize it afterwards without distorting the numericStepper component?
As I was typing this, I came across this post:
Can anyone help me modify that solution for a numeric stepper?
Thanks!