-
supervillain
Welcome to the AS3 Forum :: Resource Thread
Welcome to the forum for ActionScript 3 related questions.
Adobe ActionScript 3 (AS3) Resource Thread:
This isn't a conversation thread so please just post a link and brief description of any requirements/info on the sites. Posts may be edited or deleted in order to keep this as a useful resource thread for the future or add it to the exisiting sticky thread. Feel free to add to this thread; however it simply means that the posts will be added/removed as the Flashkit Mods see fit and as long as they add to the ActionScript3 resource thread.
If your post is added to this resource thread, you will be given proper acknowledgement. So feel free to add/share away!
Resource Links for Adobe ActionScript 3 (AS3):
Complements of walnoot
Complements of mr_malee
Complements of senocular
List of 3D engines and 3D tutorials (added by Cancerinform)
PLEASE BE AWARE THAT LINKS WILL BE ADDED TO THIS POST FOR EASY REFERENCE, I'VE DELETED ALL OTHER POSTS IN THIS THREAD. PLEASE POST YOUR LINKS AND THEY'LL BE ADDED HERE.
Last edited by cancerinform; 01-18-2008 at 09:40 PM.
Reason: Updates
-
Senior Member
Nice new forum.
www.gskinner.com/blog has a lot of new good AS3 posts, not sure if there is a page that links to them all though.
Cheers!
-
Senior Member
Several tutorials including a basic AS3 tutorial on this site.
- The right of the People to create Flash movies shall not be infringed. -
-
-
Last edited by joa__; 08-10-2006 at 04:43 AM.
-
Senior Member
my own magazine site, has a section for Flash9 / AS3
www.flashculture.com/flash9as3.htm
currently has 29 links.
-
-
half as fun, double the price
-
AS3 MP3 Player
Note you will need to supply your own mp3 files to view this properly and the flash 9 alpha.
Basically its an mp3 player with play, stop, pause, nextsong, previous song, id3 info display and computeSpectrum
Source files are located here to work off
http://www.dhtmlnirvana.com/downloads/audiomanager.zip
Here are the instructions
To set this up properly you will need to do the following:
Create a new FLA document
Create 5 button instances and name them
start_button
stop_button
pause_button
next_button
previous_button
Then open up the actionScript panel and insert the following code:
Code:
import audioManager;
var music: audioManager = new audioManager();
addChild(music);
start_button.addEventListener (MouseEvent.MOUSE_DOWN, daPlay);
stop_button.addEventListener (MouseEvent.MOUSE_DOWN, daStop);
pause_button.addEventListener (MouseEvent.MOUSE_DOWN, daPause);
next_button.addEventListener (MouseEvent.MOUSE_DOWN, daNext);
previous_button.addEventListener (MouseEvent.MOUSE_DOWN, daPrevious);
function daPlay(event:MouseEvent):void {
music.onPlay();
}
function daStop(event:MouseEvent):void {
music.onStop();
}
function daPause(event:MouseEvent):void {
music.onPause();
}
function daNext(event:MouseEvent):void {
music.cyclesongArray('forw') ;
}
function daPrevious(event:MouseEvent):void {
music.cyclesongArray('rev') ;
}
The AS3 Class file is as follows and is saved as audioManager.as in the same directory as the swf file
Code:
package
{
import flash.display.Shape;
import flash.display.Sprite;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.media.SoundMixer;
import flash.media.SoundTransform;
import flash.utils.*;
import flash.net.URLRequest;
import flash.text.TextField;
import flash.text.TextFormat;
import flash.events.*;
import flash.geom.*;
import flash.filters.*;
import flash.errors.IOError;
class audioManager extends Sprite
{
private var _barArray: Array;
private var _lineArray: Array;
private var _sound: Sound;
private var _sc: SoundChannel;
private var _ba: ByteArray;
private var _numBars: int;
private var isplaying: int;
private var _playtime: int;
private var id3Array: Array;
private var songArray: Array;
public function audioManager()
{
// the song array contains your mp3 files. Change them to reflect the mp3 you wish to play
// to add more mp3 files add another array indice eg., songArray[3] = "somesong.mp3";
songArray = new Array();
songArray[0] = "Off Shore.mp3";
songArray[1] = "Northern Lights.mp3";
songArray[2] = "My Weakness.mp3";
_songIndex = 0;
_barArray = new Array();
_lineArray = new Array();
_sc = new SoundChannel();
_sound = new Sound();
_sound.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
_ba = new ByteArray();
_playtime = 0;
// change the number of bars
_numBars = 60;
createSpectrumBars();
_sound.load(new URLRequest(songArray[_songIndex]));
isplaying = 0;
_id3Index = 0;
_sc = _sound.play(_playtime, 25);
var voltransform: SoundTransform = _sc.soundTransform;
// set your volume for the mp3
voltransform.volume = 0.6;
_sc.soundTransform = voltransform;
addEventListener(Event.ENTER_FRAME, animateBars);
addEventListener(Event.ENTER_FRAME, getInfo);
}
function createSpectrumBars(): void
{
for (var i: int = 0; i < _numBars; i++)
{
// this function allows you to change the the appearance of the bars
var bar: Shape = new Shape();
var dropShadow: DropShadowFilter = new DropShadowFilter(6, 25,
0x00FF00, 1, 10, 10, 2, 1);
bar.graphics.beginFill(0xFF0099);
bar.graphics.drawRect(250, - 75, 1, 30);
bar.graphics.endFill();
bar.filters = [dropShadow];
bar.y = bar.height + 130;
bar.x = 1+i * 4;
addChild(bar);
_barArray.push(bar);
// this function allows you to change the the appearance of the blue dots
var line1: Shape = new Shape();
line1.graphics.beginFill(0x66FFFF);
line1.graphics.drawRect(250, - 90, 1, 2);
line1.graphics.endFill();
line1.y = bar.height + 95;
line1.x = 1+i * 4;
addChild(line1);
_lineArray.push(line1);
}
}
private function ioErrorHandler(event: IOErrorEvent): void{}
function onStop()
{
_playtime = 0;
_sc.stop();
isplaying = 1;
}
function onPlay()
{
if (isplaying == 0)
{
// do nothing
}
else
{
_sc = _sound.play(_playtime, 25);
isplaying = 0;
}
}
function onPause()
{
_playtime = _sc.position;
_sc.stop();
isplaying = 1;
}
var textField: TextField = new TextField();
function getInfo(event: Event): void
{
// stores the MP3 ID3 info into an array, you can add more id3 info by adding another id3Array
id3Array = new Array();
id3Array[0] = "Song: " + _sound.id3.songName + " ";
id3Array[1] = "Artist: " + _sound.id3.artist + " ";
id3Array[2] = "Album: " + _sound.id3.album + " ";
if (_sound.id3.songName != null)
{
// formats the display and appearance of the id3 array
textField.width = 190;
textField.height = 20;
textField.x = 50;
textField.y = 100;
addChild(textField);
textField.text = id3Array[_id3Index];
var format: TextFormat = new TextFormat();
format.font = "Cambria";
format.color = 0x0099CC;
format.size = 13;
textField.setTextFormat(format)
}
id3Timer.addEventListener("timer", cycleid3Array);
id3Timer.start();
}
var id3Timer: Timer = new Timer(8000, 10);
function cycleid3Array(event: TimerEvent): void
{
if (_id3Index != 2)
{
_id3Index++
}
else if (_id3Index != 0)
{
_id3Index = 0;
}
}
function cyclesongArray(dir)
{
if (dir == 'forw' && _songIndex != 2)
{
_songIndex++;
_sc.stop();
_sound = new Sound();
_sound.load(new URLRequest(songArray[_songIndex]));
_sc = _sound.play(_playtime, 25);
_sound.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
}
else if (dir == 'rev' && _songIndex != 0)
{
_songIndex--;
_sc.stop();
_sound = new Sound();
_sound.load(new URLRequest(songArray[_songIndex]));
_sc = _sound.play(_playtime, 25);
_songIndex = 0;
}
}
function animateBars(event: Event): void
{
SoundMixer.computeSpectrum(_ba, true, 0);
for (var i: int = 0; i < _numBars; i++)
{
_barArray[i].scaleY = _ba.readFloat();
_lineArray[i].scaleY = _ba.readFloat();
}
}
}
}
Eddie Traversa
http://www.dhtmlnirvana.com/
Last edited by Eddie Traversa; 09-22-2006 at 10:20 PM.
Reason: typo
-
Senior Member
Essential AS 3.0 by Colin Moock
I think it will be a great resource for all of the Flash developers, who want to dive into AS 3.0
-
half as fun, double the price
Online Flex MXML & AS3 compiler:
http://try.flex.org/
-
Senior Member
Some article written by Danny Peterson (source: CommunityMX ) that explains some fundamental changes with the Player that requires developers to rethink theirs previous solutions.
Hope you'll find it useful
-
half as fun, double the price
Originally Posted by The Helmsman
Some article written by Danny Peterson (source: CommunityMX ) that explains some fundamental changes with the Player that requires developers to rethink theirs previous solutions.
Hope you'll find it useful
Thats probably not such a good reference now. There have been some changes since the Flex Alpha so its possible some of the information/code there is a little off and may not be correct for the current release version of AS3.
-
FlashInterface - Communicating between Flash 8 and Flash 9 SWFs
Hey gang, just thought I would let everyone know I built up a couple of classes that allow you to easily communicate between the ActionScript Virtual Machines (AVMs). You can dispatch events, talk to functions and properties synchronously through these class. The API is the same between both AS2.0 and AS 3.0. I needed to have this ability for a project I am currently working on and I am sure there will be many others who need this solution. Anyway check out the links below and have fun with them.
Article I wrote regarding the problem and solution:
http://www.flashextensions.com/blog/...and-solutions/
FlashInterface Page (Downloads, Documentation, and Examples)
http://www.flashextensions.com/produ...hinterface.php
Spread the news and let others know about these classes
Cheers,
Rob Taylor
info@flashextensions.com
Flash Extensions, LLC
Extend Flash. Extend Skills. Extend Possibilities!
-
[stuff] as3 sound visualising efx
Hi,
i´ve just finished some AS3 sound visualising stuff.
it comes up with a bunch of scripted sound spectrum
analytics, that visualise sound, react on sound or just
guide the sound.
show it to me
here is a short as3 script-snippet for you to play with.
it´s a tunnel effect, wich reacts on sound and turns
the tunnel inverse or straight forward. just a simple
little effect belonging on how high the sound spectrum
amplitude level is:
Code:
/////////////////////////////////////////////////////
// sound reactive tunnelizer
// author : frank reitberger
// site : http://www.dasprinzip.com
// copyright 2007
/////////////////////////////////////////////////////
// --------------------------------------------------------------------------------------------------
stop();
// --------------------------------------------------------------------------------------------------
///////////////////////////////////
// setup global vars
///////////////////////////////////
// sound related
var snd:Sound = new Sound();
var sndCnl:SoundChannel;
var byteArr:ByteArray = new ByteArray();
// sprite related
var dot0:Sprite = new Sprite();
var dot_vr:Number = 0;
var dot_ang:Number = 0;
stage.addChild(dot0);
// tunnelizer related
var zIndex1:Number = 0;
var modulo:Number = 0;
var tSwitch:Boolean = false;
// --------------------------------------------------------------------------------------------------
///////////////////////////////////
// start sound analytics
///////////////////////////////////
function sndAnalytics(event:Event) {
///////////////////////////////////
// sprite dot : move
///////////////////////////////////
var dot0:Sprite = stage.getChildAt(1);
dot_vr += Math.random()*.1-.05;
dot_vr *= .9;
dot_ang += dot_vr;
var vx = Math.cos(dot_ang)*3;
var vy = Math.sin(dot_ang)*3;
dot0.x += vx;
dot0.y += vy;
if (dot0.x > 380) {
dot0.x = 10;
} else if (dot0.x < 10) {
dot0.x = 380;
}
if (dot0.y > 390) {
dot0.y = 12;
} else if (dot0.y < 10) {
dot0.y = 390;
}
///////////////////////////////////
// analyse sound spectrum
///////////////////////////////////
getByte = 0;
SoundMixer.computeSpectrum(byteArr, true);
var i:int;
var w:uint = 2;
var num = undefined;
var type:String = undefined;
for (i=0; i<512; i+=w) {
var getByte:Number = byteArr.readFloat();
var n:Number = Math.floor(getByte * 100);
////////////////////////
// catch massiv amp
////////////////////////
if (i > 256 && n > 20) {
type = "massiv";
}
}
paintTunnelizer(type);
}
// --------------------------------------------------------------------------------------------------
///////////////////////////////////
// paint reactiv tunnelizer
///////////////////////////////////
function paintTunnelizer(type:String) {
zIndex1++;
modulo++;
var mc:MovieClip = new MovieClip();
mc.name = "circle__" + String(zIndex1);
mc.x = 200;
mc.y = 200;
stage.addChild(mc);
if (modulo==2) {
modulo=0;
mc.graphics.lineStyle(5,0x000033,.1);
mc.graphics.drawCircle(0,0,50);
} else {
if (type == "massiv") {
mc.graphics.lineStyle(5,0xffffff,5);
mc.graphics.drawCircle(0,0,50);
} else {
mc.graphics.lineStyle(5,0xffffff,.3);
mc.graphics.drawCircle(0,0,50);
}
}
dot0 = stage.getChildAt(1);
var getDotX:Number = Number(dot0.x);
var getDotY:Number = Number(dot0.y);
mc.x = getDotX;
mc.y = getDotY;
mc.sc = 1;
mc.alpha = 0.1;
for (var i:Number = 3; i < stage.numChildren; i++) {
var p = stage.getChildAt(i);
if (p.name.indexOf("circle__",0) != -1) {
var p1 = stage.getChildAt(i);
if (!tSwitch) {
p1.sc *= 1.2;
} else {
p1.sc *= .9;
}
p1.scaleX = p1.sc;
p1.scaleY = p1.sc;
p1.alpha+=.02;
if (type == "massiv") {
if (!tSwitch) {
tSwitch = true;
} else {
tSwitch = false;
}
}
if (p1.scaleX > 7) {
stage.removeChild(p1);
}
}
}
}
// --------------------------------------------------------------------------------------------------
///////////////////////////////////
// init
///////////////////////////////////
snd.load(new URLRequest("place path to your mp3 here"));
sndCnl = snd.play();
this.addEventListener(Event.ENTER_FRAME, sndAnalytics);
see it in action
get the source-fla
regards
drek
-
Actionscript 3, postproduction
[Share] Load assets from external SWF files.
As learned a lot from Flash community, I would like to share mine if it could help some.
Here is a method I used in my recently Flash AS3 game, to load assets from external SWF files and use them dynamically. Download as followed.
http://www.neatfilm.com/flash/download/LoadExternal.zip
-
Lumineccs [ Lumines clone ]
Hey Everyone,
I managed to make Lumines in Flash9/AS3.0.
Enjoy!
http://131.104.197.22/sites/spearetest/lumines.html
- Brad
-
Flash by name, Flash by nature
Something worth mentioning is the ActionScript 2.0 Migration appendix at the CS3 language reference site linked in the first post.
-
newb of many sorts
Actionscript 2.0 to 3.0 Migration
This is can be found from within the Language Reference link at the top. But just to point it out, here is the "Actionscript 2.0 to 3.0 Migration" table...
http://livedocs.adobe.com/flash/9.0/...migration.html
Search first, asked questions later.
-
Professional Flash Developer
A couple new AS3 Tutorials from www.8bitrocket.com
Creating Custom Events In Flash AS3 (Actionscript 3) - Create a simple Game
http://www.8bitrocket.com/newsdispla...?newspage=5776
Flash CS3: Actionscript 3 (AS3) Primer: Where does my code go?
http://www.8bitrocket.com/newsdispla...?newspage=5905
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|