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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
Aneesh ChopraCommented:
I am sure on it that embed video as library item, can't be controlled through actionscript..
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

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
cntmediaAuthor 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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.