FORUMS: list search recent posts

Unloading FLV Files

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
David Tunnell
Unloading FLV Files
on Jan 26, 2009 at 7:12:51 pm

I am a flash and AS beginner. I have used AS2 a little but not AS3.

I need to have a Flash movie play an external .flv file then after the .flv completes playing, unload the entire movie. I also need a stop button that unloads the entire movie.

I can easily get the stop button to work in AS2, but I have no idea how to get the move to unload after the .flv finishes.

I have searched all over and there seems to be little info on this.

Thank you

Thanks,

David Tunnell
Tunnell Vision Productions


Return to posts index

Michael Gossen
Re: Unloading FLV Files
on Jan 26, 2009 at 8:47:27 pm

I think the onStatus method of the NetStream class is your answer. I think the 'unload' method is NetStream.close();. Hope this helps.

NetStream.onStatus = function(info) {
if(info.code == "NetStream.Play.Stop") {
whateverYouWantToDo;
}


Michael Gossen

Helium Digital Media


Return to posts index

David Tunnell
Re: Unloading FLV Files
on Jan 26, 2009 at 9:03:50 pm

Petend you are Einstein helping a 3rd grader! :-)

NetStream.onStatus = function(info) {
if(info.code == "NetStream.Play.Stop") {
whateverYouWantToDo;
}

Would "whateverYouWantToDo" be the unload command? Would that code be put in the AS layer of th main part of the movie?

Thanks,

David Tunnell
Tunnell Vision Productions


Return to posts index


Michael Gossen
Re: Unloading FLV Files
on Jan 26, 2009 at 9:18:08 pm

I guess it depends on what exactly you want to happen. If you want to leave the NetStream open for another video to play, then you can use the NetStream.close(); method and then play another video the same way you did before, probably, NetStream.play(); If you want it to permantley stop and unload everything from the movie, then you would also want to close the NetConnection. I did find another method for the onStatus event called complete, which I guess is more applicable.

NetStream.onStatus = function(info) {
if(info.code == "NetStream.Play.Complete") {
NetStream.close();
NetConnection.close();
movieClipInstanceName.unloadMovie();
}


Michael Gossen

Helium Digital Media


Return to posts index

David Tunnell
Re: Unloading FLV Files
on Jan 27, 2009 at 2:55:16 pm

Does that code depend on some server function?

Thanks,

David Tunnell
Tunnell Vision Productions


Return to posts index

Michael Gossen
Re: Unloading FLV Files
on Jan 27, 2009 at 7:14:16 pm

A great site that really goes through the basics of FLV players is Lee Brimelow's gotoandlearn.com. Otherwise, you can try to post your code to see if we can help.

Michael Gossen

Helium Digital Media


Return to posts index


David Tunnell
Re: Unloading FLV Files
on Jan 27, 2009 at 7:38:11 pm

I don't have any code? :-) Except what you sent. I will have to study up.

Dave

Thanks,

David Tunnell
Tunnell Vision Productions


Return to posts index

David Tunnell
Re: Unloading FLV Files
on Feb 3, 2009 at 9:28:00 pm

Let me try this again cause the web developer had no luck with the Java script.

Lets say you have a banner add that uses flash and expands out over the html, plays an .flv then at the end of the .flv the player shrinks back to it's original size.

1 - How did they expand the player
2 - How does the .swf know that the .flv completed playing and unload it?
3 - How did they get rid of the player (.swf) overlay?

If I can figure this out then I can figure out how to get rid of these walk-out vids after they play.

Dave

Thanks,

David Tunnell
Tunnell Vision Productions


Return to posts index

Michael Gossen
Re: Unloading FLV Files
on Jan 27, 2009 at 8:01:27 pm

Sorry about that, I guess because I saw this - [David Tunnell] "I can easily get the stop button to work in AS2, but I have no idea how to get the move to unload after the .flv finishes." I figured you were controlling the FLV via actionscript. So haw are you playing the FLV? With a video component?

And when you say movie, do you mean the FLV or the SWF movie?

That site is still a great resource for beginners, I learned a ton there back in the day.

Michael Gossen

Helium Digital Media


Return to posts index


David Tunnell
Re: Unloading FLV Files
on Jan 27, 2009 at 9:31:04 pm

I simply import the .flv file into flash and it plays. Then using simple AS2 I can create a button and use the Behaviors panel to add an unload movie command to the button.

The problem arises when you want Flash to unload the both the .flv and the .swf after the .flv finishes. The finishes animation will be overlayed over an html page (Like a drop down ad or walkout video.) If the .swf does not unload, then it blocks access to the underlying navigation buttons on the HTML.

I think if I understood AS3 better an event listener would do th trick. Problem is I don't have time to learn AS3 before I ahev to get this finished.

Here is one of the projects http://www.tunnellvision.net/flashsample/home.zip



Thanks,

David Tunnell
Tunnell Vision Productions


Return to posts index

Michael Gossen
Re: Unloading FLV Files
on Jan 28, 2009 at 1:42:22 am

I think I see what you want. You are trying to unload the swf from the html page? I don't know if flash can unload itself from the html alone. I think you are getting into something else here. You can do this with Javascript, with CSS, with iframes maybe.

EventListeners are present in AS2 as well. To some extent, what I gave you before. But the work you do there would still have to pass to something else that controls the HTML, ie javascript. My first thought would be to hide a DIV after a period of time, then it is automatic. I didn't really look through these tutorials thoroughly:

http://www.adesdesign.net/php/tutorials/css/hide_div_layer_after_x_seconds....
http://www.netlobo.com/div_hiding.html

Unfortunately, I think there is a lot you are missing here, not just a simple line of actionscript. I wish I could have been of more help. Good luck.

Michael Gossen

Helium Digital Media


Return to posts index

David Tunnell
Re: Unloading FLV Files
on Jan 28, 2009 at 1:52:24 am

Let me check with the website developer and see if he can do it with Java.

I appreciate your help .... I will get back to you on this.

Thanks,

David Tunnell
Tunnell Vision Productions


Return to posts index

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