Flash CS3 - Flash CS4

Free tutorials and scripts for all.
Actionscript 3.0

Sound class - Flash CS3 audio player

This is a discussion on Sound class - Flash CS3 audio player within the Tutorials forums, part of the Flash English category; I'd like to use an unconventional term to describe the new Sound class of Actionscript 3.0: it rocks! ...


Go Back   Forum Flash CS3 Flash CS4 > Flash CS3 Flash CS4 > Flash English > Tutorials

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-10-07, 17:13
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,535
Rep Power: 6
Flep is on a distinguished road
Sound class - Flash CS3 audio player

I'd like to use an unconventional term to describe the new Sound class of Actionscript 3.0: it rocks!
Substantially it stayed the same, but with the support of the Socket class you can really exploit it.
For example you can create proper sound mixers and using graphics alongside them, you can get exceptional results ( it's not my case as my graphics are awful ).
With this example I want to focus especially on the SoundMixer and its computeSpectrum class, attaching to it the new ByteArray to manage binary data blocks.
Here is the result:






The classes I've written and used for my audio player are 4:

FlepPlayer.as

Grafico.as

ControlloVolume.as

Balance.as


Source files:
Attached Files
File Type: zip audio_player.zip (51.6 KB, 91 views)

__________________

 


I recommend: Essential Actionscript 3.0

- I do not reply technicians pvt messages. Open a thread !
- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !

Last edited by Flep; 28-08-08 at 06:49..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

  #2 (permalink)  
Old 13-11-07, 02:48
Member
 
Join Date: Nov 2007
Posts: 59
Rep Power: 2
gwulfwud is on a distinguished road
Re: Sound class - Flash CS3 audio player

hey flep, i looked into the source files..got a few questions though..

im a noob in as 3.0 so bear with me..

i noticed you have the following functions inside your constructor...does it really help to just declare the functions you want inside the constructor? and those functions will run depending on who you declared first right?

Code:
        public function FlepPlayer()
        {
            initMe();
            initButtonsEvents();
            initSound();
            initTimer();
            initGrafico();
            initControlloVolume();
            initControlloBalance();
        }
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 13-11-07, 06:52
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,535
Rep Power: 6
Flep is on a distinguished road
Re: Sound class - Flash CS3 audio player

Hi

That way is the best practice.
The constructor calls the methods to inizialize the application
__________________

 


I recommend: Essential Actionscript 3.0

- I do not reply technicians pvt messages. Open a thread !
- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 14-11-07, 03:16
Member
 
Join Date: Nov 2007
Posts: 59
Rep Power: 2
gwulfwud is on a distinguished road
Re: Sound class - Flash CS3 audio player

well said.

Thanks man!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 14-11-07, 03:27
Member
 
Join Date: Nov 2007
Posts: 59
Rep Power: 2
gwulfwud is on a distinguished road
Re: Sound class - Flash CS3 audio player

another question again flep.
how come my buttons won't act like buttons? i mean it won't do the rollover and stuff..well, im kinda trying to imitate your codes like starting it from scratch so as to help me understand the process..i was able to load the sound but i can't have the buttons behave as buttons...

please help..

thanks!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 14-11-07, 03:41
Member
 
Join Date: Nov 2007
Posts: 59
Rep Power: 2
gwulfwud is on a distinguished road
Re: Sound class - Flash CS3 audio player

never mind, i got my answer!
although i got another question with that...coz i noticed you have to instantiate the MOUSE_OVER event before you can pause the song...now why do you have the event:Event thing inside the brackets of the function?

Code:
        public function colorPlayOut(event:Event):void
        {
            player_mc.play_mc.out_mc.visible=true;
            player_mc.play_mc.over_mc.visible=false;
        }


with that said, i was able to pause my music but i can't restart it event though i have the play function for the play movieclip button. btw when i was building the code i started from scratch and copied your codes one by one starting from loading the sound to making the buttons work so the functions are most of the time very incomplete...i guess my main question is do i really have to put the _channel thing on the play function?

Code:
        public function onPlay(event:MouseEvent):void
        {
            player_mc.pause_mc.isPressed=false;
            player_mc.pause_mc.out_mc.visible=true;
            player_mc.pause_mc.over_mc.visible=false;
            _channel.stop();
            _channel=_sound.play(_position);
            _playing=true;
        }

sorry i just had to ask as i can't find the answer on livedocs




=D

thanks again
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 14-11-07, 04:03
Member
 
Join Date: Nov 2007
Posts: 59
Rep Power: 2
gwulfwud is on a distinguished road
Re: Sound class - Flash CS3 audio player

EDIT:
I apologize, i really have to another one =D

My buttons are all messed up, when I pause the song it pauses and i press it again it plays, but something went wrong when i pressed either the play or pause (not really sure) another song was loaded and played..now there are two songs playing almost at the same time, you'll know coz when you press pause again the echo like sound of the song will stop but press it again and it starts all over again..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 14-11-07, 05:33
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,535
Rep Power: 6
Flep is on a distinguished road
Re: Sound class - Flash CS3 audio player

Hi,
are you using it as a multiplayer ?
__________________

 


I recommend: Essential Actionscript 3.0

- I do not reply technicians pvt messages. Open a thread !
- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 14-11-07, 15:40
Member
 
Join Date: Nov 2007
Posts: 59
Rep Power: 2
gwulfwud is on a distinguished road
Re: Sound class - Flash CS3 audio player

well im planning to use it as a multiplayer...but for now, i want to really understand the concept behind loading a single music file..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 14-11-07, 15:46
Administrator
 
Join Date: Jul 2007
Location: Cesena
Posts: 4,535
Rep Power: 6
Flep is on a distinguished road
Re: Sound class - Flash CS3 audio player

Can you paste here the code that you get problems with
__________________

 


I recommend: Essential Actionscript 3.0

- I do not reply technicians pvt messages. Open a thread !
- Non rispondo ai messaggi privati con domande tecniche. Apri una discussione sul forum !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads

Thread Thread Starter Forum Replies Last Post
Multi Audio Player Flep FlepStudio utilities 30 30-12-08 20:59
Flash CS3 Creare player audio lu91 Flash Italiano 2 08-07-08 10:38
audio player play list gwulfwud Actionscript 3.0 newbies 4 17-12-07 07:04
Informazioni per Multy Audio Player appol560 AIUTO utilità free 8 20-09-07 06:35
multi player audio azeloth AIUTO utilità free 1 04-09-07 11:52


All times are GMT. The time now is 16:19.

Powered by vBulletin version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC4
Forum SiteMap