- For individual users
- Instant access to solutions
- Ask your tech questions
- Start your 30-day Free Trial
Main Topics
Browse All TopicsI'm writing a flex app, and hit a bit of a snag. One of those things that you expect to just work - but it doesn't.
One of the visual elements is a drawer. It can be opened and shut. When it opens it should make a whoosh sound and when it closes it should go whoosh-clunk.
The drawer itself is just a simple element, and it is opened by using a mx.effects.Move.
The sounds are preloaded, so there should be no delay.
The code looks something like...
_snd.play();
_move.duration = _snd.duration;
_move.xTo = newx;
_move.play();
Notice that I call the sound play FIRST, but whenever the drawer opens or shuts the movement happens first and then the sound. Actually to be more precise there is a delay of approximately one second between when the movement starts and when the sound starts.
One second may not seem much. But given that the whole thing is supposed to happen in about 0.5 seconds - then it is a lot!
I've tried using both mx.effects.SoundEffect and flash.media.Sound for the sound, but the result is the same.
Does anyone know a way to synchronise the two, or perhaps why there is the initial delay?
Any ideas appreciated.
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: HamletPosted on 2009-05-04 at 21:12:19ID: 24301510
UPDATE
As I mentioned the sounds are preloaded. In other words I am loading these sound files (MP3) at the start of the application. For technical reasons I prefer not to embed them.
BUT when I tried embedding them, they worked correctly.
I'm guessing that maybe when you embed sound into a SWF it is transcoded. But when loading dynamically it is doing the transcoding every time I try to play the sound, and this is what causes the delay.
I could perhaps embed the sounds into a separate file, but would prefer to stay with the dynamic load if possible. Can anyone suggest a way to force the transcode prior to playing a sound?