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.

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

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

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

AIR dock_clock update

Here is an updated version of the dock clock.  Enjoy.

Adobe AIR

Flash AS3 Rotate at Center Point

So you have a MovieClip in Flash and you want to rotate it at the center point of the clip using AS3 ( actionscript 3 ).

Try this:

var point:Point=new Point(myMC.x+myMC.width/2, myMC.y+myMC.height/2);

var m:Matrix=myMC.transform.matrix;
m.tx -= point.x;
m.ty -= point.y;
m.rotate (45*(Math.PI/180));
m.tx += point.x;
m.ty += point.y;
myMC.transform.matrix=m;

This will rotate the clip at the center point at 45 degrees.

Silver Wings by Thrice

This is a song (sonnet) about AIR.
Silver Wings by Thrice

/*

From tender years you took me for granted
(But still I deigned to wander through your lungs)
While You were sleeping soundly in your bed
(Your drapes were silver wings, your shutter’s flung)

I Drew the poison from the summer’s sting
(And eased the fire out of your fevered skin)
I Moved in you and stirred your soul to sing
(And if you’d let me I would move again)

I’ve danced ‘tween sunlit strands of lover’s hair
(Helped formed the final words before your death)
I pitied you and piled your sails with air
(Gave blessing when you rose upon my breath)

And after all of this, I am amazed
That I am cursed far more than I am praised.

*/

Flash Developers Needed

The creative shop, Struck (www.struckcreative.com) is on the hunt for top-notch Flash developers. So if you’re a rockstar in both AS 2.0 and AS 3.0/Flex send us your code samples. We’re looking for the kind of people that understand that classes are not something that you just take in college; the kind of people that get cranked about translating Photoshop comps into awesome, coded motion. We’re looking for the kind of people who embed videos into Flash in their dreams. Send samples to: info@struckcreative.com

Adobe MAX - Registration Now Open! Register now for MAX North America.

Adobe MAX - Registration Now Open! Register now for MAX North America.

Join us at MAX 2008, the annual Adobe event, to connect with thousands of Adobe users, experts, and staff for four days of education and inspiration. Learn cutting-edge skills, explore emerging technologies, build valuable relationships, and ignite bold new ideas. This year’s program features a diverse schedule of sessions and labs, unique networking and social events, and presentations by industry luminaries. November 16 – 19 in San Francisco, CA. Learn more at www.max.adobe.com.

Quick Adobe AIR Sample - AIR Clock

Just created a quick AIR sample app for you to enjoy. It is an analog clock based off of a clock sample in the Flash samples. I merely added a few AIR functions to make it minimize, maximize and drag. You can download the AIR Clock file here: AIR Clock (right click Save As…)

« Previous Entries