After being missing 2 days of publications on the blog, I announce a fresh for the readers, after much research, testing and inventing, there could achieve an ambitious project.
Create an mp3 player for any application to flex with an equalizer, means something complicated in the beginning, but with a beautiful final result ![]()
Come to detail:
* Www.msdevstudio.com
* MP3 Player v1.0
* A simple mp3 player made entirely in action script, extending
* A canvas, with a spectrum analysis, which shows us how we can use
* Flash.media.SoundMixer of the data for variations of the spectrum
* Audio and with them drawing their variation of the waves in a row.
*
* We can set the color of the spectrum, and fund, and autoplay urlMP3
* By default:
* CorSpectrum: # 43ADF0;
* CorFundo: # 202021;
* Autoplay = false;
* UrlMP3 = http://www.msdevstudio.com/music/Obssesion.mp3
*
* To use just copy the package (and preserving the directories with names-> msdevstudio-> playSound)
* To the folder of your project, and this player is now available in the window components in custom
* Or if you prefer to use in action script, use only to test:
*
* Import com.msdevstudio.playSound;
*
* Var meuPlayer: playSound;
*
* And a function:
* MeuPlayer.corSpectrum = "# 43ADF0";
* MeuPlayer.corFundo = "# 202021";
* = MeuPlayer.urlMp3 "http://www.msdevstudio.com/music/Obssesion.mp3";
* AddChild (meuPlayer);
* MeuPlayer.play ();
*
* The methods are available:
*
* MeuPlayer.play ();
* MeuPlayer.stop ();
* MeuPlayer.pause ();
* MeuPlayer.resume ();
* MeuPlayer.autoPlay = false / true;
* MeuPlayer.corSpectrum = "# 43ADF0"; / / color
* MeuPlayer.corFundo = "# 202021", / / color
* = MeuPlayer.urlMp3 "http://www.msdevstudio.com/music/Obssesion.mp3"; / / file MP3/Audio
*
* These options are also available on the dashboard of properties, in general, are more easily define the options.
*
* By Mario Santos
* Www.msdevstudio.com
* Creative Commons by-nc-nd 3.0 unported
*
Look at the picture:
They can increase and decrease its size almost without limitations ... its use as stated above is very simple .. see some customization ...
Take the example online here with source code available
If you want only the package, to download here
ps The code is not yet commented further on ... do it.
He gave work, but you deserve! : p
These comments come from there!
Hug.














7 Comments
staff? someone already tested my example online? here at home is with the equalizer stopped ... someone happens to be the same?
Already tested at home?
ps seem to work after a few seconds ... I have to see what happens ... I think we will see the streaming ... Tomorrow ... wait a few seconds to see the equalizer to operate ...
Hug.
Well, in principle will be in place as it should be, test and let your views and experiences.
Hug.
I can not see the example. I get a sandbox violation (error below), and strangely trying to read a swf who visited a site yesterday.
SecurityError: Error # 2121: Security sandbox violation: SoundMixer.computeSpectrum: http://www.msdevstudio.com/blog/flexSource/testAS3Mp3Player/tutorial.swf can not access http://www.montedasfaias.com/som.swf. This may be worked around by calling Security.allowDomain.
flash.media at: $ SoundMixer / computeSpectrum ()
at com.msdevstudio: playSound / specChange ()
flash.utils at: Timer / _timerDispatch ()
flash.utils at: Timer / tick ()
Is working so.
Pagongski, this error is very strange and it seems that just may have to do with the browser's cache, try to clear the cache or esperimentar with another browser (IE / Firefox)
Since the sandbox is to access or have a request pending for this link som.swf.
If clearing the cache should work!
Vitor, Thank you for confirmation.
Hug.
Man, very good, huh?! Congratulations!
No need to blame for waited two days without updating the blog ... I have a few 2 months without updating my!
I am going to police to follow his example.
Hug!
Elvis Fernandes
Elvis hehehe
Thanks for the comment.
Hug.