The new Actionscript 3.0 in Flash CS3 can be a bit tricky sometimes, especially when you're normally used to Actionscript 2.0. But there are a number of nice new functions in AS 3.0 which make it really attractive to just make it your coding standard for Flash.
Here I'll explain how to use the leftPeak and rightPeak properties of AS 3.0. With these, you can read the volume of both audio channels (left and right) seperately. With that value, you can create some nice Flash files, like this visual audio bar.
To create this, use this (relative simple) AS 3.0 code.
barLeft.mask = maskLeft;
barRight.mask = maskRight;
var s:Sound = new Sound();
s.load(new URLRequest("audiofile.mp3"));
var sc:SoundChannel;
sc = s.play(0, 1000);
this.addEventListener(Event.ENTER_FRAME, showPeaks);
function showPeaks(eventArgs:Event){
maskLeft.y = barLeft.height + sc.leftPeak * - barLeft.height;
maskRight.y = barRight.height + sc.rightPeak * - barRight.height;
}
Because of the Event.ENTER_FRAME, this code works best when you set the FPS from Flash to a minimum of 24.
Every once in awhile, you'll hear a statistic so striking you can hardly believe it's true. For example, you swallow 8 spiders a year. Cracked.com explains the truth behind these quotations.
If you're looking for free Photoshop logos, you'll have to take a look at PSDFreeBee. There are also a couple of video tutorials.
22 signs you're NOT addicted to designI guess you've seen them all. Articles like 25 MORE Reasons You Might Be A Hardcore Graphic/Web Designer,
You Know You're Addicted To Photoshop If...
and 24 Checkpoint Signs You're Obsessed With... + Full Story
Expanding a HTML form using JavaScriptUsing forms in a website to let the user register is pretty common these days. But what happens when you want several input values of the same subject? It's pretty ugly to make 20 fields with "I can... + Full Story
This (we)blog brings you information about (web)design, blogging tips, (programming) tutorials and much, much more. I can't describe Marcofolio.net in words: Just look around and be amazed. Many (new) visitors have a habit to stick around, just because of the variety of articles.
This website is entirely run by Marco Kuiper, a guy from the Netherlands. More information can be found on the About Me page. I'm an active member of the StumbleUpon and Digg communities.
Have fun reading my blog and don't forget to subscribe to my feed to keep updated on the latest articles.