Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-03-2011, 10:19 AM   #1
aflashdeveloper
Registered User
 
Join Date: Jun 2011
Posts: 3
Default [AS2] Flash game audio issues

Hi,

I am having a pretty irritating problem with the audio I am using for a Flash game which I am making using Flash 8 and Actionscript 2.0. The game itself is near complete and is already hosted online, it is a simple 2d shooter game where enemies go from one side of the screen to the other and you shoot them. I have built a preloader which works well however I have just added audio to the game, and I am finding that the preloader doesn’t seem to take this audio into account. The game itself loads up and is ready to play, however it could be another 30 seconds or so before the audio will kick in.

I have a main song loop which plays in the background (triggered once the start game button is pressed). A bullet shot sound when the mouse is clicked (triggered through code), and various sound effects that are played on the timelines of the enemy movie clips characters.

Part of my problem is that im implementing the audio in so many different ways and I am confused by the complexities of using audio in Flash. Should I build a separate preloader for the audio? Or am I simply doing something wrong in Flash itself when it comes to including the audio?

I have tried reading tutorials, but I don’t seem to find anything that solves my problem, please help!
aflashdeveloper is offline   Reply With Quote
Old 06-03-2011, 01:57 PM   #2
tacos
Grrrrrrrrreat!
 
tacos's Avatar
 
Join Date: Apr 2007
Location: Montréal, Québec
Posts: 5,473
Default

Are you talking about the background music? Did you use an attached soundObject? Or are you loading the sound dynamically as an event or streaming sound?
__________________
WHO I WAS...
BANDS OF THE 80's
tacos is offline   Reply With Quote
Old 06-07-2011, 08:58 AM   #3
aflashdeveloper
Registered User
 
Join Date: Jun 2011
Posts: 3
Default

Quote:
Originally Posted by tacos View Post
Are you talking about the background music? Did you use an attached soundObject? Or are you loading the sound dynamically as an event or streaming sound?
The sound effect I trigger every time a shot is fired is attached using attachSound. This sound is giving me delay issues as it can take 30 seconds or more for the sound to kick in.

The code for that is:

ShootSound = new Sound(this);
ShootSound.attachSound("shotfired");
ShootSound.start(0, 1);

The rest are on the timeline of individual movie clips, the sync is set to Event, should I change that? Should I load these in code? Should I try and load these sound clips externally? At the moment the package is just 1 swf. All help is appreciated!
aflashdeveloper is offline   Reply With Quote
Old 06-07-2011, 01:05 PM   #4
aflashdeveloper
Registered User
 
Join Date: Jun 2011
Posts: 3
Default

Hi, just wanted to say I resolved my issue by making a different preloader. It still works using the same concept so im a little stumped why my older one didnt work. Either way touchwood it works now!
aflashdeveloper is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:09 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.