Cool, thanks for that. It's strange the holes you find in your AS knowledge sometimes...

On 27 Apr 2006, at 15:29, Zeh Fernando wrote:

That is exactly what it does, eg 0x735555 becomes 7558485, but that's not what I need. I need it to stay hexadecimal, but to be recognised as a number type. It shouldn't be converted, its type needs to be changed.

Well, a number is a number - 0xff *is* 255. If you need it to be hexadecimal for some visual or string reason, you need to convert it back to an hex string - with .toString(16).


Hey, it's Zeh, it's your mc tween class I'm using isn't it? :> Fantastic script...

Yes, it probably is. Thanks!


The docs only have hex numbers used in the colorTo() function, so I assumed that's what I needed - can I use a normal int too?

Sure, you can. Like I said, a number is a number - whether you're seeing it as "F" or "15" is just a matter of visual representation under a certain base. If you want to write something using hex numbers, you can use, say, 0xff2101 because it's easier; but if you pass the parameter as being 16720129 instead, it's the same thing. You could even use 077620401 as an octal number, it's no different to Flash. The same applies to any method or function that 'usually' an hex number as input - say, the setRGB method (colorTo uses the same color input parameter).

In the end,

trace (0xff === 255);

Traces "true".


- Zeh
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com



_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to