Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6929613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:20:25+00:00 2026-05-27T11:20:25+00:00

I have an mp3 embedded in a Flex application with a start and stop

  • 0

I have an mp3 embedded in a Flex application with a start and stop button. Using this code…

<fx:Script>
<![CDATA[ 
import mx.core.SoundAsset; 
import flash.media.*; 

[Embed(source="assets/pie-yan-knee.mp3")] 
[Bindable] 
public var Song:Class; 

public var mySong:SoundAsset = new Song() as SoundAsset; 
public var channel:SoundChannel;

public function playSound():void
{ 
  stopSound(); 
  channel = mySong.play();
}

public function stopSound():void
{
  if ( channel != null ) channel.stop();
} 
]]>
</fx:Script> 

<s:HGroup> 
<s:Button label="play" click="playSound();"/> <s:Button label="stop"
  click="stopSound();"/> 
</s:HGroup>

I want to have multiple instances with different sounds though.
How can I do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:20:26+00:00Added an answer on May 27, 2026 at 11:20 am

    Just make a separate class reference for each:

    [Embed(source="assets/song1.mp3")] 
    [Bindable] 
    public var Song1:Class; 
    [Embed(source="assets/song2.mp3")] 
    [Bindable] 
    public var Song2:Class; 
    [Embed(source="assets/song3.mp3")] 
    [Bindable] 
    public var Song3:Class; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an mp3 player that sends MCI commands to play pause/ff/rw/stop the audio
I have an mp3 file on a server. I want to get this file's
I have an mp3 i save to sdcard if i start the MediaPlayer.play then
Inn the below code i have placed my mp3 in the src directory where
I am looking to have an mp3 start playing whenever an item fades in.
I have mp3 files stored on the iPhone and I my application should to
I have an mp3 file in an S3 bucket. I am fetching this file
I'm trying to create a code to download mp3 files embedded in a page.
I have an mp3 player based on the School of Flash code. When I
hello there okay so this is the deal i have my mp3 files on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.