Get a custom player to work on Audio Player

I'm trying to get this player to work on the head of my audio player. I get it to drag, but when I let go it jumps at the place it was before. Not sure if I'm over my head here, but any help would be great.

You may need to change the audio file to make it work, but I join all other files needed to make it work.

var XMLLoaded:XML = new XML();
XMLLoaded.ignoreWhite = true;
var timesLoaded:Number = 0;
this.createEmptyMovieClip("sound_mc", this.getNextHighestDepth);
var sound_mc:Sound = new Sound();
var finished:Boolean = false;
var XMLSnippits:XML = new XML();
var sStart:Array = new Array;
var sText:Array = new Array;

       
XMLLoaded.onLoad = function(bSuccess:Boolean):Void {
    var timerStarted:String = "no";
    if (bSuccess){
        if(XMLLoaded.firstChild.childNodes[0].childNodes[0].nodeValue == "yes"){
            trace(timerStarted + " timer status");
            clearInterval(XMLTimer);
            fileAdded();
        }else{
            if(timesLoaded == 10){
                trace("There has been an Error Loading this file");
                clearInterval(XMLTimer);
            }else{
               
            }
        }
    }
}

function loadXML():Void {

    XMLLoaded.load("call-process-yes.xml");
    timesLoaded += 1
    trace("XML has been loaded " + timesLoaded);
}

var XMLTimer:Number = setInterval(loadXML, 3000)
loadXML();

function fileAdded():Void {


    trace(sStart);
    play_btn._visible = false;
    pause_btn._visible = true;
    words.html = true;
    sound_mc.loadSound("BigGreenTractor.mp3", false);
   
    XMLSnippits.ignoreWhite = true;

    XMLSnippits.onLoad = function(bSucess:Boolean):Void{
        if (bSucess){
            var snippitLength:Number =  XMLSnippits.firstChild.childNodes[3].childNodes.length;
            trace(snippitLength + " this is the length");
            for(var j:Number = 0; j < snippitLength; j++){
                sStart[j] = XMLSnippits.firstChild.childNodes[3].childNodes[j].childNodes[0].childNodes[0].nodeValue;
                sText[j] = XMLSnippits.firstChild.childNodes[3].childNodes[j].childNodes[4].childNodes[0].nodeValue;
            }
            //var sStart:Number = 53;
            //var sEnd:Number = 234;
            addMarkers();
            trace("Sucess");
            trace(sStart);
        }else{
            trace("Failed");
        }
    }

    XMLSnippits.load("call-meta-data.xml");

    function addMarkers():Void {
       
        var totalSecs:Number = sound_mc.duration /1000 ;
            var secLength:Number = timeline.loader._width / totalSecs
            for(var i:Number = 0; i < sStart.length; i++){
                timeline.attachMovie("marker", "marker" + i, i);
                timeline["marker" + i]._x = sStart[i] * secLength;
                timeline["marker" + i]._y = -5;
                trace(i);
                trace(totalSecs);
               
            }
       
           
            var sS = setInterval(soundStatus, 100);
    }


    function soundStatus(){
        var amountLoaded = sound_mc.getBytesLoaded() / sound_mc.getBytesTotal();
        var time = sound_mc.duration;
        var position = sound_mc.position;
        timeline.loader.loader._width = amountLoaded * 378;
        timeline.playHead._x = position / time * 378;
       
    }

    sound_mc.onLoad = function (bSucess:Boolean):Void{
        if (bSucess) {
            this.start();
        }
    }

    sound_mc.onSoundComplete = function():Void {
        finished = true;
        play_btn._visible = true;
        pause_btn._visible = false;
        words.htmlText = "Please choose a marker";
    }
   
    play_btn.onRelease = function():Void{
        if(finished){
            sound_mc.start();
            finished = false;
        }else{
            sound_mc.stop();
            sound_mc.start(sound_mc.position/1000);
        }
        pause_btn._visible = true;
        play_btn._visible = false;
    }   

    pause_btn.onRelease = function():Void{
   
        sound_mc.stop();
        pause_btn._visible = false;
        play_btn._visible = true;
        stopInterval();
    }
   

    timeline.playHead.onPress = function ():Void{
        startDragger();
        clearInterval(sS);
    }
   
    timeline.playHead.onRelease = function ():Void{
        stopDragger();
       
       
    }
   
    timeline.playHead.onReleaseOutside = function ():Void {
        stopDragger();
    }
   
    function startDragger():Void {
        var leftLimit = timeline.loader._x;
        var rightLimit = timeline.loader._width + timeline.loader._x;
        sound_mc.stop();
        play_btn._visible = false;
        pause_btn._visible = true;
        startDrag(timeline.playHead, false, leftLimit, timeline.loader._y, rightLimit, timeline.loader._y);
       
    }
   
    function stopDragger():Void {
        var soundLength = sound_mc.duration / 1000;
        stopDrag();
        sound_mc.stop();
        sound_mc.start(timeline.playHead._x / timeline._width * soundLength);
        trace(timeline.playHead._x / timeline._width * soundLength);
        var sStatus = setInterval(soundStatus,100);
    }
}

You can assign sS rather a function.  just do not local to that function.  That is to say, use:

var sS:Number;

to declare and sS, then when you want to assign use:

sS = setInterval (...,..);

Tags: Adobe Animate

Similar Questions

  • Impossible to get my custom image to work somehow

    OK, I read that to define a custom image for an air application file you must change the application xml file. I did that like so: -.

    <!-the icon, the system uses for the application. At least a resolution,

    Specify the path of a PNG file that is included in the AIR package. As an option. ->

    <!-< icon >

    < image16x16 > coolvicon.png < / image16x16 >

    < image32x32 > coolvicon.png < / image32x32 >

    < image48x48 > coolvicon.png < / image48x48 >

    < image128x128 > coolvicon.png < / image128x128 >

    < / icon >-->

    And when I do a bin of the app release is just the small air icon of the box cardboard instead my icon yet I put the coolvicon.png in the src folder. Y at - it another way to do this or I do something wrong?

    Hello
    You must declare/embed your image
    [Embed ("myicon.png")] [Bindable] public var myicon: Class;
    in the header to declare
    http://ns.Adobe.com/MXML/2009.
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx".
    titleIcon = "{myicon}" ><=== i="" think="" you="" have="" to="" bind="" it="" if="" it="" doesn't="" work="" remove="" the="" {}="">
    David.
  • Audio problem-get video Media Player but no video

    My Windows Media Player has stopped playing videos from last week. I always get the sound and everything works fine, but the video is just a black screen and I all updates to Media Player and Windows 7. How can I get the video back?

    I would uninstall and reinstall Windows Media Player.

    Uninstalling and reinstalling Windows Media Player:
    Step 1.
    Uninstalling Windows Media Player:
    1. go to start and in the search type "Turn Windows willing or not.
    2. click on "Turn Windows features on or off".
    3. search for multimedia and uncheck the brand in the face of Windows Media Player.
    4 restart the computer
     
    Step 2.
    Reinstall Windows Media Player:
    1. go to start and in the search type "Turn Windows willing or not.
    2. click on "Turn Windows features on or off".
    3. find the multimedia functions and place a check mark in front of the Windows Media Player.
    4 restart the computer.

    If you are having problems using Windows Media Play, try to use the Troubleshoot utility to see if this fixes

    the problem.

    Open the troubleshooting Windows Media Player settings Troubleshooter by clicking the Start button, then Control Panel. In the search box, type troubleshooting, and then click Troubleshooting. Click View all, and then click the Windows Media Player settings.

    I hope this helps.

    Marilyn

  • I can't get Adobe Flash Player to work on my PC. I feel I have tried everything. How to make this work?

    How can I get Adobe Flash player to work on my PC?

    First of all, try to enable Active Scripting in the areas of Sites Internet Options, security settings, trust.

    You should also add a corrupted on.

    Click Start, type: Internet Options

    Press enter

    Select the "Advanced" tab

    Under reset Internet Explorer settings, click "reset".

    This should restore the Internet Explorer default settings.

    Then reinstall Flash Player

    http://get.Adobe.com/flashplayer/

    ----------

    Flash Player

    Troubleshoot installation of Flash Player for Windows

    http://kb2.Adobe.com/CPS/191/tn_19166.html

    Troubleshooting player stability and performance

    http://blogs.Adobe.com/JD/2010/02/troubleshooting_player_stabili.html

    Uninstaller

    http://kb2.Adobe.com/CPS/141/tn_14157.html

    Flash Player Support Forum

    http://forums.Adobe.com/community/webplayers/flash_player

  • I have tried literally 8 hours get my flash player to work on my phone Motorola E2

    As I said I tried to literally hours and hours trying to get the Flash Player to work how do

    Hello

    Flash Player is only supported on desktop systems.  It is not supported on mobile (Android, Blackberry, iOS, Windows, etc.) devices.

    Refer to the Adobe Flash Player | Technical specification for a list of supported operating systems.

    --

    Maria

  • Windows Media Player is not listed under the toolbars, and I can not get the mini Player to work

    I have Windows Media Player 11 and can't seem to get the mini Player to show when I minimize it.  When I right click near the clock, what I see under the toolbars is links, language bar, desktop and quick launch bar. What happened to the option of the Media Player window, and how can I get it back?

    Hi RachelAllee,

    1. you remember to make changes on your computer before this problem?

    You can again save wmp.dll, and then search for the question.

    a. Click Start, run and type:

    regsvr32 "%programfiles%\Windows Media Player wmpband.dll"

    b. press enter and restart the computer and check.

    Hope this information is useful.

  • I can't get EMET 2.1 to work on XP Home machines

    I can't get EMET 2.1 to work on 2 computers XP Home.

    I understand that I will not be able to configure the system wide DEP on XP Home versions, but I should be able to participate of the individual claims of DEP using the button "Configure Apps".  Problem is that does not either, on two different machines... I added the browser, pdf, customer e-mail reader and Media Player, but when I restarted these applications, they did not appear in the lower pane as running EMET.

    It is my understanding applications, when adding, supposed to be indicated as a checkmark green or any other symbol next to them?

    I see neither EMET in Process Explorer.  :(

    Of course, I could use some assistance.

    Hello

    I suggest you to report this problem in the TechNet community.
    http://social.technet.Microsoft.com/forums/en/Emet/threads

  • How can I get a dynamic mic to work on the iMac?

    How can I get a dynamic microphone to work via the usb input? Do I need a plug-in?

    Well Yes, if it is a USB microphone, the support is to plug.  Note, Apple provides an Audio configuration and Apple Midi utility in Applications-> utilities that once connected develops on the parameters in the menu-> Preferences-> sound-> entry

    Some microphones require Mac OS X drivers.  It would therefore be important to determine if yours is a.   Google your brand and model micro with Mac OS X and the drivers of Word to see if someone needs.

  • Get incremental counter/sound to work along side with action with usb-6008 with labview tia sal22

    Get incremental counter/sound to work along the coast with usb-6008 with labview tia sal22

    Hi all

    I can get this vi to work if they are distinct from the vi but I can't join them together

    Example of my error:

    If buffers are set to 0 the freq counter increment works, but no sound
    If the buffers are set to 1 the audio works fine but is not increment the Freq counter
    If the buffers are attached to more 1 clicks and pops are coming

    That's what I'm doing:
    (1) have the frequency of increment of my internal sound card to a certain level as .01hz a second until he gets to 20 000 hz

    (2) use my device usb-6008 daq, which is connected to the same machine to measure the voltage at the same time. (I am in a position very low voltages between 1-5volts)

    (3) output to a worksheet text file which will show you:

    time in seconds, frequency, voltage
    0,400.01,2

    1,400.02,2.5

    2,400.03,1

    I'm a bit confused about how connect the increment and the audio during the measurements with the usb-6008 housing on the same machine
    at the same time and in the same VI.

    Anyone have any ideas?  I'm using labview 8.5
    TIA sal22

    Ha ha you have been deceived by a dynamic thread. Insert a convert from Dynamic Data Express VI (Palette to own: Signal handling screw Express) between the daq read and build the array function. Then it won't work. Now the value in the dynamic data is only converted to a numeric value

  • How can I get the internal speakers to work on a hpvs15 screen

    I have NEEDED HELP GETTING THE INTERNAL speakers to WORK ON A HPVS15 MONTOR!

    Hello

    Try a reset of the monitor. Unplug the power cord from the monitor and hold the power button of the monitor for 30 to 60 seconds. Plug the monitor back in and it lights up.  Does that help?

    Consult this Manual.  Go into the on-screen display-->> volume and turn up to max all the sounds?

    Don't forget that you have a green audio cable plugged into the monitor and audio output on your PC port. Don't forget to unplug the headphones.

    Try a PC speaker separated in order to eliminate the PC as the problem.  You can also try the monitor and cable on another PC.

  • Hello, I am trying to get my internal speakers to work. Device States drivers are missing, but no info on what brand and model they are.

    Hello, I am trying to get my internal speakers to work. They worked fine up until I had to repalce my hard drive. I finailly got all my drivers installed and updated on the site variouus.  Now, when I check my internal speakers (no system sounds) I can not find the make and model of them.  All I can identify is that I have.  That the drivers are missing. No part number for the company name, etc. is connected with the internal speakers.

    Dell PC Tower, Denmension bought 3000 mid-' 04.

    Interanal speakers for system sounds.

    Windows XP Edition version family.  IE8

    Windows Defender antispyware software.

    Thank you

    I don't know what you mean by getting the drivers from "various sites." The only place to get the drivers for the hardware that is installed with your Dimension is the Dell Web site.

    There is only one pilot audio for your Dimension 3000 and it's here:

    http://support.dell.com/support/downloads/download.aspx?c=us&cs=08W&l=en&s=bsdv&releaseid=R94481&SystemID=DIM_CEL_3000&servicetag=&os=WW1&osl=en&deviceid=2430&devlib=0&typecnt=0&vercnt=3&catid=-1&impid=-1&formatcnt=1&libid=3&typeid=-1&dateid=-1&formatid=-1&fileid=122481

    Of course if you added your own sound card you need get the drivers of the mftr site. but provided with your Dell printer's on the motherboard, and those are the drivers for it. MS - MVP - Elephant Boy computers - don't panic!

  • I can't get Adobe Flash Player to date on my Mac. It keeps telling me to close Safari, even if it is closed. I tried all the suggestions on the Adobe site and always get the same results. Thanks for any help

    I can't get Adobe Flash Player to date on my Mac. It keeps telling me to close Safari, even if it is closed. I have tried every thing on the Adobe site to solve the problem with the same results still. I went to the site of both Mac and said to go to Adobe for a solution. It worked fine as a new Mac in February, but it will not update now, so no Flash Player ay all. Thanks for any help.

    By clicking the red dot on the safari window it minimizes, but leave the program running.

    To exit Safari completely, open Safari by clicking on the dock icon, and then choose Safari > Quit Safari to the upper left of the screen.

  • Custom player skins?

    Hello, I'm working on creating a flash animation to be displayed on a Web page and I wonder if there are options out there to create a custom Player skin?

    I've never tried create a look, but I was wondering if Flash has given you all the options for this or if there's a different Adobe software that you would suggest?

    Thanks a lot for your help!

    Found my answer thanks!

  • If someone was able to get a kodak esp3250 to work with OSX el capitan 10.11.3

    If someone was able to get a kodak esp3250 to work with OSX el capitan 10.11.3

    Try to obtain the latest printer driver for Mac OS X and install it, if it works.

    http://support.en.kodak.com/app/answers/detail/A_ID/17378/kW/Kodak%20ESP%203250% 20driver%20download/selected/true

  • How can I get my TWAIN scanner to work at Yosemite

    How can I get my twain scanner to work at Yosemite?

    Please read the basics of the Mac: using a scanner - Apple Support.

Maybe you are looking for

  • Battery draining fast after the update of El Capitan 10.11.6

    I get usually around 7-8 hours of life of the battery until last week. Now, it does not go beyond 4 hours. Here is the list of applications that use years. I use applications all the time: 1 safari 2. prospects 2-3 hours per day: 3 adobe Dreamweaver

  • How to save Silverlight on my hard drive?

    Re: Plugins. Update of Silverlight, I wonder record Silverlight .exe on my hard drive. I don't know how to do this. Can you explain? Thank you.

  • HP 7 G2 1311 / J5T72AA: HP 7 G2 1311 - only restart

    Good afternoonI have the following problem: I have a Tablet HP7 g2 1311 that constantly and automatically reboots in standby, then it takes longer to restart than normal, sometimes also blocks, so I have to press the power button (to be noted that in

  • EX7000 as Access Point - port LAN still usable?

    Hello guys,. Read the user manual before you buy, I found something that annoying me... On page 19 of the Manual, I found: Mode access point, you can connect your computer or WiFi device to the Extender only using a WiFi connection. Then... IF mode A

  • Updating BIOS for Win7 on Pavilion DV6000

    Hello I have an older HP Pavilion DV6000 with 4 GB of RAM (2 GB RAM upgrade).    However, only 2.69 GB can be used.   It has been suggested that I have upgraded the BIOS and turn "remapping memory."    The OS is Win7 Home Premium 32 bit OS. l has a p