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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:53:39+00:00 2026-05-26T08:53:39+00:00

i have a problem with Action Script 3. I use Flash CS5. I want

  • 0

i have a problem with Action Script 3. I use Flash CS5.

I want to create a little Karaoke Player. It works for the first play, but not for the second.

In the first layer i have my player (music, buttons, etc). With the play button i start the audio (mp3) and the lyrics (text). I call the text as instance (its a sub layer of the main layer).

Problem is, when i complete the song and the text and want to play it again, only the text starts and NOT the music.

How can i load the music, too?

Here is my code:

// Musik
var meinSound = new musik ();
var meinSoundKanal = meinSound.play ();
var meinSoundTransform = meinSoundKanal.soundTransform;
meinSoundKanal.stop ();
var soundPosition = 0;

// Play und Pause Button
var buttonZustand = "Play";

this.play_bt.addEventListener (MouseEvent.CLICK, buttonAendern);
function buttonAendern (Param) {
    if (buttonZustand == "Play") {
        this.play_bt.gotoAndStop (2);
        buttonZustand = "Pause";
        meinSoundKanal = meinSound.play (soundPosition);
        meinSoundKanal.soundTransform = meinSoundTransform;
        this.textanimation.play();
    } else {
        this.play_bt.gotoAndStop (1);
        buttonZustand = "Play";
        soundPosition = meinSoundKanal.position;
        meinSoundKanal.stop();
        this.textanimation.stop();
    }
}

// Volume Button
var volumeZustand = "An";

this.volume_bt.addEventListener (MouseEvent.CLICK, volumeAendern);
function volumeAendern (Param) {
    if (volumeZustand == "An") {
        this.volume_bt.gotoAndStop (2);
        volumeZustand = "Aus";
        meinSoundTransform.volume = 0;
        meinSoundKanal.soundTransform = meinSoundTransform;
    } else {
        volumeZustand = "An";
        this.volume_bt.gotoAndStop (1);
        meinSoundTransform.volume = 1;
        meinSoundKanal.soundTransform = meinSoundTransform;
    }
}

// Stop Button
this.stop_bt.addEventListener(MouseEvent.CLICK, LiedStoppen);
function LiedStoppen (e) {
    meinSoundKanal.stop();
    play_bt.gotoAndStop(1)
    this.textanimation.gotoAndStop(1)
}

// Lautstärkeregler
var bewegungsRaum=new Rectangle(361,357,168,0);

this.regler_bt.addEventListener(MouseEvent.MOUSE_DOWN, halten);

function halten(Parameter)
{
    this.regler_bt.startDrag(false, bewegungsRaum);
}

this.regler_bt.addEventListener(MouseEvent.MOUSE_UP, loslassen);

function loslassen(Parameter)
{
    this.regler_bt.stopDrag();
}


this.regler_bt.addEventListener(MouseEvent.MOUSE_MOVE, lautRegeln);
function lautRegeln(Param) {
    meinSoundTransform.volume = (this.regler_bt.x -361) / 168;
    meinSoundKanal.soundTransform = meinSoundTransform;
}

I hope you can help me 🙂

Greets


UPDATED:

// Musik
var meinSound = new musik ();
var meinSoundKanal = meinSound.play ();
var meinSoundTransform = meinSoundKanal.soundTransform;
meinSoundKanal.stop ();
var soundPosition = 0;

meinSoundKanal.addEventListener(Event.SOUND_COMPLETE, next_item_handler);
        function next_item_handler(e:Event):void{
         meinSoundKanal.stop();
         soundPosition = meinSoundKanal.position;
    }


// Play und Pause Button
var buttonZustand = "Play";

this.play_bt.addEventListener (MouseEvent.CLICK, buttonAendern);
function buttonAendern (Param) {
    if (buttonZustand == "Play") {
        this.play_bt.gotoAndStop (2);
        buttonZustand = "Pause";
        meinSoundKanal = meinSound.play (soundPosition);
        meinSoundKanal.soundTransform = meinSoundTransform;
        this.textanimation.play();
    } else {
        this.play_bt.gotoAndStop (1);
        buttonZustand = "Play";
        soundPosition = meinSoundKanal.position;
        meinSoundKanal.stop();
        this.textanimation.stop();
    }
}



// Volume Button
var volumeZustand = "An";

this.volume_bt.addEventListener (MouseEvent.CLICK, volumeAendern);
function volumeAendern (Param) {
    if (volumeZustand == "An") {
        this.volume_bt.gotoAndStop (2);
        volumeZustand = "Aus";
        meinSoundTransform.volume = 0;
        meinSoundKanal.soundTransform = meinSoundTransform;
    } else {
        volumeZustand = "An";
        this.volume_bt.gotoAndStop (1);
        meinSoundTransform.volume = 1;
        meinSoundKanal.soundTransform = meinSoundTransform;
    }
}

// Stop Button
this.stop_bt.addEventListener(MouseEvent.CLICK, LiedStoppen);
function LiedStoppen (e) {
    meinSoundKanal.stop();
    play_bt.gotoAndStop(1)
    this.textanimation.gotoAndStop(1)
}

// Lautstärkeregler
var bewegungsRaum=new Rectangle(361,357,168,0);

this.regler_bt.addEventListener(MouseEvent.MOUSE_DOWN, halten);

function halten(Parameter)
{
    this.regler_bt.startDrag(false, bewegungsRaum);
}

this.regler_bt.addEventListener(MouseEvent.MOUSE_UP, loslassen);

function loslassen(Parameter)
{
    this.regler_bt.stopDrag();
}


this.regler_bt.addEventListener(MouseEvent.MOUSE_MOVE, lautRegeln);
function lautRegeln(Param) {
    meinSoundTransform.volume = (this.regler_bt.x -361) / 168;
    meinSoundKanal.soundTransform = meinSoundTransform;
}

UPDATED AGAIN 😀

// Musik
var meinSound = new musik ();
var meinSoundKanal = meinSound.play ();
var meinSoundTransform = meinSoundKanal.soundTransform;
meinSoundKanal.stop ();
var soundPosition = 0;

meinSoundKanal.addEventListener(Event.SOUND_COMPLETE, next_item_handler);
    function next_item_handler(e:Event):void{
          var soundPosition = 0; 
          var meinSoundKanal = meinSound.play ();
    }


// Play und Pause Button
var buttonZustand = "Play";

this.play_bt.addEventListener (MouseEvent.CLICK, buttonAendern);
function buttonAendern (Param) {
    if (buttonZustand == "Play") {
        this.play_bt.gotoAndStop (2);
        buttonZustand = "Pause";
        meinSoundKanal = meinSound.play (soundPosition);
        meinSoundKanal.soundTransform = meinSoundTransform;
        this.textanimation.play();
    } else {
        this.play_bt.gotoAndStop (1);
        buttonZustand = "Play";
        soundPosition = meinSoundKanal.position;
        meinSoundKanal.stop();
        this.textanimation.stop();
    }
}

// Volume Button
var volumeZustand = "An";

this.volume_bt.addEventListener (MouseEvent.CLICK, volumeAendern);
function volumeAendern (Param) {
    if (volumeZustand == "An") {
        this.volume_bt.gotoAndStop (2);
        volumeZustand = "Aus";
        meinSoundTransform.volume = 0;
        meinSoundKanal.soundTransform = meinSoundTransform;
    } else {
        volumeZustand = "An";
        this.volume_bt.gotoAndStop (1);
        meinSoundTransform.volume = 1;
        meinSoundKanal.soundTransform = meinSoundTransform;
    }
}

// Stop Button
this.stop_bt.addEventListener(MouseEvent.CLICK, LiedStoppen);
function LiedStoppen (e) {
    meinSoundKanal.stop();
    play_bt.gotoAndStop(1)
    this.textanimation.gotoAndStop(1)
}

// Lautstärkeregler
var bewegungsRaum=new Rectangle(361,357,168,0);

this.regler_bt.addEventListener(MouseEvent.MOUSE_DOWN, halten);

function halten(Parameter)
{
    this.regler_bt.startDrag(false, bewegungsRaum);
}

this.regler_bt.addEventListener(MouseEvent.MOUSE_UP, loslassen);

function loslassen(Parameter)
{
    this.regler_bt.stopDrag();
}


this.regler_bt.addEventListener(MouseEvent.MOUSE_MOVE, lautRegeln);
function lautRegeln(Param) {
    meinSoundTransform.volume = (this.regler_bt.x -361) / 168;
    meinSoundKanal.soundTransform = meinSoundTransform;
}
  • 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-26T08:53:39+00:00Added an answer on May 26, 2026 at 8:53 am

    You should use soundChannel class to check whether the audio is finished its playing or not.

    SndChannel.addEventListener(Event.SOUND_COMPLETE, next_item_handler);
        private function next_item_handler(e:Event):void{
             //location for next or prev or repeat link.
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a flash upload component I want to use to upload multiple files.
i am new to Action Script and i have the following problem: i have
I have a problem with Jquery function getJSON, the action url does not trigger
I have a problem with the query below in postgres SELECT u.username,l.description,l.ip,SUBSTRING(l.createdate,0,11) as createdate,l.action
I'm struggling here with a problem: I have a controller questions which has action
Here's my problem: I have do create a menu/list of actions (which would be
I have problem with return statment >.< I want to store all magazine names
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have found a problem with use JQuery timeout, i have a page with
I'm having a problem trying to use the UrlHelper Action() method to point to

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.