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

AS3 Full Screen script, video crashed

Explorer ,
Jun 25, 2013 Jun 25, 2013

I load external video with playback component (skin over play stop seek mute vol.swf), its working great but when I use 

fscommand("fullscreen", "true");

on my first scene (first keyframe in time), and after that when I reach my video scene. I got just black screen

1.jpg

2.jpg

TOPICS
ActionScript
14.3K
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

Community Expert , Jun 30, 2013 Jun 30, 2013

use the netstream class:

var nc:NetConnection=new NetConnection();

nc.connect(null);

var ns:NetStream=new NetStream(nc);

var video:Video=new Video();

addChild(video);

video.attachNetStream(ns);

ns.play("yourvideo.flv");

Translate
Explorer ,
Jul 30, 2013 Jul 30, 2013

got the same output error

19.jpg

package {

                import flash.display.SimpleButton;

    import flash.events.MouseEvent;

                import flash.media.Video;

                import flash.net.NetConnection;

                import flash.net.NetStream;

                import flash.media.SoundTransform;

                import flash.display.MovieClip;

                public class clickbutton extends SimpleButton {

                                var ns:NetStream;

                                var previousVolume:Number = 1;

                                public function clickbutton() {

                                                this.addEventListener(MouseEvent.CLICK, clickF);

                                }

                                private function clickF(e:MouseEvent):void{

                                                MovieClip(root).flv_pb;

                                                MovieClip(root).flv_pb_parent;

                                                var nc:NetConnection=new NetConnection();

                                                nc.connect(null);

                                                ns=new NetStream(nc);

                                                var video:Video=new Video(320, 200);

                                                video.x=(stage.stageWidth-320)/2;

                                                video.y=(stage.stageHeight-200)/2;

                                                ns.client=this;

                                                this.parent.addChild(video);

                                                video.attachNetStream(ns);

                                                ns.play("video_test.flv");

                                                controlsF();

                                }

                                private function controlsF():void{

                                                MovieClip(root).play_btn.addEventListener(MouseEvent.CLICK,playF);

                                                 MovieClip(root).pause_btn.addEventListener(MouseEvent.CLICK,pauseF);

                                                 MovieClip(root).muteToggle_btn.addEventListener(MouseEvent.CLICK,mute F);

                                                // add volume listener here.  you'll need to decide how you want to control volume.

                                }                            

                                function playF(e:MouseEvent):void{

                                                ns.resume();

                                }

                                function pauseF(e:MouseEvent):void{

                                                ns.pause();

                                }

                                function muteF(e:MouseEvent):void{

                                                if(ns.soundTransform.volume>0){

                                                                var st:SoundTransform=ns.soundTransform;

                                                                previousVolume=st.volume;

                                                                st.volume=0;

                                                                ns.soundTransform=st;

                                                } else {

                                                                st=ns.soundTransform;

                                                                st.volume=previousVolume;

                                                                ns.soundTransform=st;

                                                }

                                }

                               

          public function onMetaData():void{ // this needs to be in the scope of your loader

          }

          private function onPlayStatus(eObj:Object):void{

          }

                }

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
Community Expert ,
Jul 31, 2013 Jul 31, 2013

yes, but this stops that error:

        public function onMetaData(eobj:Object): void { // this needs to be in the scope of your loader
        }
        public function onPlayStatus(eObj: Object): void {
        }
        public function onXMPData(eobj:Object):void{
        }

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
Explorer ,
Jul 31, 2013 Jul 31, 2013

Thx boss, no output error

But I face one more problem, I click the video button, video it’s playing, same time again i click on the video button, then I feel 2nd video is playing with the 1st video (2 video sounds its coming). if I click again on the video button, again 3rd time video is playing with 1st, 2nd videos (3 video sounds its coming).

20.jpg

This is the code which I use

package {

    import flash.display.SimpleButton;

    import flash.events.MouseEvent;

    import flash.media.Video;

    import flash.net.NetConnection;

    import flash.net.NetStream;

    import flash.media.SoundTransform;

    import flash.display.MovieClip;

    public class clickbutton extends SimpleButton {

                var ns:NetStream;

        var previousVolume:Number = 1;

                public function clickbutton() {

                this.addEventListener(MouseEvent.CLICK, clickF);

            }

                                private function clickF(e:MouseEvent):void{

                                                MovieClip(root).flv_pb;

                MovieClip(root).flv_pb_parent;

                var nc:NetConnection=new NetConnection();

                nc.connect(null);

                ns=new NetStream(nc);

                var video:Video=new Video(320, 200);

                video.x=(stage.stageWidth-320)/2;

                video.y=(stage.stageHeight-200)/2;

                ns.client=this;

                this.parent.addChild(video);

                video.attachNetStream(ns);

                ns.play("video_test.flv");

                controlsF();

                                }

                                private function controlsF():void{

                                                MovieClip(root).play_btn.addEventListener(MouseEvent.CLICK,playF);

                                                   MovieClip(root).pause_btn.addEventListener(MouseEvent.CLICK,pauseF);

                                                   MovieClip(root).muteToggle_btn.addEventListener(MouseEvent.CLICK,muteF);

                                                    // add volume listener here.  you'll need to decide how you want to control volume.

                                }                            

                                function playF(e:MouseEvent):void{

                                                ns.resume();

                                }

                                function pauseF(e:MouseEvent):void{

                                                ns.pause();

                                }

                                function muteF(e:MouseEvent):void{

                                                if(ns.soundTransform.volume>0){

                                                var st:SoundTransform=ns.soundTransform;

                                                previousVolume=st.volume;

                                                st.volume=0;

                                                ns.soundTransform=st;

                                } else {

                                                st=ns.soundTransform;

                                                st.volume=previousVolume;

                                                ns.soundTransform=st;

                                }

                }

                public function onMetaData(eobj:Object): void {

                                // this needs to be in the scope of your loader

                }

                public function onPlayStatus(eObj: Object): void {

                }

                public function onXMPData(eobj:Object):void{

                }             

                }

}

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
Community Expert ,
Aug 01, 2013 Aug 01, 2013

disable your button after its clicked.  allowing it to be clicked more than once serves no purpose.

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
Explorer ,
Aug 02, 2013 Aug 02, 2013

sorry to say, how i can disable this button after 1st click?

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
Community Expert ,
Aug 02, 2013 Aug 02, 2013

package {

    import flash.display.SimpleButton;

    import flash.events.MouseEvent;

    import flash.media.Video;

    import flash.net.NetConnection;

    import flash.net.NetStream;

    import flash.media.SoundTransform;

    import flash.display.MovieClip;

    public class clickbutton extends SimpleButton {

                var ns:NetStream;

        var previousVolume:Number = 1;

                public function clickbutton() {

                this.addEventListener(MouseEvent.CLICK, clickF);

            }

                                private function clickF(e:MouseEvent):void{

this.removeEventListener(MouseEvent.CLICK, clickF);

this.parent.removeChild(this);

                                                MovieClip(root).flv_pb;

                MovieClip(root).flv_pb_parent;

                var nc:NetConnection=new NetConnection();

                nc.connect(null);

                ns=new NetStream(nc);

                var video:Video=new Video(320, 200);

                video.x=(stage.stageWidth-320)/2;

                video.y=(stage.stageHeight-200)/2;

                ns.client=this;

                this.parent.addChild(video);

                video.attachNetStream(ns);

                ns.play("video_test.flv");

                controlsF();

                                }

                                private function controlsF():void{

                                                MovieClip(root).play_btn.addEventListener(MouseEvent.CLICK,playF);

                                                   MovieClip(root).pause_btn.addEventListener(MouseEvent.CLICK,pauseF);

                                                   MovieClip(root).muteToggle_btn.addEventListener(MouseEvent.CLICK,mute F);

                                                    // add volume listener here.  you'll need to decide how you want to control volume.

                                }                            

                                function playF(e:MouseEvent):void{

                                                ns.resume();

                                }

                                function pauseF(e:MouseEvent):void{

                                                ns.pause();

                                }

                                function muteF(e:MouseEvent):void{

                                                if(ns.soundTransform.volume>0){

                                                var st:SoundTransform=ns.soundTransform;

                                                previousVolume=st.volume;

                                                st.volume=0;

                                                ns.soundTransform=st;

                                } else {

                                                st=ns.soundTransform;

                                                st.volume=previousVolume;

                                                ns.soundTransform=st;

                                }

                }

                public function onMetaData(eobj:Object): void {

                                // this needs to be in the scope of your loader

                }

                public function onPlayStatus(eObj: Object): void {

                }

                public function onXMPData(eobj:Object):void{

                }             

                }

}

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
Explorer ,
Aug 02, 2013 Aug 02, 2013

I try this its working. but one question. When movie is finished how we can reply the movie?

23.jpg

package {

    import flash.display.SimpleButton;

    import flash.events.MouseEvent;

    import flash.media.Video;

    import flash.net.NetConnection;

    import flash.net.NetStream;

    import flash.media.SoundTransform;

    import flash.display.MovieClip;

    public class clickbutton extends SimpleButton {

                var ns:NetStream;

                var previousVolume:Number = 1;

                public function clickbutton() {

                this.addEventListener(MouseEvent.CLICK, clickF);

            }

                                private function clickF(e:MouseEvent):void{

                                                MovieClip(root).flv_pb;

                MovieClip(root).flv_pb_parent;

                var nc:NetConnection=new NetConnection();

                nc.connect(null);

                ns=new NetStream(nc);

                var video:Video=new Video(320, 200);

                video.x=(stage.stageWidth-320)/2;

                video.y=(stage.stageHeight-200)/2;

                ns.client=this;

                this.parent.addChild(video);

                video.attachNetStream(ns);

                ns.play("video_test.flv");

                controlsF();

                this.removeEventListener(MouseEvent.CLICK, clickF);

                this.parent.removeChild(this);

                                }

                                private function controlsF():void{

                                                MovieClip(root).play_btn.addEventListener(MouseEvent.CLICK,playF);

                                                   MovieClip(root).pause_btn.addEventListener(MouseEvent.CLICK,pauseF);

                                                   MovieClip(root).muteToggle_btn.addEventListener(MouseEvent.CLICK,muteF);

                                                    // add volume listener here.  you'll need to decide how you want to control volume.

                                }                           

                                function playF(e:MouseEvent):void{

                                                ns.resume();

                                }

                                function pauseF(e:MouseEvent):void{

                                                ns.pause();

                                }

                                function muteF(e:MouseEvent):void{

                                                if(ns.soundTransform.volume>0){

                                                var st:SoundTransform=ns.soundTransform;

                                                previousVolume=st.volume;

                                                st.volume=0;

                                                ns.soundTransform=st;

                                } else {

                                                st=ns.soundTransform;

                                                st.volume=previousVolume;

                                                ns.soundTransform=st;

                                }

                }

                public function onMetaData(eobj:Object): void {

                                // this needs to be in the scope of your loader

                }

                public function onPlayStatus(eObj: Object): void {

                }

                public function onXMPData(eobj:Object):void{

                }            

                }

}

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
Explorer ,
Aug 05, 2013 Aug 05, 2013

any idea how we can reply the movie after its finished??

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
Community Expert ,
Aug 06, 2013 Aug 06, 2013

this thread is too long. 

it looks like your original question was answered and is now being followed by a sequence of questions that make me feel as if i'm doing your project for you.  that's ok if you want to hire me, but for free help this is going far beyond my limit for a single thread.

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
Explorer ,
Aug 06, 2013 Aug 06, 2013
LATEST

I am working on one project where I have to use the video with controls. I try from my side but facing some problem with FLVplayback component. Plz this is the last step (how to reply the movie) help me plz…… I am very thanks full for you. You help me lot of thinks

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