Flash AS3 attachSound – SoundChannel

If you haven’t noticed yet attachSound in Flash AS3 ( actionscript 3 ) is no longer there.  Instead use the SoundChannel.

Import the audio file into your library then right-click on it and select Linkage…make sure the “Export for ActionScript” and “Export in first frame” checkboxes are checked. If you are not using your own custom class then just type a unique class name into the “Class” input box (i.e. MySong).

Use the following script to play the sound file:

import flash.media.SoundChannel;
import flash.media.Sound;
var mySound:MySong = new MySong();
var channel:SoundChannel = mySound.play();

Flash will recognize that the library asset is an audio file so the MySong class (which Flash automatically generates for you) will extend the Sound class… and that means you will be able to access all of the usual Sound methods and properties.

Related Posts:

  • No Related Posts

dock_clock AIR app update

so I’ve posted a few updates to the dock_clock Adobe AIR app I created.  Here is one more that has an auto-updater.  Which means you won’t have to download any others from my blog.  If I make an update to the AIR app, it will notify you that there is a new version and ask you if you want to download it.  Check it out here: http://www.smithmediafusion.com/bugClock/dock_clock.air

Related Posts:

  • No Related Posts

To Dirk Nowitzki and the rest of the German B-Ball Team

Here’s just a friendly reminder to Dirk Nowitzki and the rest of the Germany B-Ball Team.

(Can you spot Dirk in this photo?)

http://www.smithmediafusion.com/blog/?p=341

Related Posts:

  • No Related Posts

Flash AS3 Circle Preloader

Here is a Flash AS3 ( actionscript 3 ) circle or circular preloader.  It is similar to the circle preloader I created here using AS2 but uses the AS3 code from the preloader here.  Enjoy your preloader Flash fun!

Sample Files:

circlePreloaderAS3.swf

circlePreloaderAS3.fla

Related Posts:

  • No Related Posts