Re: [Flashcoders] Problems when converting to Number

2010-12-19 Thread Henrik Andersson
Anthony Pace skriver: trace(Number('1992.2')); //why does it output 1992.3 //I am assuming I am missing something pretty obvious First it is parsed to binary floating point, losing accuracy and then it is output as decimal form again, losing accuracy again. __

RE: [Flashcoders] My first code.

2010-12-19 Thread Cor
@Q 1: You don't use the ToggleButton class to create the instances in that way, the class handles the properties and methods. And in your main (document) class or on the timeline in AS you set: private var toggleButton1:ToggleButton = new ToggleButton(); private var toggleButton2:ToggleButton = n

RE: [Flashcoders] My first code.

2010-12-19 Thread Cor
Right-Click object in Library, Click Linkage Select Export for Actionscript Set the ToggleButton as Base class file Groeten, Cor van Dooren www.codobyte.com -- "There are only 10 types of people in the world: Those who understand

Re: [Flashcoders] My first code.

2010-12-19 Thread John McCormack
On 15/12/2010 23:53, spyder spyders wrote: I am trying to write a ToggleButton Class.I can get it to work as a document class and as as3 on timeline. But how to I use it as a symbol class? Q. "I am guessing that the 'this' is pointing to the symbol or _mc I attach the class to?" No

Re: [Flashcoders] problem with adding two digits

2010-12-19 Thread Anthony Pace
to prevent anyone answering on this thread: after toying with it again, and reading the docs + wikipedia I figured out that I can only trust a result of 15 digits or less, unless I have the string be returned instead of the number. n 12/18/2010 8:34 PM, Anthony Pace wrote: function floatSumV

Re: [Flashcoders] Problems when converting to Number

2010-12-19 Thread Anthony Pace
Thanks for the response. Right as you were posting, I was posting my own message of how I read up on the spec, and saw the same thing. From what I have read, as you can't actually have the int portion be 9 999 999 999 999 999, because its limit is 9,007,199,254,740,992 , you can really only t

Re: [Flashcoders] Problems when converting to Number

2010-12-19 Thread Anthony Pace
Oh well, after reading a couple of articles, I think I have confirmed my suspicion; for, as I thought, it just comes down to there being too many digits, and the floating point implementation doing some hidden weirdness. It really sucks that you can really only expect about 15 digits of true a

Re: [Flashcoders] Problems when converting to Number

2010-12-19 Thread Gerry Beauregard
You're getting to the limits of the precision of a Number. In ActionScript 3, the Number type is stored in binary, in 64-bit double-precision IEEE floating point format: http://en.wikipedia.org/wiki/Binary64 It uses 52 bits for the mantissa (fractional part) which gives it an effective pre