[AS3] Music Player - Progress Bar

I have created a topic on help with a play/pause button that was solved and now I moved onto the progress bar.
Now I need more help because I seem to be getting some errors.
I will post only the progress bar coding.
var dragSpace:Rectangle;
var percent:Number;
var seeking:Boolean;
class SeekControl extends MovieClip {
    function seekControl() {
        dragSpace = new Rectangle(0, 3, 167, 0);
        seeking = false;
        percent = 0;
        seekHit.addEventListener(MouseEvent.MOUSE_DOWN, dragHandle);
        seekHandle.addEventListener(MouseEvent.MOUSE_DOWN, dragHandle);
        seekHandle.addEventListener(MouseEvent.MOUSE_UP, endDrag);
    function dragHandle(event:MouseEvent):void {
        seeking = true;
        seekHandle.startDrag(true, bounds);
    function endDrag(event:MouseEvent):void {
        seeking = false;
        seekHandle.stopDrag();
        fillBar.x = seekHandlc.x – fillBar.width;
        percent = seekHandle.x/100;
        dispatchEvent(new Event("seekChange"));
    function moveSeekPos(perc:Number):void {
        fillBar.x = (fillBar.width * perc) – fillBar.width;
        if(!seeking)
            seekHandle.x = 100 * perc;
changeSeek.addEventListener("seek_change", changeSeekBar);
function changeSeekBar(event:Event):void {
    position = song.length * changeSeek.percent;
    if (soundCheck = true) {
        channel.stop();
        channel = song.play(position);
function updateSeek(event:Event):void {
    if (soundCheck = true) {
        var perc:Number = channel.position / song.length;
        changeSeek.moveSeekPos(perc);
Scene 1, Layer 'Actions', Frame 1, Line 53    1093: Syntax error.
Scene 1, Layer 'Actions', Frame 1, Line 53    1084: Syntax error: expecting rightbrace before fillBar.
Scene 1, Layer 'Actions', Frame 1, Line 59    1093: Syntax error.
Scene 1, Layer 'Actions', Frame 1, Line 59    1084: Syntax error: expecting rightbrace before fillBar.
LINE 53
        fillBar.x = seekHandlc.x – fillBar.width;
LINE 59
        fillBar.x = (fillBar.width * perc) – fillBar.width;

If I copy your code into a text editor (Textpad, not Notepad), the minus signs in those equations appear to be something other than ascii-text.  I get the small dark vertical rectangles in their place.  So that is probably the issue.
I f I use Notepad they appear normally though.  And I don't see anything wrong with the code syntax per the intent.

Similar Messages

  • Help With Zen Vision:M 30G, lost alot of music, "rebuilding" progress bar doesnt fin

    I purchased my Zen Vision:M 30GB player about 5 months ago and its been great untill today I turned it on and it froze, so i hit the reset button.
    Heres the thingI reset it and that "Rebuilding" progress bar poped up like it has in the past when i hit reset?But this time the progress bar only got about? /6th of the way full, before the unit returned to its normal menu, and i went to look at my music and about 90% of it is gone! Ive done a restart in the past and the rebuilding progress bar would have to fill up all the way before it would go to the normal menu and i had no problems with it then, just today it started doing the thing where it would only go /6th the way. Heres the weird stuff,I went to look at the system information to look how much memory was left and based on the numbers, my 90% of missing music should still be on there somewhere. I tried connecting it to my computer and all the sudden now my computer decides to recognize it but The Creative Media Explorer will say its not connected, that is a first for me too?I tried doing that system recovery thing, where i did the scan disk but that did not help at all. Everytime i try to re-boot or re-start it does that thing where the "Rebuilding" progress bar only goes /6th of the way before it goes back to the normal menu, i think that has somthing to do with it. Any help would be GREATLY appreciated?Message Edited by Lowalkoroc on 03-7-20070:20 PM
    Message Edited by Lowalkoroc on 03-7-20070:20 PM

    I was just about to post a topic about this. I had the same problem and after numerous efforts I decided to follow the "Format (All)" instructions [url="http://forums.creative.com/creativelabs/board/message?board.id=dap&message.id=5530#M5530">here[/url]. After a reformat, a reboot, and a reload of all my songs everything is working again. Thank the Lord and the Creative forums.

  • How to customize video player progress bar?

    I want a video progress bar (maybe it is a slider ), which
    can be used to show the buffer progress of video, the standard
    slider control in Flex has not this function.
    How can I customize the silder control?

    this is a very basic video player. what we've done here is A
    LOT of binding i.e. vp.playheadTime=(vp.totalTime/(100/ctr.value))
    after you've figured out what the right math is..which is
    already done here, you can just skin it and it'll work fine. i
    haven't had the time to update this for a while but there is
    definitely room for improvement. hope this helps.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:VBox xmlns:mx="
    http://www.adobe.com/2006/mxml"
    horizontalAlign="center" verticalAlign="middle"
    horizontalScrollPolicy="off" verticalScrollPolicy="off"
    width="100%" height="100%">
    <mx:Script>
    <![CDATA[
    public function init(path:String):void
    vp.source = path;
    vp.play();
    public function fixIt(what:Number):Number
    what.toFixed(2);
    return Number(what);
    ]]>
    </mx:Script>
    <mx:VideoDisplay autoPlay="false" id="vp"/>
    <mx:HSlider minimum="0" maximum="100" width="{vp.width}"
    height="29" id="ctr"
    value="{fixIt(vp.playheadTime/(vp.totalTime/100))}"
    change="vp.playheadTime=(vp.totalTime/(100/ctr.value))"
    liveDragging="true"/>
    <mx:Label id="duration"
    text="{int(vp.playheadTime)}"/>
    <mx:HBox>
    <mx:Button id="pp" label="Play/Pause"
    click="if(!vp.playing){vp.play()}else{vp.pause()}"/>
    <mx:Button id="st" label="Stop" click="vp.stop()" />
    <mx:Button id="rw" label="Rewind"
    click="vp.playheadTime=0" />
    </mx:HBox>
    </mx:VBox>

  • Trying to add audio player progress bar

    Hi
    I'd like to add a progress bar to my flash audio player.
    Right now you press a button, a certain sound loads and then plays.
    Here's part of the code:
    function playSong(e:Event):void{
        if (my_channel) {
            my_channel.stop();
        var myURL = ("mysong.mp3");
        my_sound = new Sound();
        my_sound.load(new URLRequest(myURL));
        my_channel = my_sound.play();
    In order to build a progress bar I wanted to find out the length or duration of the sound but I keep getting error messages or 0s in return
    trace (my_sound.duration);  
    tells me that duration is an undefined property
    trace (my_sound.length);
    trace (my_sound.position);
    trace (my_sound.bytesTotal);
    trace (my_sound.bytesLoaded);
    all give me a 0 in return
    Any idea why? Why can't I access the properties of my Sound?
    I'd also be very thankful for any other suggestions on how to add a progress bar. I searched a number of websites, but most samples are AS2 code...
    Thanks
    Julie

    Duh! Once again I thought my comuter is faster than it actually is ;-)
    Thanks :-)

  • Please Advice AS3 Music Player

    Please advice. I am planning to write a program to a music
    player in AS3. The final player have to option like browse the
    computer and select the music files and play. similarly like
    realplayer/winamp. Is there any way to browse files from system
    using fla/swf file. If it is please advice.

    you can do that in action script
    create a button and name it browseBtn. and in actions layer
    put this code
    browseBtn.addEventListener(MouseEvent.CLICK, browseListener);
    function browseListener(evt:MouseEvent):void {
    file.browse();
    in this way you can browse the files on ur system
    browse method also accept filefilter parameter that is null
    bydefault so you can also put a file type filter like mp3, avi, gsm
    sound types etc
    if u feel any problem then i am here to guide you.
    Regards
    maani janjua

  • [AS3] Music Player - Play/Pause

    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(); musicPlay.addEventListener(MouseEvent.CLICK, playSong);
    function playSong(evt:MouseEvent):void
        if (!soundCheck)
            channel = song.play();
        soundCheck = soundCheck;
    } musicPause.addEventListener(MouseEvent.CLICK, pauseSong);
    function pauseSong(evt:MouseEvent):void
        if (soundCheck)
            channel.stop();
        soundCheck = !soundCheck;

    Since there is no explicit pause method - when you pause store the position property of the channel object - and then when you play, use the position to play from.
    var pos:Number = 0;
    play Btn:
    channel = song.play(pos);
    pause Btn:
    pos = channel.position;
    channel.stop();

  • Any alternative to Flash progress bar?

    I was wondering if anyone knows of an alternative to the
    Flash Player progress bar (javascript would be acceptable)? Or
    would I have to import a project into Flash to have this feature.
    What I envision would be text to the effect of "slide x of
    xx" or something like that. A method of telling the student that
    they are a specific number of slides into a lesson that has a total
    number of slides in the lesson.
    I seem to remember that quiz slides have something like this.
    This is probably something for my wish list.
    TPK

    Go to:
    http://www.raisingaimee.co.uk/
    Fellow
    AdobeCommunityExpert (isn't that stupid looking as a single
    camel-backed word?) Paul Dewhurst owns "Raising Aimee" and has a
    variety of neat tools and toys available to help us out.
    Use the link to find Captivate topics on the site, and be
    patient because some idiot hacked Paul's site recently and he is
    still rebuilding.
    Paul has some SWFs available that will do what you are
    suggesting - listing the current slide number as you progress
    through the movie. Paul is constantly helping out, so if you'd like
    to help him, look for a link to PayPal and drop a few bucks in the
    "keep us going" pot - not mandatory but it's there and Paul
    constantly offers free stuff that saves the rest of us time.
    Have a nice day!

  • Nokia C3-01 no Volume Progress bar in Music player...

    Nokia c3 -01 music player has no volume progress bar when we play videos.....

    if you tap screen when video is playing does nothing pop up?
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

  • Progress bar for player?

    Hi All,
    I am developing a player,
    I not able to get how to create a progress bar  which shows download data and the player
    Like YouTube which show the download as well as the player head.
    Thanks in advance.

    if the video is a live stream, it's impossible to do it.
    You can't work out your player position or amount downloaded because the end position and total file size are unknown.
    I'm guessing you may actually mean you want the progress bars to be live and not manually controlled, in which case you could use a timer
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" verticalAlign="top"
        horizontalAlign="center" paddingTop="0" applicationComplete="init()">
        <mx:Script>
            <![CDATA[
              private var j:uint=1;
              private var m:uint=1;
              import flash.utils.Timer;
              import flash.events.TimerEvent;
                private const MS_MASK:String = "000";
                private const TIMER_INTERVAL:int = 1;
                private var baseTimer:int;
                private var t:Timer;
                private function init():void
                    t = new Timer(TIMER_INTERVAL);
                    t.addEventListener(TimerEvent.TIMER, updateTimer);
                    startTimer();
                private function updateTimer(evt:TimerEvent):void {
                    var d:Date = new Date(getTimer() - baseTimer);
                    var ms:String = (MS_MASK + d.milliseconds).substr(-MS_MASK.length);
                    if (int(ms) > 100)
                        //Update & Calculation functions go here//
                        runit2();
                        runit();
                        stopTimer();
                private function startTimer():void {
                    baseTimer = getTimer();
                    t.start();
                private function stopTimer():void {
                    t.stop();
                    startTimer();
              private function runit2():void
                  if(j<=100)
                     bar2.setProgress(j,100);
                     j+=2;
                  if(j>100)
                     j=0;
              private function runit():void
                  if(m<=100)
                     bar.setProgress(m,100);
                     m+=1;
                  if(m>100)
                     m=0;
            ]]>   
        </mx:Script>
        <mx:Panel title="ProgressBar Control" layout="absolute" color="0xffffff" borderAlpha="0.15"
             paddingTop="10" paddingRight="10" paddingBottom="10" paddingLeft="10" horizontalAlign="center" x="307" y="297" height="152" width="409">
            <mx:ProgressBar id="bar" labelPlacement="bottom" themeColor="#EE1122" minimum="0" visible="true" maximum="100"
                 color="0x323232" direction="right" mode="manual" width="100%" x="10" y="74"/>
             <mx:ProgressBar id="bar2" labelPlacement="bottom" themeColor="#0088FF" minimum="0" visible="true" maximum="100"
                 color="0x323232" direction="right" label="" mode="manual" width="100%" x="10" y="74" alpha="0.1"/>  
        </mx:Panel>
    </mx:Application>
    a function you might find useful in doing this would be the PHP filesize function
    http://php.net/manual/en/function.filesize.php
    you could send off a script at the begging on the stream calculating the total filesize, and then compare that against amount downloaded in you AS3, what would be download progress sorted.

  • Iphone music: progress bar, shuffle options GONE

    After the latest update, when I am playing "music" (previously known as the "iPod" function of the iPhone), there are no longer the progress bar of the actual title and the shuffle options available! When I tap on the actual song ("now playing"), it shows only the cover and the volume bar below, but not the progress bar above the cover! And the worst: It is stuck on "shuffle" - I can't hear my music and albums in order, because everything automaically shuffles.
    I tried already a restart and a reset of the iPhone ... no result.
    ok - found the solution:
    DaVBMan
    Re: iPod on iPhone Shuffling My Music When I Don't Want it Shuffled     19.09.2008 05:42    (in response to BrentNHunter) 
    It isn't a bug, but rather not clear usability. If you ever click the "word" Shuffle when looknig at a list, that isn't really the place to set shuffle, but rather a shortcut. What it does is turn Shuffle on (setting) then start playing.
    Go play any song.
    Tap middle of screen.
    Another progress menu will appear near top.
    In that menu it has Shuffle, Repeat and Progress options.
    There if Shuffle is Blue (on) tap it to turn it White (off).
    And remember, if you ever click the word Shuffle in a list again, it turns that setting on as it is a global setting to the iPod player.

    Thanks a lot dude......work'd for me..

  • How can I play a movie in iTunes mini player?  (Progress bar button broken?)

    It took forever to figure out how to get iTunes to even OPEN a new window for movie playback, but once I finally found instructions (click the button with movie art to the left of the progress bar to open in new window) they only partially worked.  A new window opens, but movie playback continues in the main window.  The new window shows a freeze frame of the scene displayed at the moment I clicked the progress bar button.  The new window looks just like the mini player, and its control buttons work, but they effect the main window's movie playback not the new window/mini player where I want to watch the movie.
    Is it my progress bar that's broken?  I'm all updated with iTunes version 11.1.5.  Does this version not play well with my OS X 10.6.8?
    Ultimately I just want to be able to play a movie in the mini player while using other applications; surely that's possible.
    [Also, on the "Operating System" dropdown menu below, I just selected OS X 10.6.8 and then the dropdown showed "No operating system selected" and the selection arrows no longer work.  Any ideas what happened?  My MacBook Old feels so janky right now.]

    You need to convert the AVI file to MP4.  Here is just one of the many converters available (via Google) http://www.divx.com/en/software/divx-plus/oca/mp4-converter?gclid=CJnqnpaF37gCFc fJtAod8RUAeg

  • Music sound gets low while earphones are plugged in.  To fix it I have to slide the music progress bar.

    When listening to music with any pair of headphones or earphones plugged in, all of a sudden the volume will get really low for no reason.  Example: say the volume is at 15.  All of a sudden the volume will drop to like a 4, but the volume slider is still positioned at 15.  To fix it, I have to open the music app or control panel, and slide the song progress bar around and then the volume returns to normal.
    This is not an issue with the headphones.  I tried twisting and jiggling the jack and there were no changes.  Not even static.  The issue happens with the aux cable in my car as well.  It's also not an issue with the songs.  These are the same songs I was playing yesterday and they are all perfectly fine.
    Right now this is happening on my iPhone 5s with the most recent iOS8 update.  I've also had the update for awhile and this has only started less than a day ago.

    It sounds like dirt in the headphone jack. I would use a vacuum cleaner to "suck" out any dirt that might be in there. You might also want to look carefully and see if anything in lodged in there.

  • How can I get rid of the playlist bar in the music player?

    Hello everyone! I want to know if I can get rid of the transparent playlist bar which shows over the cover artwork in the music player (ios 6) or Lagu. When I play one song alone, the artwork shows fully and that's how I would like it to be when playing playlists. Is there a way? In the ios 7 the artwork this does not happen, but the artwork is smaller and on a white background, which I don't like either. Thank you.

    Sounds like you installed a Yahoo optimized version of Firefox.
    You can download the official version of Firefox from here. <br />
    http://www.mozilla.com/en-US/firefox/all.html

  • Is it possible to resume play from any point on the progress bar in FLV player

    Is there a way to allow a user to move playhead to any point on the progress bar (including much ahead of the loaded portion of the movie) and resume play from there?
    Presently a user can skip ahead only as far as the download happened.
    Just in case there is no conflict with my set up, here is the code I have:
    import fl.video.VideoProgressEvent;
    stop();
    close_btn.addEventListener(MouseEvent.CLICK, onClick_GoBackToHowTo2);
    function onClick_GoBackToHowTo2(event:MouseEvent) :void {
              gotoAndPlay("howto");
    SWF_flv2.addEventListener(Event.REMOVED_FROM_STAGE,stopF2);
    function stopF2(e:Event):void{
    SWF_flv2.stop();
    SWF_flv2.closeVideoPlayer(1);  // actually, you can execute this after the stream completes, too so there's no need to check.
              play_btn.addEventListener(MouseEvent.CLICK, onClick_Play);
              function onClick_Play(event:MouseEvent) :void {
                        SWF_flv2.play();
    SWF_flv2.addEventListener(VideoProgressEvent.PROGRESS,progressF);
    function progressF(e:VideoProgressEvent):void{
    if(e.bytesLoaded == e.bytesTotal){
    trace(e.bytesLoaded,e.bytesTotal);
    SWF_flv2.play();
    SWF_flv2.activeVideoPlayerIndex=1;  //this assigns the player index
    SWF_flv2.visibleVideoPlayerIndex=1; //this assigns the player index
    SWF_flv2.source = sourceVar;  //source must come after assigning the index/s
    SWF_flv2.play(); //starts buffering the sourceVar
    SWF_flv2.stop(); //starts buffering the sourceVar

    Besides kglad's excellant response, there is also the option to use "http pseudostreaming".
    This will also give you the ability to "seek" to sections of a video file which are not yet downloaded. It is typically cheaper than using FMS or RED5, but still may require that you have a dedicated server account (which is much more expensive than a shared server account). But check with your Web host, some offer pretty good options for enabling http pseudostreaming:
    http://flowplayer.org/plugins/streaming/pseudostreaming.html
    Best wishes,
    Adninjastrator

  • No progress bar while music is playing?

    since i've upgraded my 3g to 2.2, i've noticed that while music is playing, there is no progress bar @ the top(like the volume bar @ the bottom).
    my g/f also has her iphone 3g running 2.2, but her progress bar is still there, along with the little genius logo, which i also no longer have...
    is this a setting issue, or a firmware problem?
    as a DJ, its helpful to have the progress bar so that i can skip thru a song
    thanks for any help

    Tap the artwork while the song is playing to display the additional controls.
    See http://manuals.info.apple.com/enUS/iPhone_UserGuide.pdf, page 63.

Maybe you are looking for

  • Migration of Web Analysis Report thru LCM (from QA to Prod )

    Hi All, When we tried to migrate Web Analyasis Report from QA to Prod using LCM, Security is wiping out in Prod after migration of that WA Report. Can anyone suggest how to retain the security of report after migration in Prod environment. thanks in

  • Safari won't open from new hard drive

    i installed a new ssd drive and loaded the backup of my old drive from time machine onto it.  everything seemed okay until i tried to open safari and nothing happens!  anyone have any idea why this would happen before i try starting over?  do you thi

  • Could not cast to second level extensions in schema in BPEL

    Hi, I use jdeveloper 11g, for calling an external Web service from BPEL process. The schema given has multiple extensions defined for its elements. For instance, Customer class is extension to FCO, which in turn is extension to ExtensibleObject class

  • Replaced my files and have to re-link all files

    being new to iTunes I replaced all my mp3s to 1 locatioan AFTER I installed iTunes (and made my library). Now I have to re-link all files to the list in my library. Can I re-run the making of my library (search my computer for all mp3 files), so I do

  • How to set my computer settings to download excel and acrobat files from website

    How do I adjust settings to download acrobat and excel files from website.  I've already run a diagnostic on my security program and it is not a security issue.