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 8810875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:13:30+00:00 2026-06-14T03:13:30+00:00

I am building a audio sequencer in as3. i have a Track class which

  • 0

I am building a audio sequencer in as3. i have a Track class which contains a play button to play the sound once, a volume slider and 16 check boxes to turn on/off each of the 16 steps. there are 8 instances of Track on the stage. what i want to know is how to uniquely identify what button/slider/check box is being clicked on? and where do i load each sound?
boleow is my Track class

package 
    {
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.media.Sound;
import flash.media.SoundChannel;
import flash.net.URLRequest;
public class Track extends MovieClip
{
    private var soundName:Sound;
    private var theChannel:SoundChannel;
    private var songName:String;
    public function Track()
    {
        // constructor code
        trace("track created");
        singlePlay.addEventListener(flash.events.MouseEvent.CLICK, handlePlayClick);
    }
    private function handlePlayClick(e:Event):void
    {
        trace("Play clicked");
        this.play();
    }       
    public function setSoundName(theName:String):void
    {
        this.songName = theName;
        soundName = new Sound();
        var req:URLRequest = new URLRequest(this.songName);
        soundName.addEventListener(Event.COMPLETE, playSound);
        soundName.load(req);
    }
    public function playSound()
    {
        theChannel = soundName.play();
    }
    public function stopSound():void
    {
        theChannel.stop();
    }
}
}
  • 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-06-14T03:13:31+00:00Added an answer on June 14, 2026 at 3:13 am

    It would be better if you have a central audio player with ability to load differnet audio files (tracks) and UI which will trigger actions on that class instead of building visual element that will handle also playing the audio. You have to learn OOP principles first to be able to do it right (right means: flexible, reusable and easy to maintain/expand):

    Books:

    • Essential ActionScript 3.0 – Moock
    • Object Oriented ActionScript 3.0 – Elst, Jacobs, Yard

    to directly answer your question each DispalyObject has a name property you could use this to identify what has been clicked – not ideal.

    best regards

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building an audio recording applet, so it needs permission to record sound. I
I am building a small OS. For that i wanted to play audio. I
I am in the process of building a rails/flex application which requires audio to
I'm building a music player web application which implements the HTML5 audio tag, however
I'm building a MIDI synth using CoreAudio. Currently, I have the following audio graph:
I'm building a simple audio player in AS3. I would like to embed multiple
So im building a chrome extension and I have placed an audio flash player
I have an audio player that I'm building using AVPlayer. Currently, I keep the
I'm building an iphone application which involves a video player,audio player and more in
This is how the sound is stored: <audio id = hammer src=res/sounds/Building/hammer.wav></audio> In the

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.