Hi,
AS3, CS3, non-Flex:
I'm trying to use a NumericStepper to cycle through a different range in
different situations. I have the appropriate range in a pseudo-struct called
propertyDefinition. So, I instantiate the NumericStepper and assign it to
the var stepper and apply minimum and maximum numbers:
stepper.minimum = propertyDefinition.minimum; // minimum is type
Number
stepper.value =
_selectedStageObjects.getItemAt(0).data.getProperty(propertyDefinition.propertyName)
as Number;
stepper.maximum = propertyDefinition.maximum; // maximum is type Number
stepper.stepSize = propertyDefinition.stepSize;
Great. Works fine for positive minimum and maximum numbers.
Now, when the propertyDefinition.minimum = -10000 and the
propertyDefinition.maximum = -50 the resultant numeric stepper is completely
locked down. Regardless of the value, it shows -50 as the value. If I try to
use the step buttons, it stays at -50. If I try to type into the stepper, it
jumps to -10000. stepper.nextValue and stepper.previousValue both return the
current value.
Here's the weird part. If I hard code the minimum and maximum:
stepper.minimum = -10000;
stepper.value =
_selectedStageObjects.getItemAt(0).data.getProperty(propertyDefinition.propertyName)
as Number;
stepper.maximum = -50;
stepper.stepSize = propertyDefinition.stepSize;
It works 100% fine. So clearly the NumericStepper can handle stepping
through negative numbers.
I've tried reversing the order I set the value, minimum, maximum, stepSize.
I've tried a negative stepSize. I've tried casting
propertyDefinition.minumum as a Number (it already is a Number, but I'm
getting superstitious). I just can't possibly understand why if assign
a hard coded a number, I get one behavior and if I assign to a property
value that evaluates to the exact same hard coded number, I get a broken
stepper.
Can anyone see the mistake I'm making? (Including "Using the Flash CS3
components in the first place")
-jonathan
--
-jonathan howe :: 404.434.2321 :: 180 High St Apt 26 Portland, ME 04101
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders