0

I'm sure it's a simple fix, but when I put input number prefixes as values into a combo box in Flash CC, it knocks off the first zero for some reason.

For example, one of the values in the combo box should be 0800, but is outputting as 800 instead

I'm guessing it's something to do with the way it renders numbers... Any way to fix this at all?

P.S: I'm using the standard ComboBox in Flash, no ActionScript attached to it yet.

Matt Maclennan
  • 1,266
  • 13
  • 40

1 Answers1

0

If you wrap the value and/or label in "quotation marks", it'll treat it as a String rather than a Number type, and thankfully it leaves the quotes off of the label at runtime.

enter image description here

hanenbro
  • 604
  • 7
  • 16
  • Brilliant, thanks for that, worked like a charm. Will the data be outputted without the Quotation Marks as well? N.B: For anyone reading, I only need the numbers as a string, hence why I marked this as correct. – Matt Maclennan Sep 20 '13 at 09:05
  • 1
    No problem! It's correct that the quotation marks aren't stored as part of the String value; they're only used to mark the boundaries of it and identify the variable type. So if you were to add an event listener for `Event.CHANGE` and then trace out the ComboBox's `value` property, you'd see just: `0800` - with no quotes. And if you *did* want to include quotes in the actual value for any reason, you could surround it with single quotes, making the value in the data field: `'"0800"'`. – hanenbro Sep 20 '13 at 09:18