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

add pause in this code....help!!!!

New Here ,
Nov 26, 2013 Nov 26, 2013

hi everybody!!!

i'm writing code for up and down speed of song....

for play of song i write this code:

public function playMC(evt:MouseEvent😞void
       
{
            target
= new ByteArray();
           
var url:URLRequest = new URLRequest("C://song.mp3");
            mp3Start
= new Sound();
            mp3Start
.addEventListener(Event.COMPLETE, complete);
            mp3Start
.load(url);


            position
= 0.0;
            rate
= 1.0;
            sound
= new Sound();
            sound
.addEventListener(SampleDataEvent.SAMPLE_DATA, sampleData);
           
       
}
public function complete(event:Event😞void
       
{
            channel
= sound.play();
       
}

this code is good for only play and stop song....i want add pause song....how to do??

help me please!!!!

TOPICS
ActionScript
767
Translate
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

LEGEND , Nov 26, 2013 Nov 26, 2013

There is no pause function.  What you need to do is stop the sound and remember where you stopped so that when play is resumed you specify where to start.  Here is a help document that explains it:

http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d12.html

Translate
LEGEND ,
Nov 26, 2013 Nov 26, 2013

There is no pause function.  What you need to do is stop the sound and remember where you stopped so that when play is resumed you specify where to start.  Here is a help document that explains it:

http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d1...

Translate
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
New Here ,
Nov 26, 2013 Nov 26, 2013

thank's very much!!!!!!

i haven't think to resume play....

thank's!!!!

Translate
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
LEGEND ,
Nov 26, 2013 Nov 26, 2013

You're welcome

Translate
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
New Here ,
Nov 30, 2013 Nov 30, 2013

hi!!!

now i have another small problem...

i want add one timer ans progressBar...

for add time i write this:

public function getCurrentSong(evt:TimerEvent):void

                    {

                              currentSong.text = convertTimer(sound.position);

}

but don't go same time!!!!

and how to use the sliderBar or progressBar in this player???

help me please!!!!

Translate
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
LEGEND ,
Nov 30, 2013 Nov 30, 2013

You should start new postings when you have new issues you want to resolve.

What have you done for the Timer coding?  What other code supports that function you just showed (what does convertTimer do?)?

Translate
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
New Here ,
Nov 30, 2013 Nov 30, 2013

hi!!!

sorry!!!

now i will write new issues...

Translate
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
LEGEND ,
Nov 30, 2013 Nov 30, 2013
LATEST

Nothing done that you need to be sorry about.  It is better to start new postings for the benefit of others that might be having a similar problem.  That's one reason why titling your posting to reflect the issue is important.

Translate
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