[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Actionscript FLV inside of swf

Posted on 2008-11-04
6
Medium Priority
?
1,157 Views
Last Modified: 2013-11-11
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

0
Comment
Question by:cntmedia
  • 3
  • 3
6 Comments
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 22882943
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
 

Author Comment

by:cntmedia
ID: 22882984
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
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 22883033
I am sure on it that embed video as library item, can't be controlled through actionscript..
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:cntmedia
ID: 22883082
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
 
LVL 34

Expert Comment

by:Aneesh Chopra
ID: 22883105
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
 

Accepted Solution

by:
cntmedia earned 0 total points
ID: 22900003
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

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question