简体   繁体   中英

linkage issue(i think) in flash AS3

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM