A Flash Developer Resource Site

Page 1 of 3 123 LastLast
Results 1 to 20 of 50

Thread: Welcome to the AS3 Forum :: Resource Thread

  1. #1
    supervillain gerbick's Avatar
    Join Date
    Jul 2000
    Location
    undecided.
    Posts
    18,986

    Thumbs up 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

    [ Hello ] | [ gerbick ] | [ Ω ]

  2. #2
    Senior Member UnknownGuy's Avatar
    Join Date
    Jul 2003
    Location
    Canada
    Posts
    1,361
    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!

  3. #3
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,449
    Several tutorials including a basic AS3 tutorial on this site.
    - The right of the People to create Flash movies shall not be infringed. -

  4. #4
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    Generating sounds dynamically:

    http://www.flashcodersbrighton.org/wordpress/?p=9

  5. #5

  6. #6
    Senior Member Boombanguk's Avatar
    Join Date
    Jun 2000
    Posts
    1,194
    my own magazine site, has a section for Flash9 / AS3

    www.flashculture.com/flash9as3.htm

    currently has 29 links.

  7. #7

  8. #8
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,358

  9. #9
    Junior Member
    Join Date
    Sep 2006
    Location
    Australia
    Posts
    1

    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

  10. #10
    Senior Member The Helmsman's Avatar
    Join Date
    Aug 2005
    Location
    _root
    Posts
    449
    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

  11. #11
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,358
    Online Flex MXML & AS3 compiler:
    http://try.flex.org/

  12. #12
    Senior Member The Helmsman's Avatar
    Join Date
    Aug 2005
    Location
    _root
    Posts
    449
    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

  13. #13
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,358
    Quote 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.

  14. #14

    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!
    FlashExtensions - Video Tutorials for the masses
    Extend Flash. Extend Skills. Extend Possibilities.

  15. #15
    Member
    Join Date
    Jul 2000
    Posts
    59

    [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

  16. #16
    Actionscript 3, postproduction georgecalgary's Avatar
    Join Date
    Jun 2005
    Location
    Toronto
    Posts
    229

    [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

  17. #17
    Junior Member
    Join Date
    Mar 2007
    Posts
    6

    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

  18. #18
    Flash by name, Flash by nature
    Join Date
    May 2006
    Location
    Oslo, Norway
    Posts
    70
    Something worth mentioning is the ActionScript 2.0 Migration appendix at the CS3 language reference site linked in the first post.

  19. #19
    newb of many sorts Ralgoth's Avatar
    Join Date
    Apr 2002
    Posts
    466

    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.

  20. #20
    Professional Flash Developer
    Join Date
    Aug 2007
    Location
    California
    Posts
    105
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center