Something I whipped up for myself in a few minutes.
This cuts down the code I need to play a sound by about 2 lines haha, but I think its pretty useful, check it out especially if sounds in Actionscript 3 aren't making sense for you. =)
FX.as -
package
{
import flash.display.MovieClip;
import flash.media.Sound;
import flash.media.SoundChannel;
public class FX extends MovieClip
{
var sound:Sound;
public function FX (type:Object)
{
sound = new type();
var fx:SoundChannel;
fx = sound.play();
}
}
}
Used like so:
var shot:FX = new FX(gunshot1);
gunshot1 is the class of the sound i want to use, right click your sound in the library (like gunshot.wav), and click linkage. Make its class be something like gunshot1, or mysfx or whatever.
Dec 21, 2008
Dec 20, 2008
Making the AS3.0 VCam Follow Your Player
This tutorial is directed to people who know a bit about flash, I won't be explaining everything in detail.
Download the VCam from this site if you don't already have it.
http://bryanheisey.com/blog/?p=1
Download the VCam from this site if you don't already have it.
http://bryanheisey.com/blog/?p=1
Embedding SWF's Into Your Blog
http://bookoftips.blogspot.com/2008/02/tips-on-how-to-embed-swf-flash-movies.html
Great, easy tutorial with code that actually works (unlike some of the other articles...)
Great, easy tutorial with code that actually works (unlike some of the other articles...)
Simple Buttons in AS3.0
It's basically like AS2 and 1, but instead of sticking the code onto the buttons themselves, we just have a seperate class that handles it. Using seperate files for your projects might seem a bit daunting at first coming straight from "no oop" (as2 and 1 still uses oop even without those seperate files) as2 and as1. But really its not. Now, in as3 there is no this.onRelease or this.onEnterFrame and what not. No, its all events now, which is easy, and probably much easier to pick through as well.
It's basically like AS2 and 1, but instead of sticking the code onto the buttons themselves, we just have a seperate class that handles it. Using seperate files for your projects might seem a bit daunting at first coming straight from "no oop" (as2 and 1 still uses oop even without those seperate files) as2 and as1. But really its not. Now, in as3 there is no this.onRelease or this.onEnterFrame and what not. No, its all events now, which is easy, and probably much easier to pick through as well.
Subscribe to:
Posts (Atom)
FlashGrounds

Kevin Stubbs, Ivan Alvarez Malo