How to add the stop button in the present code AS3

Hello, im new to this adobe flash AS3. I want to create a simple solid game using flash + XML file for a site., this is my code

all of this code are greate job... but I have the problem to add the code to stop_btn my playlist button already have next, thank you and pause and play... only the stop button I fail to create. This is my code

var my_songs:XMLList;

var my_total:Number;

var my_sound:Sound;

var my_channel:SoundChannel;

var current_song:Number = 0;

var song_position:Number;

var song_paused:Boolean;

var myXMLLoader:URLLoader = new URLLoader();

myXMLLoader.load (new URLRequest ("playlist2.xml"));

myXMLLoader.addEventListener (Event.COMPLETE, processXML);

processXML function (e: Event): void {}

var myXML:XML = new XML (e.target.data);

my_songs = myXML.SONG;

my_total = my_songs.length ();

}

function playSong(mySong:Number):void {}

myTitle var = my_songs[mySong].@TITLE;

var myArtist = my_songs[mySong].@ARTIST;

var myURL = my_songs[mySong].@URL;

title_txt. Text = myTitle;

artist_txt. Text = myArtist;

If {(my_channel)

my_channel. Stop();

}

my_sound = new Sound();

my_sound. Load (new URLRequest (myURL));

my_channel = my_sound.play ();

my_channel.addEventListener (Event.SOUND_COMPLETE, onNext);

}

next_btn.addEventListener (MouseEvent.CLICK, onNext);

function onNext(e:Event):void {}

current_song ++;

If (current_song > = my_total) {}

current_song = 0;

}

playSong (current_song);

}

prev_btn.addEventListener (MouseEvent.CLICK, onPrev);

function onPrev(e:MouseEvent):void {}

-current_song;

If (current_song < 0) {}

current_song = my_total-1;

}

playSong (current_song);

}

pause_btn.addEventListener (MouseEvent.CLICK, onPause);

function onPause(e:MouseEvent):void {}

If {(my_channel)

song_position = my_channel.position;

my_channel. Stop();

song_paused = true;

}

}

play_btn.addEventListener (MouseEvent.CLICK, onPlay);

function onPlay(e:MouseEvent):void {}

If {(song_paused)

my_channel = my_sound.play (song_position);

song_paused = false;

} else if (! my_channel) {}

playSong (current_song);

}

}

can help me... Thank you

stop_btn.addEventListener (MouseEvent.CLICK, onStop);

function onStop(e:MouseEvent):void {}

If {(my_channel)

my_channel. Stop();

}

}

Tags: Adobe Animate

Similar Questions

  • How to add the full value of two buttons?

    How to add the full value of two buttons (any key) VI and display it in the output text box? I am attaching a sample program, but I know that his evil... Help, please

    Try this

  • How to add the table radio button.

    Hello

    I want to update the record if I want that an option of button raduio shaped tabular .There is no option for tabular.
    How to add the table radio button.


    Thank you

    Published by: 805629 on February 3, 2011 04:56

    Use APEX_ITEM. BOX API in the definition of SQL query for the form of tables

  • Button skin: how to add the button properties (more, low, high)

    Hi all

    I made a custom button 'skin' because I want my buttons to be images with NO box or border around it and it works well, but I don't know how to add the functionality of the button. ex. In "over" State buttons tend to turn on, and 'down' State they tend to become darker. Anyone know how to apply it to an image? Here is my code. Thank you guys!

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:fx s:SparkSkin ' http://ns.Adobe.com/MXML/2009 "
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx" width = "64" height = "64" >

    < fx:Metadata >
    [HostComponent ("spark.components.Button")]
    < / fx:Metadata >

    < s: states >
    < name s: State = "over" / >
    < name s: State = "low" / >
    < name s: State = "mounted" / >
    < name s: State = "disabled" / >
    < / s: states >

    (< mx:Image source="@Embed(source='assets/images/lightbulb.png')" / > "
    < / s:SparkSkin >

    You can try something like this:

    
    http://ns.adobe.com/mxml/2009"
                 xmlns:s="library://ns.adobe.com/flex/spark"
                 xmlns:mx="library://ns.adobe.com/flex/mx"
                 width="64" height="64">
    
        
            [HostComponent("spark.components.Button")]
         
    
        
            
            
            
            
            
    
        
    
    
    

    Peter

  • How to add the "print" button in the payslip online

    Dear friends,

    How to add the "print" button in the payslip online (Employee Self Service). Is someone can pls let me know on this subject...

    regarding
    Swpana

    Hello

    Please see the following documents.

    Note: 332402.1 - can you mass printing of payslips online?
    https://metalink2.Oracle.com/MetaLink/PLSQL/ml2_documents.showDocument?p_database_id=not&P_ID=332402.1

    Note: 256072.1 - payslip V4.0 button "print" is missing
    https://metalink2.Oracle.com/MetaLink/PLSQL/ml2_documents.showDocument?p_database_id=not&P_ID=256072.1

    For more information on Advisor and Checkwriter deposit, please see:

    Note: 459306.1 - notice of Checkwriter/filing XML
    https://metalink2.Oracle.com/MetaLink/PLSQL/ml2_documents.showDocument?p_database_id=not&P_ID=459306.1

    Kind regards
    Hussein

  • How to add the column to Adobe flex mxml or actionsctpt mx:DataGrid?

    I have the simple mxml code

    <mx:DataGrid id="DGG"
                
    editable="true">
       
    <mx:dataProvider>
           
    <mx:Object scheduledDate="4/1/2006"/>
       
    </mx:dataProvider>
    </mx:DataGrid>
    <mx:Button id="SetBut"
              
    label="Set Array as Data Provider"
              
    click="SetDP(); AddBut.visible = true;"
              
    x="100.5"
              
    y="164"
              
    width="211"/>
    <mx:Button id="AddBut"
              
    label="Add a column!"
              
    click="AddCol();"
              
    x="100.5"
              
    y="194"
              
    width="211"
              
    visible="false"/>
    <mx:Script>
        <![CDATA[
            import mx.controls.dataGridClasses.DataGridColumn;
            import mx.collections.ArrayCollection;

            [Bindable]
            public var MyAC:ArrayCollection=new ArrayCollection([{scheduledDate: "4/1/2006", homeTeam: "Chester Bucks"}]);

            public function SetDP():void
            {
                DGG.dataProvider=MyAC
            }

            public function AddCol():void
            {
                MyAC.addItem({scheduledDate: "4/5/2007", homeTeam: "Long Valley Hitters", Umpire: "Amanda Hugenkis"});
                DGG.columns.push(new DataGridColumn("Umpire"));
            }
        ]]>
    </mx:Script>

    I want to add lines to my datagrid table how do such thing?

    How to add the column to Adobe flex mxml or actionsctpt mx:DataGrid?

    (You can place this code in a Flash or AIR application - it compiles without error, but will not add any columns =)

    Change this:

    public void SetDP (): void
    {
    DGG.dataProvider = MyAC
    MyAC.addItem ({scheduledDate: "05/04/2007", homeTeam: "long hitters Valley", umpire: "Amanda Hugenkis"});
    }
               
    public void AddCol (): void
    {
    var dgc:DataGridColumn = new DataGridColumn ("Umpire");
    var ca:Array = DGG.columns;
    CA.push (DGC);
    DGG.columns = ca;
    }

    Dany

  • How to add the name of the title of graph in Excel

    Dear friends

    I'm using LabVIEW 8.0.I need how to add the name of the title of graph in Excel.

    You have the report generation tool? If so, the VI of graph Easy Excel has an entry for this.

    If you don't have the Toolbox, then you need to use ActiveX. Please do a search on the use of the ActiveX (there are examples provided with LabVIEW) to control Excel. Also, there are many examples in the thread Excel. NOTE: DON'T POST QUESTIONS IN THIS THREAD.

    In the end, you will need to search for information contained in MSDN.

  • How to add the quick launch of the desktop icon bar

    How to add the toolbar launch quick icon on the desktop. I can't find a desktop icon that will drag on

    The following Microsoft KB article

    http://support.Microsoft.com/kb/190355/en-us

    will help you.

    Good bye.

  • How to add the translation application to my email add FB?

    Original title: translation

    I need to know how to ADD the TRANSLATION software to my email add FB? Any help?

    Try here: https://www.facebook.com/help/100117036792266

    Translate the updated Facebook application on the road

  • How to add the Quazip library

    Hi, I want to try to use Quazip. Since I read, I have to add the library before use.

    I downloaded from http://quazip.sourceforge.net/

    How to add the Quazip library? Please explain the step, never add lib before.

    Thank you

    I have change the .pro file

    Like this:

    http://StackOverflow.com/questions/13341234/unzip-files-downloaded-from-Server

  • How to add the profile of lenses?

    How to add the profile of lenses?

    At the bottom of the link, you will find a link for the lens profile downloader. With this tool, you can download the profiles shared by other users.

    Work with lenses profiles in Adobe Photoshop, Lightroom and Camera Raw

  • How to add the new column in existing table to our desired location?

    How to add the new column in existing table to our desired location?

    For example, I have to add the new column 'course' before the salary column in the emp table.

    I think the best way is to add the column at the end of the table and create a new view with the order of the columns...

    Another option...

    places the data into a temporary table and recreate the table with the correct order of the columns, and then insert data to the table from the temporary table

    Refer

    Add column (from table) in the desired position

    Example:

    CREATE TABLE temp_my_user LIKE)

    SELECT * FROM password);

    DROP TABLE password;

    (Password) CREATE TABLE

    userID NUMBER

    , first name VARCAHR2 (25)

    , middleInitial VARCHAR2 (1)

    (, name VARCHAR2 (25));

    INSERT INTO password (userID, firstName, lastName)

    (SELECT username

    first name

    lastName

    OF temp_my_user);

    DROP TABLE temp_user;

  • How to add the bar at the bottom of the page [Dreamweaver]

    Hello!

    How to add the bar at the bottom of the page that helps me to make changes in my creation page?

    Not sure I understand.  Looking for the properties panel?  Press Ctrl + F3 or go to window > properties.

    Nancy O.

  • Please tell me how to add the English language in photoshop?

    Hello! Please tell me How to add the English language in photoshop? I'm from Russia and acquired, respectively, also in Russia()

    Cloud of swap language http://helpx.adobe.com/creative-cloud/kb/change-installed-language.html

    or

    A product of Adobe for another language or version of trading platform for CS6

  • How to add the date felxfiled in OFA

    How to add the date felxfiled in OFA

    Hi gurus,

    How to add a date in the form OFA field. I tried but no optin schedule it. I need to add the calendar options before the flexfiled.

    Concerning

    Hello

    Allocate FND_STANDARD_DATE segment value your FDF everywhere where you want to see the calendar on the page of the OFA.

    Let me know if you need more help on this.

    Kind regards

    Hemant

Maybe you are looking for