Game without sound, is awkward. Its like, flower without bee (WTF???).
Ok, Thats enough. Lets start to learn how we can control audio in flash. Adding sound clip, play it, and stop it when it must be stopped. We can manually place sound clip in frame properties, but it will be a problem when we want to stop that sound, and change it with another sound. So, there is another way to do that. We use, attachSound() from action script 2.
How to Control audio/sound clip in flash?
- Create new flash file.
- Import new sound clip, mp3 or wav, thats ok.
- Rename linkage with something, Ex:sadtheme (its up to you)
- Now, you can control sound clip based on the Linkage name on step 3.
This is the code to control your sound clip.
- Add Sound Clip to Scene.
sadTheme = new Sound(); //you can use another name
sadTheme.attachSound("sadtheme");
sadTheme.start();
sadTheme.stop();Easy Peasy Right?
Now, you can change music so often in your game, or you want to make your own media player with flash? Thats fantastic idea, go for it! I hope this post is useful for you all. Bye.
Keyword (Indonesia) : kontrol suara di flash, menambah, memainkan, dan memberhentikan suara di flash action script 2
Image : veryicon.com



berkunjung d blog teman sambil memberikan sumbangan follow dan subscribe feeds(atjelasbeda@gmail.com) :D
ReplyDeleteOK btw support & keep write sob...& jng segan2 utk minta sumbangan lainnya :)
@Showgan: Makasih banyak bro... Udah Follow Juga di Showgan Blog. :D
ReplyDeleteThank u!!!
ReplyDelete