Make a Fake Mp3 Player in Flash CS4(AS3)

Hi,
I am trying to Pause and Play A song.
Details:
I made a new project.
--> File > Import > Import to Library > (choose mp3 song)
Drag mp3 song from Library to stage.
Press (Ctrl+Enter)
The result is that the song plays.
My question is:
Is there code to make the music "Pause" and "Play". Is there a way to directly influence the playing file?
Anything helps
~Thanks

Is it possible.
Here's a link to a tutorial on how create this
DISCLAIMER: This an intermediate to advance level so it will take sometime to understand
http://flashspeaksactionscript.com/create-a-mini-music-player-in-as3/
HTH

Similar Messages

  • Getting Information from ID3 tags from streamed mp3 files in Flash CS4 AS3.0

    Hi everyone:
    I have spend my whole day trying to find a good way to access ID3 tags in AS3.0; but didn't find anything helpful.
    In my project I am making a sound object and assigning it a URL:
    Then I stream the sound into a sound channel:
    var s:Sound = new Sound(new URLRequest('URL here"));
    var sc:SoundChannel;
    My problem:
          I want to read the ID3 tag somehow and display the artist name or anything in the ID3 tag, onto the screen.
    Complication:
         I Have the URL change through user input, and naturally I want to update all the information with the new ID3 tags information.
    var s:Sound = new Sound(new URLRequest('NEW URL here"));
    Thank you for any help!

    I know I took it out because it didn't work. I had something like this:
    var soundLoaderContext:SoundLoaderContext = new SoundLoaderContext();
    soundLoaderContext.checkPolicyFile = true;
    var music:Sound = new Sound(new URLRequest("URL #1 (from my server)"));
    var sc:SoundChannel;//sound channel
    var isPlaying:Boolean = false;//checks f music is playing or not
    var pausePoint:Number = 0.00;//this variable is for the pause function
    music.addEventListener(Event.ID3, id3Handler);
    stop_btn.addEventListener(MouseEvent.CLICK, stopMusic);//stop function call
    function stopMusic(e:Event):void//stop function
         if(sc != null)//if music is playing
              sc.stop();//stops the music from playing
              isPlaying = false;//sets it to false(off)
              playPause_mc.gotoAndStop(1);//modifies graphic item on stage
         pausePoint = 0.00;//resets pause value
    play_btn.addEventListener(MouseEvent.CLICK, playMusic);//pause / play function call
    function playMusic(e:Event):void//pause / play function
         if (isPlaying) {// if it is playing
              pausePoint = sc.position;pausePoint get curreny value (position of song)
              sc.stop();//stops the music from playing
              isPlaying = false;//sets it to false(off)
              playPause_mc.gotoAndStop(1);//modifies graphic item on stage
         } else if (!isPlaying){// if it is not playing
              sc = music.play(pausePoint);//starts the music from the pausePoint value.
              isPlaying = true;//sets it to true(on)
              playPause_mc.gotoAndStop(2);//modifies graphic item on stage
    music2_btn.addEventListener(MouseEvent.CLICK, music2);//function call (if music is clicked)
    function music2(e:Event):void{//this function stops current playing music and resets graphics, assigns a new URL and starts playing it.
         if(isPlaying || pausePoint != 0)
              sc.stop();
              playPause_mc.gotoAndStop(1);
         music = new Sound(new URLRequest("URL #2 (from my server)"));
         music.addEventListener(Event.ID3, id3Handler);
         sc = music.play();
         isPlaying = true;
         playPause_mc.gotoAndStop(2);
    music1_btn.addEventListener(MouseEvent.CLICK, music1);
    function music1(e:Event):void{//this function stops current playing music and resets graphics, assigns a new URL and starts playing it. just like above only a different song.
         if(isPlaying || pausePoint != 0)
              sc.stop();
              playPause_mc.gotoAndStop(1);
         music = new Sound(new URLRequest("URL #1 (from my server)"));
         music.addEventListener(Event.ID3, id3Handler);
         sc = music.play();
         isPlaying = true;
         playPause_mc.gotoAndStop(2);
    function id3Handler(evt:Event):void {
          var id3:ID3Info = evt.target.id3;
          trace(id3.artist + ' - ' + id3.songName);
          name_txt = id3.songName;
          album_txt = id3.album;
          artist_txt = id3.artist;
    This is mostly just taking the exact code from the website I mentioned earlier.
    When I run this it outputs the trace command 1 time and nothing more. Only the trace(trace(id3.artist + ' - ' + id3.songName);) gets triggered once.
    No errors. No warning. Not working.
    Thank you for helping me!

  • How do I make bootable USB mp3 player/flash disk?

    hi
    i have a big problem. less than a month ago i have backed up my computer using the latest version of Norton ghost v10.0. i then burned the data on to a DVD and i kept it safe. today i encountered a problem i could not cess the internet on my laptop, nor uninstall/install a program, nor get access to help and support. therefore i got the backup DVD inserted it into the DVD drive i opened Norton ghost clicked recovery and then clicked recover my computer. i told it where to look for the backup and then started restore but i then ran into an error message which says the below:
    cannot complete the restore of recovery point d:\Toshiba ghost image001.v2i
    -Error EC8F178F: Cannot complete the restore of recovery point: D:\Toshiba ghost image001.v2i.
    --Error EC8F03F1: Cannot open recovery point 'D:\Toshiba ghost image001.v2i'.
    ---Error EBAB03E9: Internal Application Error: Memory Access Violation c0000005: Application tried to read memory at 034bac3c.
    i have another way of restoring the data this is by making a mp3 player or flash disk boot the computer but on the flash disk there will be the operating system. is there any way to make the flash disk bootable.
    i would like to know this because if it boots up from the flash disk or mp3 i can then delete the contents on the HDD and restore the data.
    and also when trying to restore it says a file or program is using the file its trying to restore.
    can somebody help,
    regards

    Hello Samee
    The best way to boot the unit in DOS mode is to use external floppy drive. This drive is not expensive and if your data are so important you can invest a few euros to buy it. Using start disk you will be able to boot into DOS mode and do what you want to do.
    I also recommend you to contact Norton and see if they have some simply solution how to install created image.
    With mp3 player you will not be able to boot up.

  • 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 can I NOT let collision happen in Flash CS4(AS3)?

    I have been playing with collisions for quite a while, but cannot seem to get it just the way i want it to be.
    I made a new rectangle into a Movie Clip, with an instance name : "block_mc"
    I made a sphere into a Movie Clip, with an instance name : "ball_mc"
    I made the sphere(ball_mc) movable with the arrow keys.(see post:http://forums.adobe.com/thread/491457?tstart=0 )
    Now I wanted to try and make the sphere(ball_mc) stop moving so it wont hit the rectangle(block_mc), so that the rectangle(block_mc) would act like a solid object.
    Meaning the sphere(ball_mc) would not be able to touch the rectangle(block_mc). It would act like a wall.
    Now my problem is I don't know if there is a way of not letting objects collide?
    I tried the ".hitTestObject()" but that did not work for me.
    ~ Thanks for Help and Advice~

    I apologize, for this confusing long question, I simply ment to ask:
    Is there a way Flash CS4(AS3.0) will not let Objects on stage collide?
    ~Thank you for any Tips, Advice and Help~

  • (Help) Using Input text in Flash CS4 AS3

    I am trying to take a user's input (His Name) and then greet the user on the next frame using the name he previously entered. I googled for 2days and was unable to find a way to do this on flash CS4 AS3, i guess because im very new to flash (only 2-3weeks )
    Any help would be greatly appreciated, and i am sorry if this was already answered in the forums.
    thanks for reading.

    If your interested... here's some general "rules of the road" that are basically courtesies...
    Don't post the same question in different forums (crossposting).  Folks that help don't like that because they can waste their time providing the same response someone else already offered elsewhere, or their helpful info gets no attention because the OP (original poster) got wrapped up in the discussion elsewhere and never went back to the other forums.  I saw one time where the OP suffered from doing this... the first person to respond in one forum said what they wanted couldn't be done, while my response in another forum showed them how to do it... but they accepted that it couldn't be done and never returned.
    Don't post in someone else's posting unless the exact same situation applies to you and it is a current posting.  It is a bit rude to step into someone else's posting just to get attention, which some people do... some with totally unrelated problems.  Or if your problem is even slightly different, it can end up confusing matters for all involved... trying to juggle helping two people where different solutions are needed.
    If you get one problem resolved and have another you want help with that does not involve the first, start a new posting.  People search these forums so it helps to have topics match the postings, which will not apply if mutliple topics get resolved under one title.  I recently saw one person tell someone to start a new posting even though they were following up to clarify something of the solution they received... that's wrong and is more likely someone with a case of points greed... as useless as points are, it happens.

  • Need help in screen capturing for flash CS4 AS3

    Hi, i need help!!!!!!!!!!!!!!!!!!!!!! URGENT!
    I am currently doing Augmented Reality.
    I got my marker to detect my model but my problem now is how to screen capture the content that is in swf.
    (As in capture the dae model shown in the comp not from webcam.)
    & also i just want to capture the swf window not the whole desktop.
    I read online, they say its impossible?
    Or is it possible to call screen capture function in javascript to flash CS4? (LIke external data)
    (Moreover, does anyone know how to detect multiple dae models with different markers?)
    Anyone can help??? Thanks in adv!!

    My current program (Flash CS4, AS3) only can capture what the webcam sees.
    How do i change it to screen capture (something like print screen) with my .DAE models?
    In the case, when i click on the capture button, it print screen.
    Here's part of the code that capture what the webcam sees.
    private function captureImage(e:MouseEvent):void
       bmd.draw(stage);
       bmp = new Bitmap(bmd);
       bmp.x = 140;
       bmp.y = 40;
       addChild(bmp);
       capture.visible = false;
       saveButton.visible = true;
       discardButton.visible = true;
    Really really need help! URGENT!
    Thanks!

  • 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.
    Randy

    The 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.

  • How to make like Spry Products demo using Flash CS4 / xml?

    hello there!
    i wonder is it possible to make something similar to Spry Products Demo using Flash CS4 for front end and xml for back end data. take a look at this draft image. If it can be done, can someone guide me please. I am super new to AS2/3 - Please. Thanks for your help.

    hello there!
    i wonder is it possible to make something similar to Spry Products Demo using Flash CS4 for front end and xml for back end data. take a look at this draft image. If it can be done, can someone guide me please. I am super new to AS2/3 - Please. Thanks for your help.

  • Embedding an mp3 player in flash site

    Hi
    i am trying to figure out how to embed an mp3 player in my flash site. do anyone know of any good tutorials. I have no really actionscript skills.
    thanks
    Will

    Thanks Ned!!!
    Ok, I'm going to look into the Actionscript 2 music player options out there.
    One question, incase I have a hard time finding what I need, would it be too difficult to have a text box open a new window, and in that window, have all the HTML music player?  I found this site and I'd be OK with something like this:
    http://digitalmedia.oreilly.com/2005/02/23/mp3_embed.html
    My only criteria would be to not have a download file link and that it would stream. Just curious if this would be an option since I've had such terrible luck trying to figure this whole music thing out.
    Thanks again, Ned!!!

  • Momentary pause in Sound when using Flash Player AND Flash CS4

    Hello,
    When ever I play something in Adobe Flash Player (a flash movie, for example) and there is an absence of sound, the flash player will momentarily pause (for about 1 second) RIGHT BEFORE an incoming sound is made.
    Imagine in the movie someone swings a hammer towards a plank. The animation will pause RIGHT BEFORE the hammer makes an impact and thus creates the hitting sound. The sound and animation will time up correctly, but there is that brief pause before, as if the internet browser, or flash player, or my sound card has to 'load' something before executing the sound.
    I tried experimenting with my sound output via the bottom-right hand control properties on the desktop, and when I choose "Digital Output Device (SPDIF)" and disable my "SigmaTel High Definition Audio CODEC," there is absolutely NO sound at all, yet there is also NO lag prior to where a sound would play in the movie. This leads me to believe it may be a problem with my sound card.
    As I said before, if the Flash player is playing a continuous sound, a background song, for instance, there is no momentary pause when the introduction of new sounds happens.
    I've tried uninstalling and reinstalling the player - no luck. Obviously i'm currently running the player at the newest version.
    OS: Windows Vista Home Basic
    RAM: 2G
    Processor: Genuine Intel CPU 1.6 GHz
    Sound: SigmaTel High Definition
    Browser: FireFox

    I have the same problem as you. I created a thread with the same subject, if you want to watch it for answers too, here's the URL: http://forums.adobe.com/thread/484626

  • Output 0# instead of just # in Flash CS4 AS3

    Hi,
    I was wondering if there is any way to get an number output always in a two digit number, for example time:
    What my code does right now:
    0:1
    0:2
    0:3
    0:4
    0:8
    0:9
    0:10
    0:11
    What I want my code to do:
    0:01
    0:02
    0:03
    0:04
    0:08
    0:09
    0:10
    0:11
    Thank you for any help and tips!

    First you have to determine if the number is less than 10, and if so, add a zero before it when you cast it as a String.
    Take this number for example:
    var myNumber:Number = 5;
    First, you need to determine if the number is below 10
    if (myNumber < 10)
    And if so, you will have to cast your number from a number to a String with a zero in front.
    var myString:String = "0" + String(myNumber);
    I did this just last week to make an MP3 Player.
    Here are two functions I used to convert the number (in this case, the milliseconds being played) into a time format:
    function showTime(e:Number):String
        //e is in milliseconds
        var time:int = Math.round(e/1000); // time is now in seconds
        var hours:int = Math.floor(time/3600);
        var minutes:int = Math.floor((time - (hours * 3600))/60);
        var seconds:int = Math.floor(time - (hours*3600) - (minutes*60));
        var hoursText:String = convertToString(hours); // function - see below
        var minutesText:String = convertToString(minutes);
        var secondsText:String = convertToString(seconds);
        var showTime:String;
        if (hoursText == "00")
            showTime = minutesText + ":" + secondsText;
        else
            showTime = hoursText + ":" + minutesText + ":" + secondsText;
        return showTime;
        }showTime
    function convertToString(e:int):String
        var returnString:String;
        if (e == 0)
            returnString = "00";
        else if (e < 10)
            returnString = "0" + String(e);
        else
            returnString = String(e);
        return returnString;
    }//convertToString

  • Make an object vanish in Flash CS4 (AS3.0)

    I have a question on how i can remove an object when two objects hit.
    I have two objects on the stage overlapping.
    object #1 = character_mc
    object #2 = vanish_mc
    I want to make it so that the object #2 (vanish_mc) will vanish once i run it.
    I have this code:
    this.addEventListener(Event.ENTER_FRAME, vanish);
    function vanish(event:Event):void{
         if(character_mc.hitTestObject(vanish_mc)){
              // here the code to remove vanish_mc from the stage
    ~ Thank you for help and advice ~

    you can always use:
    vanish_mc.parent.removeChild(vanish_mc);
    to remove vanish_mc from the display list.
    but, you'll need to stop all streams in vanish_mc, if there are any.  and, if you're not going to use vanish_mc anymore, you should ready it for gc.

  • How can I make a 3D cube using only Flash CS4?

    Looking for a tutorial on how to make a 3d cube. The best one I found was how to make a book, which is three sides short of a cube. If worse comes to worse I think there's a way to take two identical movie clips with three sides each and pivot them around the same point to form a cube. But if there's some solid instruction anyone could provide or a link, it would save me countless hours of guessing testing and revising.
    Thanks!

    Hi,
    Wire in '448' to the 'New Permissions' of the Access Rights VI. This will set the file as readable, writable and executable. I just tried this (on WinNT, though).
    The 'permissions' parameter is a 16-bit integer where the least 9 bits are used. Of these, for Windows, bits 8, 9, and 10 (0-indexed) are important (i.e. if these are set = integer 448). See online Help for full details.
    Hope this helps,
    Khalid

  • SWF management - Adobe Flash CS4 AS3

    I want to design my own website in flash. But I have a couple of questions about swf management.
    I have a frame which has buttons -it will be my main page- each button will call a swf file as
    submenu.
    For example I have the "about us" button. On click a swf -about us- submenu will appear.
    1. When I call -on the click of a button- a swf file I want that file to have no background, cause I
    want as background my current frame. -generally I want each swf file that i call to have no
    background. How can I do that?
    2. I want to call an intro animation. Its a swf file -short presentation of my copmany it lasts 10
    sec- I want that animation to play before my menu appears. how can I do that? Is it good Idea to
    call that intro as an external swf file or should I make it in my current project -my main page-
    3. (its similar to 2) Lets say that I have 2 layers. In my first layer and frame(1) I will place the
    movieclip1. In my second layer and frame(2) I will place movieclip2. Each movie clip lasts 10
    seconds. When I test my project I want to my first movieclip to be played (10 seconds) and then my
    second clip (another 10 seconds). What  should my actionsript be? One way that I figured out its
    that in order for my first clip to be played for ten seconds I have to place it on
    24fps*10seconds=240frames -the first frame will be the keyframe.
    thank you all in advance

    One last thing. I want now to combine importing code with your code.
    With the following code I am loading intro.swf from file "clips" into my project - first frame (1) - in a current position (x,y). It is supposed (for the imported swf) to start when I test the movie (project) and to go to the next frame when the intro clip (the same imported swf) is done.
    var Xpos:Number=110;
    var Ypos:Number=180;
    var swf:MovieClip=new Loader();
    var defaultSWF:URLRequest=new URLRequest("clips/intro.swf");
    stop();
    loader.load(defaultSWF);
    loader.x=Xpos;
    loader.y=Ypos;
    addChild(loader);
    myclip1.addEventListener(Event.ENTER_FRAME,checkF);
    function checkF(e:Event):void{
         if(e.target.currentFrame==e.target.totalFrames){
         myclip1.removeEventListener(Event.ENTER_FRAME,checkF);
         removeChild(loader);
         nextFrame();
    my questions for the code are:
    1. should be there a stop(); before the loader? (in the upbove code there is)
    2.Is the removeChild(loader) placed in the right line?
    3.Any corrections?

Maybe you are looking for