Forum ‹ ActionScript 3.0 ‹ Get Float
4 posts
• Page 1 of 1
Get Float
Hello.
If I wish to send a float from serverside to my client, how can I?
The only methods are:
getBoolean (index:int):Boolean
getByteArray (index:int):flash.utils:ByteArray
getInt (index:int):int
getNumber (index:int):Number
getString (index:int):String
getUInt (index:int):uint
How can I send a decimal number? (Meaning my float) Do I have to convert it somehow?
Thanks!
If I wish to send a float from serverside to my client, how can I?
The only methods are:
getBoolean (index:int):Boolean
getByteArray (index:int):flash.utils:ByteArray
getInt (index:int):int
getNumber (index:int):Number
getString (index:int):String
getUInt (index:int):uint
How can I send a decimal number? (Meaning my float) Do I have to convert it somehow?
Thanks!
- mfranzs
- Posts: 98
- Joined: August 29th, 2010, 3:27 am
Re: Get Float
I've never tried to send a float from the server but when I send a double from the server I use "getNumber (index:int):Number" in flash to recieve it. Maybe that will also work for floats.
I make games and stuff.
-

HAnz - Posts: 46
- Joined: August 7th, 2010, 2:59 pm
Re: Get Float
That would make sense. Just to elaborate, Actionscript doesn't HAVE a float type! The Number type is a 64-bit double precision type, and it encompasses floats as well (that is, what in other languages like C would be differentiated as a 'float', distinct from a 'double')
You can read more about the data types in AS3 here: http://www.adobe.com/livedocs/flash/9.0 ... 000047.htm
The Number data type uses the 64-bit double-precision format as specified by the IEEE Standard for Binary Floating-Point Arithmetic (IEEE-754)
You can read more about the data types in AS3 here: http://www.adobe.com/livedocs/flash/9.0 ... 000047.htm
- Billy
- Posts: 4
- Joined: June 23rd, 2010, 4:31 pm
Re: Get Float
Wow... I was pretty stupid.... there isn't a float duh
>.<
I just decided to change it to a double like Hanz said and my problems went away.
Thanks guys!

I just decided to change it to a double like Hanz said and my problems went away.
Thanks guys!
- mfranzs
- Posts: 98
- Joined: August 29th, 2010, 3:27 am
4 posts
• Page 1 of 1