FORUMS: list search recent posts

as3 custom flv player question

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Eddy Rose
as3 custom flv player question
on Jan 24, 2010 at 3:49:12 am

hi all,

so I'm a little wet behind the ears when it comes to as3 and haven't had much luck finding any in depth help/tutorials on how to make a custom flv player. In fact, I can't even get my flv file working to begin with (T_T)".

The script I'm working from is the one made by Lee Brimelow,, as seen here http://theflashblog.com/?p=233


var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);

var vid:Video = new Video(320, 240);
this.addChild(vid);

vid.attachNetStream(ns);

ns.play(“EddyReel.flv”);

var netClient:Object = new Object();
netClient.onMetaData = function(meta:Object)
{
trace(meta.duration);
};
ns.client = netClient;

ns.addEventListener(NetStatusEvent.NET_STATUS, netstat);
function netstat(stats:NetStatusEvent)
{
trace(stats.info.code);
};




The problem I'm having is a sytax error on this line
ns.play(“EddyReel.flv”);

EddyReel is the name of my movie, it's located in the same folder as my flash file. So far every script I've looked up has at least one section where they have you put in just the name and file extension of your movie. What I'm wondering, is how the hell flash is supposed to find it with just so little info. That's got to be the problem, I must be neglecting to set something up properly,, but I have no idea what it is!

Any help would be SO appreciated,
does anyone know where to find some good instructional videos on flv players? like the Lee Brimelow ones (only for as3)




Return to posts index

Mike Smith
Re: as3 custom flv player question
on Jan 25, 2010 at 10:40:07 am

Hey there

It looks like your play command should work. Of course you've checked there are no typos - all capitals, random spaces at the end of the file name, nothing like that ..?

Relative paths - are the html, the swf file and the video all in the same folder ...?

http://www.longtailvideo.com/support/forum/Setup-Problems/11284/FLV-Relativ...
http://board.flashkit.com/board/showthread.php?t=782174

AS3 - tutorial at
http://library.creativecow.net/articles/ross_tony/Simple_Multi-VideoPlayer_...
http://www.thetechlabs.com/tutorials/audionvideo/how-to-build-a-as3-videopl...

http://www.lemlinh.com/as3-video-player-tutorials-roundup/


Return to posts index

Eddy Rose
Re: as3 custom flv player question
on Jan 25, 2010 at 9:36:22 pm

okay,, for some reason it works when i put the code in to the main timeline.

But it doesn't work if i put the code in an MC then drag that to the main timeline.

WHYYYYY!??


Return to posts index


Mike Smith
Re: as3 custom flv player question
on Jan 26, 2010 at 8:51:39 am

Might you need to be careful with the paths / relative paths ..? If you set and called all your new variables as from root, would that work, or has that changed in AS3 ...?

http://www.narkeeso.com/flash/flash-cs3-root-timeline-control-within-movie-...
http://www.flashbible.com/members/TellTarget/Paths.htm
http://www.actionscript.org/forums/showthread.php3?t=220440
http://www.communitymx.com/content/article.cfm?cid=C1379
http://www.swinburne.edu.au/design/tutorials/P-flash/T-Flash-Paths-102/ID-9...

p.s. some people think it's a good idea to keep all code in one place, in one frame on its own layer on the main timeline - that way you can see everything all at once, and more easily debug whatever is going wrong, or make later mods. A bit more work at the outset perhaps to set all paths to everything, but on anything but a very simple project perhaps worth the time invested!


Return to posts index

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