Reputation: 393
I writing a game in AS3 using flash. The game works, and I'm trying to add music to the game.
I added a mp3 file called Music (linkage Music.mp3) and I added in the board (which is the whole game ) the following lines
import flash.media.SoundChannel;
public var music:Music;
public var bgmSoundChannel:SoundChannel;
I'm getting error
Type was not found or was not a compile time constant:Music
I had some problems before while trying to use more then one class its seems the my classes doesn't see other classes defined in my fla.
I will be happy to find a solution, and if you know a good explanation about as3 architecture I will be happy to get a link for that as well
Upvotes: 0
Views: 256
Reputation: 15570
The error is because Music
is not found as a compile-time class. This is most likely because you have not correctly set its class in the linkage box.
You say its linkage is Music.mp3
. This must be Music
in order for your code to work.
Upvotes: 1