Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Sync Sound with Animation

New Here ,
Mar 24, 2013 Mar 24, 2013

I created my first Flash CS6 AS3 program "pacman" during my 30 day trial - which just ended. It works on my desktop, but the sound lags when it's on a server. I declare the variables. Later I assign them. I then play the sound by calling a function with paramater "1".  (There are several sounds, the examples below just show the code for the Begining music).

Is there some online documentation that could help me properly implement sound in my app, or is there a simple way to sync the sounds to the animation?

Thanks for all.

G.Doucet

        // Sound Variables

        private var sndBegin:Sound=new Sound();

        private var chBegin:SoundChannel=new SoundChannel();

        var req:URLRequest=new URLRequest("pmBegin.mp3");        // Load music into variables

        sndBegin.load(req);

        public function spBegin(p1:int) {

            if (p1 == 0) { chBegin.stop(); }                         //--------Stop Music

            else { chBegin=sndBegin.play(); }                        //--------Start Music

        }

TOPICS
ActionScript
460
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 24, 2013 Mar 24, 2013
LATEST

It is extremely difficult to sync animations with external streaming assets. You are better off embedding sound into timeline - this will assure complete sync.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines