Simple mp3 player
Outside of the clunky media player component can someone give
me guidance on how to setup a custom player with these functions. A
counter/timer would be nice too but all I have is script for play
and stop which looks like this:
client_nc = new NetConnection();
client_nc.connect("rtmp://"+_level0.rtmpserver+"/fooserver/");
play_btn.onPress = function() {
in_ns.close();
in_ns = new NetStream(client_nc);
Replay_video.attachVideo(in_ns);
in_ns.setBufferTime(5);
in_ns.play("audio.mp3");
stop_btn.onPress = function() {
in_ns.close();
I'm basically just looking to add some script to this to add
a scrubber and a timer/clock if possible. Many thanks for any help
in advance!
Regards,
-Kjup
It looks like you are using code to play flash video (FLV),
and not an MP3. Make sure you are using the sound object to play
mp3s.
Here are a couple good tutorials:
http://kennybellew.cowfly.com/tutorial/
http://www.lynda.com/info/books/flash8btb/sample.aspx
First steps to play an mp3 using actionscript (see the tuts
for more details)
- Define an empty movie clip in actionscript
- Create the sound object variable
- Load the sound set it either to start streaming/playing
right away (true), or load completely without playing (false)
- Start the sound (using movieclips)
Play, pause/stop buttons
PLAY - use the start(); command. to start at beginning of mp3
you don't need to set any value.
PAUSE - capture the POSITION of the mp3 to a variable when
this button is pressed. In your start button, you add the variable
inside the brackets start(). position is captured in milliseconds
so you have to divide by 1000 to get seconds.
STOP - use stop('name of sound'); , or stop(); or
stopAllSounds();
Progress Bar:
Adobe LiveDocs
http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/js/html/wwhelp.htm?href=0000158 1.html
Similar Messages
-
Simple mp3 player not working :( action script error
Hi Everyone!
I'm wondering if anyone can help with this problem:
I am currently designing a website and creating a simple mp3 player with an on / off function but doesn't appear to be working. I am getting this error:
1095: Syntax error: A string literal must be terminated before the line break.
1083: Syntax error: end of program is unexpected.
1084: Syntax error: expecting rightparen before end of program.
1084: Syntax error: expecting rightparen before end of program.
1084: Syntax error: expecting rightparen before end of program.
1084: Syntax error: expecting rightparen before end of program.
I have uploaded a zip file containing the images and FLA file. I'm wondering if someone wouldn't mind taking a look for me and telling me how to fix this problem:
http://www.c-recordz.co.uk/download/mp3_player.zip
Thanks
DaviesHi Davies,
On line 19 don't break the line, Flash will do it for you... other aspect that I would recomend is to not put the '$' on the variables. In AS2 variables don't need to be declared as such (although it's a good policy), instead of the '$' put the 'var' word, as you already have in those variables.
Greetings
Leo -
Create a very simple mp3 player with flash
newbie with flash...
with the FLVPlayback component i can get a nice looking basic player for .flv files easily...
Q: is there some way to set up the same functions to create a very simple mp3 player with flash?Search Google for "Flash MP3 tutorial" and if you know which version of actionscript you plan to use, try substituting that for "Flash"
-
How do I build a simple MP3 player in Flash?
I have recently redesigned my website and need to make
several mp3 files available for playback. I'm a voiceover talent,
and I need to have my demos readily available to those who visit my
website to hear my work.
I built the site using Dreamweaver (there's a little bit of
Flash content there, but the site itself is not a Flash site). I
know just anough about using Flash to be dangerous. :-) At the
present time, I just embedded my 11 demos on a page, with each demo
appearing TWICE -- once with the Windows Media Player embedded and
once with the Quick Time player embedded -- to allow for maximum
compatibility. But with 22 media players embedded in the page,
well, you can pretty much guess what happens -- the page takes a
freakin' eternity to load. No one's going to wait that long.
In a previous version of my website, I had deployed a
third-party app called Wimpy Button to achieve this functionality
(www.wimpyplayer.com). Wimpy button is a very simple little Flash
app that is designed to achieve precisely the functionality I need.
But now when I launch the Wimpy Button Maker (the first step to
creating the player), I get an error message that I think is
telling me that either a .dll file required by the program is not
there on my computer OR that a program I have since installed on my
computer is either using or has overwritten that .dll file. Either
way, the Wimpy solution is not working for me. So naturally, since
Wimpy was doing all this in Flash, I figured the most logical place
to turn was to Flash itself. I'm hoping to create my own little
playback interface that I can place in multiple instances on the
webpage, with each one set to trigger playback of a different .mp3
file.
Here's an example of something similar to what I'd like to
end up with. Visit
http://randybrown.voice123.com.
There, you'll see a series of players down the right-hand side of
the page, and each one triggers playback of a different .mp3 file.
A closer look at the .swf file can be seen at
http://voice123.com/swf/small_player.swf
, so, as you can see, the graphic itself ain't that complicated. I
know I can build the graphics file (or something similar) without
too much difficulty.
But getting it to have the functionality I need to deploy for
this purpose is where I'm lost. I just don't have enough experience
with Flash to have much of a clue.
Can anyone walk me through the steps involved?
Your thoughtful answer would be MUCH appreciated.
RandyThe best MP3 player I ever found for flash uses xspf
playlists and xml - really cool and easy to use/implement. Check it
at
http://musicplayer.sourceforge.net/
This player will go through a playlist you determine, or can jump
from track to track. It takes a little bit of testing to set up,
but is much simpler than writing your own player - and it's free. -
What is an easy way to create a very simple flash mp3 player
in DW CS3? I
tried the DW mp3 plugin, but that caused confusion for
visitors who did not
know how or want to install a plugin. I googled "flash mp3
player" and
there are many available, but they support play lists and
many other
features. I just want to play one static mp3 url and have
Quicktime-like
controls of play, pause, rewind, etc. Any suggestions or
tutorials on how
to do this? If there is a simple tutorial on how to roll your
own in Flash,
I have Master Collection which includes Flash.
Best,
ChristopherI spent a couple of days reviewing various flash mp3 players
on the net and
decided to use SoundPlayer from FlashLoaded.com. For $35 it
works OK. But
here's my question. Why doesn't DW CS3 include a flash mp3
player component
similar to the flv player? Or did I miss it? Yes, I know the
generic
plugin can be used, but that requires visitors to install an
additional
plugin. Adding mp3 players to web pages would seem like a
common problem in
search of a simple solution in DW; why isn't a flash solution
included with
DW CS3 and/or Flash CS3? Am I missing something? This was my
first Flash
project, so perhaps I overlooked the obvious.
Best,
Christopher -
Simple Mp3 Player EQ Style Playlist
I'm trying to find a simple eq like mp3 player like this
http://www.flashkit.com/movies/Sound/Players/Small_EQ-Cosmin_V-11746/index.php
that will play a few tracks automatically and when done it will
start again with the first track? Can anyone point me in the right
direction? I just want to stick something simple in the corner of
one of my pages. ThanksI'm trying to find a simple eq like mp3 player like this
http://www.flashkit.com/movies/Sound/Players/Small_EQ-Cosmin_V-11746/index.php
that will play a few tracks automatically and when done it will
start again with the first track? Can anyone point me in the right
direction? I just want to stick something simple in the corner of
one of my pages. Thanks -
I need either a flex or flash mp3 player that uses an xml
playlist and runs on FMS3. Our new FMS server is working great and
we've been successful at installing samples that came with the
server as well as the tutorials in the Adobe developer's site. The
thing is... I'm a CF developer and while I can navigate flex and
flash (have downloaded trials for both now) I am unable at this
point to write an application.
Can anyone direct me to a product (free or for sale) that
gives me a nice small skinable mp3 player with just
play/stop/pause/volume controls and allows the user to select a
file from an xml playlist. I'd like source files so I can modify
but that's not necessary as long as the product is configurable. I
can find no such creature via google search. TIA!How are you trying to transfer the files? Are these definitely MP3 files and what are the specifications of the files?
-
Hi, I have a very simple MP3 player on my flash site in the
form of a movie clip.
1. When I open up the page the player is on, it starts
playing a song immediately despite the fact I added stop and
stopallsound action script. How can I fix the code so a song only
plays when the user clicks on the play button?
2. The music plays even when the user visits other pages
outwith the original music page which is good. However, when the
user clicks back onto the music page the song stops then starts
from the beggining again. Anyideas how to keep the music playing
continuously when the user visits the music page again.
3. How difficult would it be to add a progress bar so the
user could rewind/fastforward to different parts of a song being
played?
Thanks for any help, Ive attached the code.I am faced with the same issue. I have my player the way I
want it, but I don't want the music to auto start.
Meaning that the web visitor should have to press the play
button to hear the music.
anyone know the proper actionscript I need to add? -
Are there any cs4 source files anywhere for a simple mp3 player?
I looked in the components for a mediaplayer component and I don't see it.I found the MediaPlayBack component, but I would like to see something like it in an cs4 movie. I cannot publish anything with as2 because flash professional cannot find toplevel.as, even though it is there. It seems like there must be a basic mp3 player out there somewhere with the source code available so people don't have to start from scratch.
-
Hi, im working for a simple mp3 player.
I have the music on the server, then on the "NEXT" button i
have:
stop member("songm")
member("songm").url = "
http://website.com/music/"&song_list[x
member("songm").play()
the member songm is a shockwave audio, i change the URL
according with the follow list:
song_list=["son1.mp3","song2.mp3", "song3.mp3"]
i must stop each time the member to get the other song
playing, it works very good, but for some reason make the internet
explorer crash, you can see a demo here:
http://www.idolofthebands.com/main/mp3.htm
it plays very good, but if you click on next or prev it
crash, some idea?
ty in advance.What do you see in the alert box, if you try it with this
line inserted before your stop function?
alert( member("songm") & " state: " &
member("songm").state )
- Ben -
Setting up Simple Flash mp3 Player
I have a page with some links to mp3 songs.
I would like to set things up so that when user clicks a mp3 link, a small flash mp3 player (embedded in the page) starts playing with that songs. The user could click on another song that would replace the last one at any time and have basic controls.
- flash mp3 player - need 1 that has start / stop and volume buttons (simple)
BTW: I set this type of thing up in the past with a frameset - top had quicktime player embedded - and bottom song links went to top frame - all was fine but kind of bulky.... looking for something a bit slicker...
Also would like to do the same for flash / quicktime videos
Also if there's something free or close to free that is a jukebox type where the song list is part of flash - that might be fun too....
Thanks in advance - daveWimpy MP3 Player will do everything you want (not free).
http://www.wimpyplayer.com/products/wimpy_mp3.html
Free Flash MP3 Player
http://www.flashmp3player.org/
Premium Beat Free Flash MP3 Player
http://www.premiumbeat.com/flash_resources/free_flash_music_player/#mp3Players
A Google search will reveal many others.
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
http://alt-web.com/
http://twitter.com/altweb
http://alt-web.blogspot.com -
Need help embedding a mp3 player swf with xml playlist
Im a noob to Flash (started tuesday, haha) and so far everything is coming along just fine, but i need to put music in the swf. I have a button set up that slides a swf mp3 player in from the side but i dont know how to make the playlist work with it.
The player is from this site:
http://www.bezzmedia.com/swfspot/samples/flash8/Mp3_Player_with_XML_Playlist
Using the xml playlist with html is simple enough, but im not sure how to use it with Flash Catalyst. Is there an easy way to do this?
My original plan was to have a text list of the songs with a play button next to each one, then when you click on the play button it would set the state of any other songs to Stopped so you can just pick what song to play and if another song was playing it would stop. Im not sure how to do this either (like i said, i started learning this week), so i just tried embedding someone else's (ugly) mp3 player.
Anyway, if anyone knows a relatively easy way to have a playlist in my swf please let me know. Thanks!If I understand you correctly, you've imported a SWF into Catalyst using Import Artwork on the File menu. When your app runs, you want to pass that swf a parameter that tells it what URL to read a data file from. The SWF is not one that you've created, rather, you got it from some web site.
This is not something that you can do in Catalyst. However it should be possible to do in Flash Builder. I found an article discussing several ways to do it, at http://www.actionscript.org/forums/showthread.php3?t=175951. One idea is the following code snippet
<fx:Script>
<![CDATA[
import flash.events.*;
private function setVars(event):void
event.target.content.yyyyyy = "zzzzzz";
]]>
</fx:Script>
<mx:Image source="xxxxx" complete="setVars(event)" />
where "xxxxx" is the path of the SWF (you can put it somewhere in your Flash Builder project, or reference it via an URL), and yyyyy is the name of the parameter that the SWF expects, and zzzzzz is the path to the data file. The <Image> tag is what Catalyst created when you imported the SWF. (btw.the Image and SWFLoader tags are almost identical).
I hope this gives you enough info to make progress. -
How can I get Itunes songs to my mp3 player (Sony Sonic Stage)?
I've browsed through the forums and it seems a lot of people want to export Sonic Stage files to Itunes!
I want the opposite. I just bought 100 songs from Itunes and can't get the m4a format changed in the Itunes advanced setting and I can't import the songs into my mp3 player (Sony Sonic Stage) because the files don't appear as part of my folder when searching (even though I'm looking for "all files").
I tried the Windows explorer to drag and drop from the Itunes folder to my mp3 player (it is flash based but loaded through the software SonicStage)and it didn't work.
I REALLY don't want to burn all of the new tracks to a CD to try to transfer them all back onto my mp3 player. Am I missing something really simple or is this a compatability flaw? I won't buy any more songs if it's the case but your assistance is GREATLY appreciated
Compaq Windows XP Using Sonic Stage Sony MP3 WalkmanDrag them there
-
Getting my mp3 player to work with rmmod ehci-hcd
Dear all,
I have a sansa fuze mp3 player. It can be configured to be in either MTP or MSC mode;
I'm using the second, meaning that the computer should see it as a simple mass
storage device. I remember using that a couple of years ago with Debian and I'd simply
plug it in and it would work.
Now I have the following problem: when I plug it in, I cannot see it with fdisk -l:
[jorge@flamingo ~]$ sudo fdisk -l
Password:
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe8000000
Device Boot Start End Blocks Id System
/dev/sda1 * 63 40965749 20482843+ 7 HPFS/NTFS/exFAT
/dev/sda2 40965750 45062324 2048287+ 7 HPFS/NTFS/exFAT
/dev/sda3 45062325 45271169 104422+ 83 Linux
/dev/sda4 45271170 234436544 94582687+ 5 Extended
/dev/sda5 45271233 68131664 11430216 83 Linux
/dev/sda6 68131728 72180044 2024158+ 82 Linux swap / Solaris
/dev/sda7 72180108 234436544 81128218+ 83 Linux
[jorge@flamingo ~]$
This is what I get in dmesg:
[jorge@flamingo ~]$ dmesg | tail
[ 9906.598074] wlan0: associate with 00:18:e7:ee:75:e5 (try 1)
[ 9906.602459] wlan0: RX AssocResp from 00:18:e7:ee:75:e5 (capab=0x431 status=0 aid=1)
[ 9906.602463] wlan0: associated
[ 9906.604145] ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 9917.055720] wlan0: no IPv6 routers present
[10399.946003] hub 7-0:1.0: unable to enumerate USB device on port 3
[11117.825661] hub 7-0:1.0: unable to enumerate USB device on port 3
[11119.605622] usb 7-3: new high speed USB device number 14 using ehci_hcd
[11119.659249] hub 7-0:1.0: unable to enumerate USB device on port 3
[11149.949776] usb 7-4: USB disconnect, device number 10
[jorge@flamingo ~]$
However, if I plug it out, then do "rmmod ehci-hcd" and plug it back again, I get it to
work:
[jorge@flamingo ~]$ sudo rmmod ehci-hcd
[jorge@flamingo ~]$ sudo fdisk -l
Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xe8000000
Device Boot Start End Blocks Id System
/dev/sda1 * 63 40965749 20482843+ 7 HPFS/NTFS/exFAT
/dev/sda2 40965750 45062324 2048287+ 7 HPFS/NTFS/exFAT
/dev/sda3 45062325 45271169 104422+ 83 Linux
/dev/sda4 45271170 234436544 94582687+ 5 Extended
/dev/sda5 45271233 68131664 11430216 83 Linux
/dev/sda6 68131728 72180044 2024158+ 82 Linux swap / Solaris
/dev/sda7 72180108 234436544 81128218+ 83 Linux
Disk /dev/sdb: 3933 MB, 3933732864 bytes
122 heads, 62 sectors/track, 1015 cylinders, total 7683072 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6f20736b
This doesn't look like a partition table
Probably you selected the wrong device.
Device Boot Start End Blocks Id System
/dev/sdb1 ? 778135908 1919645538 570754815+ 72 Unknown
/dev/sdb2 ? 168689522 2104717761 968014120 65 Novell Netware 386
/dev/sdb3 ? 1869881465 3805909656 968014096 79 Unknown
/dev/sdb4 ? 2885681152 2885736650 27749+ d Unknown
Partition table entries are not in disk order
[jorge@flamingo ~]$
My problems with this solution are:
1. It's a little bit inconvenient to do this everytime
2. The first time that I did that I had an external drive plugged in and it got a little bit
screwed up.. Had to run a disk check and fix some errors.. So I'm a little bit cautious
about doing it again.
Could you please enlighten me as of:
1. Why do I need to do the rmmod thing to get my sansa player recognized?
2. Is there a way to overcome this procedure?
Thanks a lot in advance..
Last edited by geo909 (2011-10-02 03:20:03)To work in FF and IE, you need to have an <object> tag and an <embed> tag. Note: the embed tag was never accepted by the W3C web standards but it works in browsers that require it.
So your code should resemble this:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="366" height="56">
<param name="movie" value="Player-skin.swf">
<param name="quality" value="high">
<embed src="Player-skin.swf" quality="high" type="application/x-shockwave-flash" width="366" height="56"> </embed>
</object>
If you need a small flash audio player that works in all browsers consider the following links
Flash Music Player -
http://www.premiumbeat.com/flash_resources/free_flash_music_player/
MP3 Player
http://flash-mp3-player.net/
Nancy O.
Alt-Web Design & Publishing
Web | Graphics | Print | Media Specialists
www.alt-web.com/
www.twitter.com/altweb
www.alt-web.blogspot.com -
Looking for J2ME MP3 Player Code
Hello,
I just started writing a J2ME MP3 player application. The MP3 files are stored in the device's flash memory, not streamed through the air. The user interface would be simple and device-independent. I am searching for source code that I can learn from or modify. Is there a J2ME MP3 player open-source code?
T.I.i've got one but i will never give you the code !!!!
i can help you with your code (errors, debugging,...) and give you some tips to start:
1- search on google
2- start coding
3- test your app and come here when you will have a problem with the Manager.createPlayer.....
good luck !
Maybe you are looking for
-
How to deploy and run of a mapping created in owb in developer suite
Hello, could you please help me to check where is wrong? I use WAREHOUSE BUILDER of ORACLE 9I DEVELOPER SUITE and I do it as below: 1, create a OWB REPOSITORY named "OWB" with WAREHOUSE REPOSITORY Assistant in the SUITE ; 2, create a OWB Runtime REPO
-
How to monitor DAQ card outputs during TestStand operation?
I am trying to debug a rare failure mode on a test station that runs on TestStand. TestStand controls measurement equipment through a PCI-GPIB controller and a DUT and DUT switch box through two NI-DAQmx devices; PCI-6509, and PCI-6534. I believe tha
-
I now have a Lacie D2 1TB hooked up to my sole Firewire 800 input, If I get another identical Lacie, would it be OK to use the 1st one for Timemachine as I do now, and hook another to it for data? As of now I have the Lacie patitioned into 3 parts...
-
Creating a Hierarchy of Tables
Hello everyone, I've started building a GUI application in Java, and I was looking for a way to display expandable, nested tables. What I mean is having an option to click certain squares, causing sub tables to be displayed in the row below, moving t
-
In Leopard, we can right click to access "burn folder" option. Now in Lion, we cannot even create a keyboard shortcut for such action... Anybody knows ?