Copy link to clipboard
Copied
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


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");
Copy link to clipboard
Copied
got the same output error

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{
}
}
Copy link to clipboard
Copied
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{
}
Copy link to clipboard
Copied
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).

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{
}
}
}
Copy link to clipboard
Copied
disable your button after its clicked. allowing it to be clicked more than once serves no purpose.
Copy link to clipboard
Copied
sorry to say, how i can disable this button after 1st click?
Copy link to clipboard
Copied
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{
}
}
}
Copy link to clipboard
Copied
I try this its working. but one question. When movie is finished how we can reply the movie?

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{
}
}
}
Copy link to clipboard
Copied
any idea how we can reply the movie after its finished??
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more