Skip to main content
Participating Frequently
January 29, 2013
Answered

Number.floor appears to be a valid function but is not. Causing crashes on mobile.

  • January 29, 2013
  • 1 reply
  • 1263 views

This is a cross post from http://forums.adobe.com/message/4993660/  We didn't get an answer there and this issue, and similar discrepencies between what the IDE can compile and what will run on a device, have been costing us man days in work.

We recently had a problem where when compiling using FB and debugging on devices works fine. But when we built the app using Ant, it was crashing on Android devices. After debugging that, we found that Number.floor was not a function.

I cannot find any documentaiton that says Number.floor was ever a function in ActionScript/Flex/AIR.

So why does Flash Builder seem to think it's valid, let us compile it, and even run it on the device?! Is there some 'even more strict' compiler option I need to check?

This topic has been closed for replies.
Correct answer kglad

Yup. And then it crashes on the device.


i reported the problem for the next version of Flash pro and Flash builder.

it appears the bug was introducted in flash player 11.3.  earlier fp versions correctly identify errors when applying Math class methods and properties to the Number class.

1 reply

kglad
Community Expert
Community Expert
January 29, 2013

i've never heard of Number.floor.  where is documentation for that?

you probably want to use Math.floor()

BioOdieAuthor
Participating Frequently
January 29, 2013

That's the point. Number.floor isn't a function. There is no documentation of it. I can't find any occurance of it online. But the Flash Builder IDE allows it without any red flags. And it compiles fine. It just ends up crashing the device when those functions get called. This makes me terrified to code anything in Flash Builder. I can't trust it when it lets us write broken code.

kglad
Community Expert
Community Expert
January 29, 2013

it works in the flash ide, too. 

in fact, using Number dot triggers code completion with exactly the same methods as the Math class and everything seems to work correctly (in the ide).