Copy link to clipboard
Copied
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?
The error message is indicating it cannot find the class. Make sure you are importing it:
import flash.sensors.Accelerometer;
Copy link to clipboard
Copied
The error message is indicating it cannot find the class. Make sure you are importing it:
import flash.sensors.Accelerometer;
Find more inspiration, events, and resources on the new Adobe Community
Explore Now