Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 05-03-2007, 08:14 AM   #1
maximum rinse
Registarded User
 
Join Date: Sep 2006
Location: Brighton
Posts: 66
Default Animation jumps when sound starts

I've got some animation (controlled by an onEnterFrame function) happening on the screen whilst a clock ticks down. When the clock reaches 5 seconds, a heartbeat sound starts and loops round twice. When the sound starts, the animation on the screen jumps a bit (like it skips a few frames or whatever) for a fraction of a second, then resumes as normal.

The (hopefully) relevant code looks something like this:

ActionScript Code:
timeUp = false; countTime = 30; heartBeat_snd = new Sound(); heartBeat_snd.attachSound("heartBeat_snd"); timer(); function timer() { if (timeUp == false) { var curTime = (getTimer()-startTime)/1000; var countDownTime = Math.ceil(countTime-curTime); clock_mc.time_txt.text = countDownTime; } if (countDownTime<5 && heartBeat == false) { heartBeat_snd.start(0,2); heartBeat = true; } if (countDownTime<=0) { timeUp = true; interface_mc.time_txt.text = 0; } }

Any ideas?

Last edited by maximum rinse; 05-03-2007 at 08:17 AM.
maximum rinse is offline   Reply With Quote
Old 05-03-2007, 08:18 AM   #2
Syllogism
capt. Obvious
 
Syllogism's Avatar
 
Join Date: Aug 2006
Location: South Africa
Posts: 826
Default

I've encountered this also. Maybe an idea is to start the sound earlier but set it's volume to 0. Then when you want the sound to play you run start again. start(0) will start the sound playing from the begining. Or maybe you can pause the sound and then start it. Don't know if it will make a difference but worth a shot.

to set volume
_root.myLoop3Volume=0;
_root.myLoop3.setVolume(myLoop3Volume);
__________________
S y l l o g i s m, Cptn Obvious

"I think you'll find my argument is flawless [Citation][Citation][Citation]"
Syllogism is offline   Reply With Quote
Old 05-03-2007, 10:08 AM   #3
maximum rinse
Registarded User
 
Join Date: Sep 2006
Location: Brighton
Posts: 66
Default

Thanks for the reply Syllo.
I tried to start the sound earlier, and then restart it later, however the jumpy animation issue remains...

I would also like to fix this problem by a different method if possible, as I need to implement a whole bunch of other sounds going on throughout the game, including dynamic/ variable sound & speech.

It would look pretty bad if the animation glitches every time a sound is triggered.

Anyone else come across this problem?

Many thanks in advance!
maximum rinse is offline   Reply With Quote
Old 05-07-2007, 01:23 PM   #4
maximum rinse
Registarded User
 
Join Date: Sep 2006
Location: Brighton
Posts: 66
Default

Any other thoughts on why starting a sound could cause jumpy/ glitchy animations?

Anyone had the same experience? Is this a bug in Flash 8 pro?
maximum rinse is offline   Reply With Quote
Old 07-24-2007, 04:33 PM   #5
djshusko
Registered User
 
Join Date: Jul 2007
Posts: 2
Default

I'm experiencing a similar issue. I'm using CS3, AS 2.0 and publishing it for Flash 9. Basically, I've made a game where a movie clip if constantly moving around the screen. At certain events, a sound plays. I've tested this on 7 boxes, 5 xp and 2 vista. On one of the vistas, right before the sound plays, the animation pauses for half a second. We found that if he has another flash movie open in another browser window playing music, it doesn't jump, only when our file is the only one playing. I'd like to eliminate this by the time we publish it. Has anyone else had any experience with this? Or may have a workaround? Heres the relevant code:

_global.sndAppleCrunch = new Sound();
_global.sndAppleCrunch.attachSound("AppleCrunch.mp 3");

And on the event:
_global.sndAppleCrunch.start();
djshusko is offline   Reply With Quote
Old 07-24-2007, 04:44 PM   #6
djshusko
Registered User
 
Join Date: Jul 2007
Posts: 2
Default

In case anyone else has this issue, I found this workaround:
http://dalefraser.blogspot.com/2007/...nd-issues.html
djshusko 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 Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Click an animation to play a sound file and stop another sound file playing? casal52 ActionScript 2.0 1 03-08-2006 05:46 PM
sound animation defmars Simple Stuff (Newbies) 1 10-25-2004 09:58 PM
Bad delays with sound and animation mortalpoet Other Flash General Questions 6 11-17-2003 11:46 PM
Synching sound and animation SoccerCheese ActionScript 1.0 (and below) 11 04-09-2003 07:15 AM
Changing Sound Files - problems mateo Other Flash General Questions 1 06-02-2002 08:25 AM


All times are GMT. The time now is 10:30 PM.

///
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.