Repeat after me: Every project I complete makes me smarter.

April Fools Flash Tutorial: Embed a Sound File

Date/Time Permalink: 04/01/09 10:14:22 am
Category: Flash

What, you don't know how to play a song from a Flash file in SWFTools? Easy stuff. Takes a minute.

Make a source.sc file with this in it:

.flash bbox=50x50 fps=36
  .sound SONG "./AFD.wav"
  .action:
    songFX=new Sound();
    songFX.attachSound("SONG");
    songFX.setVolume(500);
    songFX.Start();
  .end
.end

compile:

swfc -o AFD.swf source.sc

Where 'AFD' is the name of whatever .wav sound you want to play for your April Fool's Day joke. Then embed the Flash file somewhere on your web-page, with small height and width arguments, or hidden with a CSS trick, or buried behind an image - whatever it takes so the user cannot possibly find it to shut it off!

Bonus Buck Today and today only I support the grassroots effort to save Internet Explorer 6.

Follow me on Twitter for an update every time this blog gets a post.
Stumble it Reddit this share on Facebook

suddenly the moon