So I've found myself needing to do a little bit of flash...

I'm playing a song and syncing up some visual changes with that song. The issue is that in order for the song to play when I preview my changes to the animation, I have to start playing my flash project from frame 0.

This becomes a problem when I am trying to sync to things that occur later in the song. For example, if I'm trying to sync something at frame 300 then I have to re-play the entire animation from frame 0 in order to hear the song at frame 300 and beyond.

Is there any way to get the song to play, starting from the correct position, regardless of where I start running my animation while developing?

I could hack something up in action script to move the play head and play the song if it currently isn't being played but I'd rather not go down that route as there must be a simple solution to this problem.

有帮助吗?

解决方案

Set the sound format for your audio to "Stream" vs. "Event" in the properties window. This should enable you to hear sound while scrubbing the timeline, and start playback in the IDE wherever you want.

(This will also help maintain sync if your song is long. Flash is notorious for losing audio sync on long animations if not configured properly.)

其他提示

//Stores the position of the "playback head"
var pausePosition:Number = sndChannel.position;
sndChannel.stop();

//When ready to resume playback, call this line
sndChannel = soundClip.play(pausePosition);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top