Skip to main content
Participant
August 6, 2013
Answered

Adobe AIR for Android as3 codes not working for this one project

  • August 6, 2013
  • 1 reply
  • 466 views

I'm trying to use Accelerometer in my flash game, which works for every other project I'm working on, but for some reason on this one project if I try using it I get errors, using the same code i've used before, such as this. 

1046: Type was not found or was not a compile-time constant: Accelerometer.

1180: Call to a possibly undefined method Accelerometer. 

This is a fairly old file, not that old, so are there files I need to add to it to get it to work, or settings I need to change? This is very frustrating, I don't know what the problem possibly could be. Can anybody help me?

This topic has been closed for replies.
Correct answer Ned Murphy

The error message is indicating it cannot find the class.  Make sure you are importing it:

     import flash.sensors.Accelerometer;

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
August 6, 2013

The error message is indicating it cannot find the class.  Make sure you are importing it:

     import flash.sensors.Accelerometer;