Actionscript FLV inside of swf

I am not really used to the NetStream class yet, but have a good working knowledge of AS2 and OOP for Flash.

I was messing around with flash and realized I can just load a FLV into a new FLA and save it as a SWF.

That way I can just keep on using the basic stuff (attach move, loadMovie, etc)

Some of the basic stuff works, but was wondering about any suggestions for controlling the Video from inside the SWF (loaded into another clip, of course)


/*
 
This is just some example code.
I keep everything inside an external Lib, or it's loaded inside a container from an external SWF.
 
As dynamic as possible and as clean coded as possible is what I aim to do.
*/
 
stop();
 
 
var container:MovieClip = createEmptyMovieClip("container", this.getNextHighestDepth() );
 
 
 
 
container.attachMovie("mc_videos", "mc_videos", this.getNextHighestDepth() );
 
container.mc_videos._x = 300;
container.mc_videos._y = 300;
 
container.mc_videos.onRollOver = function():Void
	{
		this.flv_walk.pause();
	};
 
/* The flv file is inside a clip called mc_videos
  I am wondering how else I can control the flv?
 
the following work...
 
stop();
play();
pause();
 
wondering what else would work.
 
 
 
*/

Open in new window

cntmediaAsked:
Who is Participating?
 
cntmediaConnect With a Mentor Author Commented:
Thanks, but your answer is exactly what I already stated in my opening question.

/* The flv file is inside a clip called mc_videos
  I am wondering how else I can control the flv?
 
the following work...
 
stop();
play();
pause();

///

What i am looking for is a way to extend the movieclip class to allow more functionality into a swf with video....

vs.

just using the netStream class to attach a new video with a no skin.
0
 
Aneesh ChopraCommented:
FLV imported in FLA as library Item can't be controlled through actionscript..

max you can do is, just create a movieClip, place FLV video in the movieClip timeline and add actions on movieClip frame to stop/play movieClip timeline on button press...

it is always better to use FLV as external resource and you will be able to control it in better way using actionscript..

here is few basic Flash video tutorials to start with:

visit http://www.gotoandlearn.com/
and scroll to the bottom for video tutorials


0
 
cntmediaAuthor Commented:
yeah, I am well aware of GotoAndLearn.

Great site.

But I still think there is someone out there who knows about import mx.video or extending the clip via a prototype to gain the same functionality inside of a swf.

Any one an expert on doing that?

0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Aneesh ChopraCommented:
I am sure on it that embed video as library item, can't be controlled through actionscript..
0
 
cntmediaAuthor Commented:
Any suggestions??

I know that this site ---> http://proto.layer51.com/

has extended prototypes for AS2 and AS3 classes.

------

I am guessing that I could extend the movieclip class by having the same function as a NetStream and NetConnection.

Or building a custom class...


0
 
Aneesh ChopraCommented:
here is a simle workaround, just copy following code on first frame of "mc_videos" movieClip,

now you can use "playVideo", "pauseVideo" & "stopVideo" method for play/pause/stop action
stop();
function playVideo() {
	this.play();
}
function pauseVideo() {
	this.stop();
}
function stopVideo() {
	this.gotoAndStop(1);
}

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.