ActionScript 3.0 :: Mp3 Player Functions - Create Next And Previous Song Buttons
Jan 27, 2009
I don't really use Flash anymore but have been approached by a client to work on a simple-function mp3 player with play, pause, prev, and next song buttons for their website. I'm using [URL] and wanted to learn how to create next and previous song buttons. Here is my code:
Im using text fields to display artist, album and song information for tunes that are played in a mp3 player. The text appears fine and with the right information. But when a new song is played the text field from the previous tune does not disappear and the new song information, just sits on top of it.i have attempted to use the remove child to fix this, but couldn't get it working? My code for the play function and the textfields is below,
ActionScript Code: var myFont = new Font1(); var mySongNameFormat:TextFormat = new TextFormat(); mySongNameFormat.size = 30;[code]...............
so I have this mp3 player I made. It won't go to the next song when a song ends sometimes. It will if the song is very short (10ish seconds) but once it gets to the 30 second mark it won't go.If you click on the slider at any point it will get to the next song, if you click the pause play button it will get to the next song.I have only been doing AS3 for a little bit and I am totally baffled by this problem.
I've attached the code as a .txt file, i sorted them into their sepperate files with a header. I hope its ok to read. I can post them differently or post the actual player need be.
I'm trying to make an MP3 player with art and text associated with each of the 4 songs I need included, but I can't figure out how to load more than one song into the player. The first song loads and plays fine, but when I try to load another one of the songs, I'm given this error:
Code: Error: Error #2037: Functions called in incorrect sequence, or earlier call was unsuccessful. at flash.media::Sound/_load() at flash.media::Sound/load() at RealSite_fla::mp3player_mc_6/goGS86()
And here is my code: var req:URLRequest; var sound:Sound = new Sound(); var controller:SoundChannel; var volumeControl:SoundTransform; var soundPaused:Boolean = false; var position:int; function loadSound(event:Event):void [Code] .....
Im looking for a why to display the current time position of a song playing in an audio player in a dynamic text box. I know the soundChannel. position references the current point of the songs, but I need some conceptual help translating that to a string and 00:00 time format dynamic text box
Im new in flash, and i have a problem in my mp3 player. im using flash cs3. When i click the link to play the song, it plays the song. but when i click another song, it plays the first song. by the way its an XML driven. here's the codes that i've tried
I am create a flash mp3 player. In that I am displaying the song.position(time completed played). The song.position is not setting to zero, when a new song is played. It is continuing with the previous song. For example, if the previous song time is 30 seconds. the song.position is started from zero and comes to 30 seconds. After that song is completed and a again a new song is started, the song.position is starting as 30 seconds and gets increasing. It is not setting to zero at the start of the second song. I even set the song.position=0, when the previous song is completed.
I have problem with the code below. its a flash mp3 player. I need to prevent it from autoplay from the start. but keeps on playing all the tracks after the user click on play. How can i fix this?
Code: import flash.filters.DropShadowFilter; var infostruc:Array = []; var xmlData:XML = new XML();
I have a series of calculations i'm doing over a bunch of objects stored in a array. Each function is pretty CPU demanding but if you only run one function, it just works fine.
So I made some a nifty a MP3 player that grabs songs from an XML file. It displays the song name in the dynamic text field. Unfortunately, I only have very little display space and many of the track names are long. The solution: marquee scroll the text horizonally. The problem: I never marquee scrolled dynamic text and now I am lost.
Here is my main AS: stop(); playlist = new XML(); playlist.ignoreWhite = true; playlist.onLoad = function(success) { if (success) { [Code] .....
And while this did make the text scroll on the first song, it doesn't work so hot on the second song. It blips back-and-forth between the first and second song name. Advance to a third song and you've got an even bigger blipping mess. I kind of think that this code above isn't the way to go... that it isn't even worth reworking... that I should try something completely new.
I have built an MP3 player using XML and this works fine. But I want this MP3 player to load a random song from the XML list everytime it runs.
I have this code: var my_songs:XMLList; var my_total:Number; var my_sound:Sound; var my_channel:SoundChannel; var current_song:Number = 0; [Code] .....
But it produces the error - Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error. at flashPlayer_fla::MainTimeline/playSong() at flashPlayer_fla::MainTimeline/processXML() at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n() at flash.events::EventDispatcher/dispatchEvent() at flash.net::URLLoader/flash.net:URLLoader::onComplete()
I have also tried to trace the problem by putting trace(my_songs[mySong].@URL) in the playSong() function but this doesn't do anything.
What do I need to put in my code to tell my mp3 player to grab its songs from a folder on my server via an xml doc I outputted from my sql server? (The mp3 player is also on the server).
Here's my code: import flash.events.MouseEvent; import flash.media.Sound;import flash.net.URLRequest; import flash.media.SoundChannel;import fl.events.SliderEvent; var myMusic:Sound = new Sound(); var soundFile:URLRequest = new URLRequest("lpwfte.mp3"); var channel:SoundChannel = new SoundChannel(); [Code] .....
At the moment, I am attempting to make a music player that will play a specific song of my choosing. I am stuck at the part where you can pause the sound, and then play it in the same place. I have tried many things such as using the timer utilities. Right now, when I pause it, it stops, and when I press play, it plays from the beginning. stop(); var channel:SoundChannel; var soundCheck:Boolean = true; var song:Sound = new Sound(new URLRequest("song.mp3")); channel = song.play(); [Code] .....
I downloaded player from [URL].. but I don't know why what the problem it had with with playlist. I had a playlist in xml file with songs. When i deleted the mp3 from the server, it is still playing. and when i changed the mp3 files it is still playing the original files. I don't know where these files were saved. I thought it was saved in my browser cache and i cleared it but it didn't work. I thought it was cached in my server, but in my localserver , i had the same problem.
So, again i downloaded the player, and this time it played different song, that i put. I have a hypothesis. Does flash player (swf object) absorb mp3 files?? i don't think so but how come player is playing the mp3 that has been changed or deleted? if it was in server cache then how long will it take to clear the cache and play new file. However, i don't remember coding something like 'cache'
I have a flash website that uses an XML player to play the artist's songs. The player works great. Now, I need a specific button in the flash document to call and play a specific song title from the XML list. The button I tried and that is showed in the flash code has an instance name of "santaBaby", calling a function I named "sampleSong1"Here's my XML playlist:
Trying to see if someone can guide me to a way I could stop my earlier tweens and onRollOver function when my onPress function is launched. What I worked out here with that McX/YScale.stop(); and that target9_mc.onRollOver = null; is kind of working but I don't want the onRollOver function to stop until the onPress function begins.
I am making flash CS4-based music player with ActionScript 3. When I host the player on my site, e.g. [URL], and play an mp3 on the server of my site, e.g.[URL], it works well.
When I link to an mp3 of another site, e.g. [URL], in my local machine, it also works. However, when I host the music player in my site [URL], and play an mp3 of [URL], then it can't be played.
I'm having some trouble with the code below. the flash player has a default volume slider, but I want to use the jQuery slider to change the volume. the volume value(nr) is changing while I move the slider, but the volume of the song doesn't.
I'm creating a new look for the xspf player: [URL]The playlist highlights the current song being played. I'd like to change the color but can't find where that option is listed in the .flv file, or in the actionscript file.
I have a list of mp3-songs, when song 1 is clicked it gets streamed, a stop-button appears, if this Btn is clicked, this Btn disappears as it should - but if user forgets to click for stopping sound and clicks song 2, stopBtn 1 remains and the new stopBtn 2 also appears. there should be only one stopBtn, the one next to the song is playing.
I would like to move the stopBtn and I have tried several approaches move; graphics.moveTo; if(stopButton !=null) {removeChild (stopButton)}; I packed the var stopButton:Sprite in the header and so on.
I am writing a mp3 player and having some issue getting the song length before the entire song has been loaded - which messes with my position indicator, as it needs to know the track length. I thought I could get the length from an ID3 tag, problem is ID3.TLEN returns undefined, though if I right click the track and show properties, the summary tab shows song duration, bitrate, etc... how I can retrieve the song length before the entire thing has been downloaded?
How do I create a download button for a song I have on my server. I just want a download window to pop out without the user having to leave the page.I tried this in the actions layer frame but it took me to the page only to listen to the song.[code]
i think i might be missing some information here about how to manage classes and display objects. In the main .fla i have a mc called player; so I made a player.as class and put a linkage on player mc considering it would work as the mcs class. Well, its not working, the mclip is not noticing any of the vars and functions i added in the class. Anyone figures whats going on? How to make it work?
A few months ago, I started noticing a small annoyance in Flash and the Flash Player. This small annoyance quickly became a rather large inconvenience, so I recently started googling a solution. Nothing to be found, unfortunately.Here's my problem:When I open a swf file with the standalone Flash Player (any version), the size of the player is set to the size of the last swf file I loaded with the "File - Open" dialog. By the way, when I use the file dialog to open files, the player resizes appropriately.An example:I open a swf with "open with - Flash Player" and the Flash Player sets its size to 320x240 instead of the swf's size, 640x480. Or I open a swf that should be 550x400 and it opens at 320x240. The Flash Player always uses the dimensions of the last file opened with "File - Open."
This problem even affects the Flash CS3 built-in "Test Movie" player.The problem is a little difference within the "test movie" player. It seems to keep whatever the dimensions were the last time you resized the player yourself, and full screen mode doesn't work properly.I tried upgrading, downgrading, editing the
I've got my variables set out in a layer on the main stage. I've also got a MovieClip which I want to write some code within but reference a variable in the main frame. I tried just referencing the variable name but it didn't find it. I then tried root.variable name but I'm now getting this error message:
ActionScript Code: Symbol 'character', Layer 'CODE', Frame 1, Line 2 1119: Access of possibly undefined property deathReset through a reference with static type flash.display:DisplayObject.
I am working on a project, an online document, that is going to require buttons for next page and previous page. I have laid out the document in InDesign and have created the buttons in Flash. My only problem is I don't know how to add that interactivity. I'm guessing it is just a couple lines of ActionSctipt but I am not sure.
I'am making a advanced mp3 player arund this tutorial: [URL] and i want the users of the player to see how long they have listen or how long time back of the song. i have the AS i what to use but i cant connect them. becuase the tutorial i used does not make a sound objekt (MUSIC)