FORUMS: list search recent posts

Removing .FLV after play

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
David Tunnell
Removing .FLV after play
on Feb 8, 2009 at 3:05:57 pm

Hello all.

I am a flash novice.

Here is my situation.

I have created some vids as .flv files and I want to play them in a flash file as an external .flv file. The video plays overlaid on and HTML page. While the vid is playing the underlying HTML, menus, etc is not accessible. Once the video plays I need it to unload and go away so the underlying HTML is again available.

I have searched for info and tuts and have pulled my hair out trying to figure this out.


Here is a sample of one of the vids http://www.tunnellvision.net/flashsample/home.zip

Thanks,

David Tunnell
Tunnell Vision Productions


Return to posts index

David Tunnell
Re: Removing .FLV after play
on Feb 8, 2009 at 4:11:08 pm

OK .... I found this code:

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.onStatus = function(info) {
if (info.code == "NetStream.Buffer.Empty") {
theVideo.clear();
}
};
ns.setBufferTime(5);
ns.play("vicki.flv");


When I test it in Flash it works, but if I upload it, the vid plays but does not unload at the end???

Any clues????



Thanks,

David Tunnell
Tunnell Vision Productions


Return to posts index

Christian Aanderud
Re: Removing .FLV after play
on Nov 4, 2009 at 6:41:47 pm

i feel your pain, i really do. i've been trying to figure this out for soooooooooo long...

instead of theVideo.clear(); try using theVideo.unloadMovie(); if that works, great. if not, add this


if (info.code == "NetStream.Buffer.Empty") {
ns.close();
nc.close();
vid1.unloadMovie();
}

and that should get rid of your movie....


Return to posts index


Ed Hart
Re: Removing .FLV after play
on Nov 14, 2010 at 11:02:05 pm

Did this situation ever get figured out? I'm having the same issue as best as I can tell... I have a walk-on video that I want to disappear from the HTML page after the spokesperson gives his pitch. Right now the video just sits there on the page. I see the code, but where did you use it? In a .js file or somewhere else? Thanks!
Ed


Return to posts index

David Tunnell
Re: Removing .FLV after play
on Nov 15, 2010 at 3:13:10 pm

I figured out a way to remove the movie using AS2 (never got it to workd with AS3 using the following code on frame one of a layer called "actions":

var my_nc:NetConnection = new NetConnection();
my_nc.connect(null);
var my_ns:NetStream = new NetStream(my_nc);
my_video.attachVideo(my_ns);
my_ns.setBufferTime(05);
my_ns.play("mymovie.flv");
my_ns.onStatus = function(info) {
if (info.code == "NetStream.Buffer.Empty") {
unloadMovieNum(0)
//my_video.clear();
}
};


I found that the .swf, .flv, and the AC_RunActiveContent.js must all reside in the same folder.

Thanks,

David Tunnell
TunnellVision Productions


Return to posts index

Ed Hart
Re: Removing .FLV after play
on Nov 15, 2010 at 4:27:26 pm

Thanks for responing.

Since my player was created through Dreamweaver when I inserted the video, I didn't actually create the player in Flash. DW created a JavaScript file called swfobject.js, but I don't have a AC_RunActiveContent.js anywhere.

The files I have are:
the index.html file (I'm trying to make this work on a plain text html file before I get to designing something).

Clear_Skin_1.swf file... I believe that's the player created by DW.

A Scripts folder containing swfobject.js & expressInstall.swf. I can't make much out of the swfobject.js file since I don't know much about programming.

Where exactly did you insert that code?


Return to posts index


David Tunnell
Re: Removing .FLV after play
on Nov 15, 2010 at 4:32:34 pm

I created the .flv in After Effects and the player in Flash CS3, then outputted the files and embedded the .swf file in my HTL using dreamweaver. I do not know any way for you to remove the move from your page using just Dreamweaver. That does not mean it does not exist, only that I do not know about it. That might be a question for the Dreamweaver Forum.

Thanks,

David Tunnell
TunnellVision Productions


Return to posts index

Ed Hart
Re: Removing .FLV after play
on Nov 15, 2010 at 5:00:58 pm

My process was... created the video in FCP. Converted to flv with Adobe Media Encoder (with the alpha channel) and then embedded the flv with dreamweaver by just selecting Insert>Media>FLV and then used the dialogue box. I did have to go back in and put the object in
tags to get it to float over the site.

I can get into the .js file, but since DW created the player, I'm not sure how to even get to the AS code that makes the player work. I can see the .swf file (it's called Clear_Skin_1.swf), but when I try to open that in Flash, I get a box that opens and looks for a FLA file. So I'm lost on what to do with that code.

How did you create your player? Is there a good and fairly simple resource that you can point me to on how to create a player? Maybe if I go that route, I can implement your solution.

Thanks again.
Ed


Return to posts index

David Tunnell
Re: Removing .FLV after play
on Nov 15, 2010 at 6:05:41 pm

If you use Flash CS3 and create a project the same size as your .flv movie then choose "file/import/import to Stage" then follow the instructions choosing Progressive download from webserver .... then follow the instructions it will create the player.

Then create a new layer called actions .... apply the cose I provided to the first frame and change the name of the mymovie.flv to the name of your move and it should work. It has been a while but I think that is all I did.

Thanks,

David Tunnell
TunnellVision Productions


Return to posts index


demetri tashie
Re: Removing .FLV after play
on Nov 16, 2010 at 1:03:25 am

here is how i would do it via AS3. you use a combination of AS3 in your swf, and javascript in your html

you use the VideoEvent of the Video class to detect when video has finished.
that will trigger an ExternalInterface call which goes outside the swf and triggers a javascript function in the html which just changes the display property of the div that the swf is in to 'none'.

if you are doing green screen/alpha chanel stuff in your video, of course the swf's wmode has to be set to transparent in the html code too.

here is the code at its simplest:

in flash:
import flash.external.ExternalInterface;
import fl.video.VideoEvent;

function closeDiv(e:VideoEvent):void{
ExternalInterface.call("closesDiv");
}

flvPlayer.source="myFLV.flv";
flvPlayer.addEventListener(VideoEvent.COMPLETE, closeDiv);


and in the html:
the swf is placed inside a div with the id "swf". this code goes in the head:

<script type="text/javascript" >
function closesDiv(){
document.getElementById("swf").style.display="none";
}
</script >


hope that helps. it's worked for me in the past.

David - does your code actually remove the video from the html page? or as i assume, just from the swf ?


Return to posts index

David Tunnell
Re: Removing .FLV after play
on Nov 16, 2010 at 2:27:30 pm

As I mentioned when I began this thread I am a Flash Novice and still am.

The code I provided was used for Walkout video's overlayed on a page, the original problem was that before I used this code,the movie blocked underlying page elements like menu's and other links.

After applying the code, it did indeed remove the entire movie .swf and .flv from the page and all underlying page elements were once again useable. I am now intrigued to try your AS3 solution.

Thanks,

David Tunnell
TunnellVision Productions


Return to posts index

Ricky Squires
Re: Removing .FLV after play
on Feb 4, 2011 at 12:06:51 pm

David
I have hunted high and low for this solution and it is spot on. I've tried all sorts of AS3 code until it was driving me mad. I've just had to sign up to CC just to say BIG TA 2 U!!!

Ahhh!! the return of sanity (whatever that is) at last (:~)

All The Best


Return to posts index


Ricky Squires
Re: Removing .FLV after play
on Feb 4, 2011 at 12:12:26 pm

Demitri (Sotty I sent this to David by mistake)
I have hunted high and low for this solution and it is spot on. I've tried all sorts of AS3 code until it was driving me mad. I've just had to sign up to CC just to say BIG TA 2 U!!!

Ahhh!! the return of sanity (whatever that is) at last (:~)

All The Best


Return to posts index

demetri tashie
Re: Removing .FLV after play
on Feb 5, 2011 at 1:37:05 pm

hi ricky, thanks for taking the time to write.

i'm glad you have stopped going mad !

welcome to Creative Cow .


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]