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

Is it possible to play or pause a video by clicking on the video itself than using the control bar's play and stop buttons ?

Explorer ,
Sep 15, 2015 Sep 15, 2015

Copy link to clipboard

Copied

Is it possible to play or pause a video by clicking on the video itself than using the control bar's play and stop buttons ? If yes then how can we do it ?

TOPICS
ActionScript

Views

685

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 , Sep 15, 2015 Sep 15, 2015

When you define the video object, simply add an event listener like:

myVideo.addEventListener(MouseEvent.CLICK, toggleVideoPlayback);

private function toggleVideoPlayback(e:MouseEvent):void {

//if playing, pause

//if paused, play

}

Votes

Translate

Translate
Community Expert ,
Sep 15, 2015 Sep 15, 2015

Copy link to clipboard

Copied

Just add an event listener to the video display object itself. Are you building your own playback or using something prepackaged?

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
Explorer ,
Sep 15, 2015 Sep 15, 2015

Copy link to clipboard

Copied

Building own playback with movieclips and buttons. Can you please help me with the code ?

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 ,
Sep 15, 2015 Sep 15, 2015

Copy link to clipboard

Copied

When you define the video object, simply add an event listener like:

myVideo.addEventListener(MouseEvent.CLICK, toggleVideoPlayback);

private function toggleVideoPlayback(e:MouseEvent):void {

//if playing, pause

//if paused, 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
Explorer ,
Sep 15, 2015 Sep 15, 2015

Copy link to clipboard

Copied

Thanks...In case I had used the pre packaged flv player would I had to write the same code ?

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 ,
Sep 16, 2015 Sep 16, 2015

Copy link to clipboard

Copied

The component player has its own listeners built in, I believe.

FLVPlayback - Adobe ActionScript® 3 (AS3 Flash) API Reference

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
Explorer ,
Sep 16, 2015 Sep 16, 2015

Copy link to clipboard

Copied

LATEST

Ok Thanks.

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