Topic: Possible to play external .mov file in flash movie? (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=30252" title="Pages that link to Topic: Possible to play external .mov file in flash movie? (Page 1 of 1)" rel="nofollow" >Topic: Possible to play external .mov file in flash movie? <span class="small">(Page 1 of 1)</span>\

 
WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 05-07-2008 00:21

I have a bunch of different .mov files at the same level as my flash movie. I would like to be able to play these files from some area within the flash movie, with some buttons to move between the videos.

It seems like you can embed the movie files now, but I am not sure how to play one without launching quicktime as a separate application.

Is this at all possible?

Thanks,
Dan

Dan
Code Town | Zombie Head | How Much TP? | Feed The Blob

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 05-07-2008 13:07

Turns out that yes it is possible.

1. Create a new movie
2. In the library create a new Video, set the type to action script controlled.
3. Drag the video object to the stage and give it a name
4. Open the actions menu and put in the following:

code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
myVideo.attachNetStream(ns);

var listener :Object = new Object();
listener.onMetaData = function (md:Object):void{};
ns.client = listener;

ns.play("Sample.mov");



5. Test and watch your movie.

Thanks go to the following tutorial, which I abbreviated above:
http://www.communitymx.com/content/article.cfm?cid=5CAB4

Dan
Code Town | Zombie Head | How Much TP? | Feed The Blob

(Edited by WarMage on 05-07-2008 13:21)

QuarterLid
Obsessive-Compulsive (I) Inmate

From:
Insane since: May 2008

posted posted 05-31-2008 17:57

Thanks for the post. I wasn't able to get it to work. Followed all instructions. Only changes: "Sample.mov" -> match name of QT I used and the size of the video player to match. No errors when publishing, the page loads in Safari, but the video does not appear or play.

Any trouble-shooting advice?

Thanks in advance

johnalbu
Nervous Wreck (II) Inmate

From: San Clemente, CA
Insane since: Sep 2008

posted posted 09-19-2008 18:13

Hi Dan the code below works in Action Script 2.0.
What is and where in this code to add a pause/play, seeker, and volume componets code?

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
myVideo.attachNetStream(ns);

ns.play("Sample.mov");


Thanks in advance.

Thanks to all you nuts!

buzcajun
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Apr 2009

posted posted 04-30-2009 15:25

Thanks for the code, works great, but I have two questions.

1. How do you unload or stop NetConnection? My video keeps playing

2. Is there a way to have an event listener to tell when the video stops?

Thanks
Garrett

buzcajun
Obsessive-Compulsive (I) Inmate

From:
Insane since: Apr 2009

posted posted 04-30-2009 16:10

FYI: this is what I found that works:

// code to stop movie
ns.addEventListener(NetStatusEvent.NET_STATUS, ns_onPlayStatus)

function ns_onPlayStatus(event:NetStatusEvent):void {
if (event.info.code == "NetStream.Play.Stop") {
ns.close();
gotoAndPlay("load_bkgd");
trace("now what?")
}
}

buzcajun
Obsessive-Compulsive (I) Inmate

From:
Insane since: Apr 2009

posted posted 11-16-2009 22:25

Quick question on this code.

Can I add play pause stop and volume to this mov player?

reisio
Paranoid (IV) Inmate

From: Florida
Insane since: Mar 2005

posted posted 11-16-2009 23:49

Just use Flowplayer.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu