• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

how can i re the sound

Participant ,
Mar 27, 2012 Mar 27, 2012

Copy link to clipboard

Copied

how are you guys

here

i did this

package{

    import flash.display.MovieClip;

    import flash.events.MouseEvent;

    import flash.events.Event;

import flash.media.Sound;

    import flash.media.SoundChannel;

public class admin1 extends MovieClip

{

var WIND:wind;  // the sound file name

var SOUNDCHANNEL:SoundChannel

public function admin1(){

        addEventListener(Event.ADDED_TO_STAGE,onAddedToStage)

        }

public function onAddedToStage(event:Event):void

        {

WIND = new wind;

           

            SOUNDCHANNEL = WIND.play()

}

}

}

it works but only one time i wanna the sound keep working after finished

thank you

TOPICS
ActionScript

Views

1.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 27, 2012 Mar 27, 2012

use:

package{

    import flash.display.MovieClip;

    import flash.events.MouseEvent;

    import flash.events.Event;

import flash.media.Sound;

    import flash.media.SoundChannel;

public class admin1 extends MovieClip

{

var WIND:wind;  // the sound file name

var SOUNDCHANNEL:SoundChannel

public function admin1(){

        addEventListener(Event.ADDED_TO_STAGE,onAddedToStage)

        }

public function onAddedToStage(event:Event):void

        {

WIND = new wind;

            SOUNDCHANNEL = WIND.play(0,1000);  loops

...

Votes

Translate

Translate
Community Expert ,
Mar 27, 2012 Mar 27, 2012

Copy link to clipboard

Copied

use:

package{

    import flash.display.MovieClip;

    import flash.events.MouseEvent;

    import flash.events.Event;

import flash.media.Sound;

    import flash.media.SoundChannel;

public class admin1 extends MovieClip

{

var WIND:wind;  // the sound file name

var SOUNDCHANNEL:SoundChannel

public function admin1(){

        addEventListener(Event.ADDED_TO_STAGE,onAddedToStage)

        }

public function onAddedToStage(event:Event):void

        {

WIND = new wind;

            SOUNDCHANNEL = WIND.play(0,1000);  loops 1000 times

}

}

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 27, 2012 Mar 27, 2012

Copy link to clipboard

Copied

ohh thank you alot brother

only 1 last please

how can i change the sound if this sound finish to another sound

like wind then rain sound

and thank you again brother thats realy help me alot

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 27, 2012 Mar 27, 2012

Copy link to clipboard

Copied

the soundchannel class has a soundcomplete event you can use after you remove that loop parameter from the play() method:

package{

    import flash.display.MovieClip;

    import flash.events.MouseEvent;

    import flash.events.Event;

import flash.media.Sound;

    import flash.media.SoundChannel;

public class admin1 extends MovieClip

{

var WIND:wind;  // the sound file name

var SOUNDCHANNEL:SoundChannel

public function admin1(){

        addEventListener(Event.ADDED_TO_STAGE,onAddedToStage)

        }

public function onAddedToStage(event:Event):void

        {

WIND = new wind();

            SOUNDCHANNEL = WIND.play();

SOUNDCHANNEL.addEventListener(Event.SOUND_COMPLETE,soundcompleteF);

}

private function soundcompleteF(e:Event):void{

var rain:Rain=new Rain();

SOUNDCHANNEL.removeEventListener(Event.SOUND_COMPLETE,soundcompleteF);

SOUNDCHANNEL=rain.play();

}

}

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 27, 2012 Mar 27, 2012

Copy link to clipboard

Copied

thank you alot brother

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 27, 2012 Mar 27, 2012

Copy link to clipboard

Copied

LATEST

you're welcome.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines