Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > Flash Media Server

Reply
 
Thread Tools Rate Thread Display Modes
Old 06-11-2004, 11:25 AM   #1
Navarone
Don
 
Navarone's Avatar
 
Join Date: Feb 2003
Location: Akron, Ohio USA
Posts: 1,897
Default video Object and NetStream Help

I am trying to get my flv to play in my video object. So I have been following the Help files and I must not be doing something correct cause nothing is playing.

I added a new video object to my Library and renamed it "my_video" . I then draged it to the stage, set the size properties I needed 320x240 and gave it an instance name of "my_video". Then I attached this code straight from the Help file and changed the file name to play my flv.

PHP Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var 
ns:NetStream = new NetStream(my_nc);
my_video.attachVideo(ns); // my_video is a Video object on the Stage
ns.play("Videos\Intro.flv"); 
When I test the movie in flash I don't see my video. I also published my flash project and tried playing the swf file but it still doesn't work.

What am I doing wrong?
__________________
Damn the torpedoes! Full speed ahead.

Last edited by CyanBlue; 06-11-2004 at 11:31 AM.. Reason: PHP tag is applied
Navarone is offline   Reply With Quote
Old 06-11-2004, 11:49 AM   #2
chrisgannon
Registered User
 
Join Date: May 2004
Posts: 14
Default Macromedia's mistake

You simply need to change the line:

var ns:NetStream = new NetStream(my_nc);

to

var ns:NetStream = new NetStream(nc);

It's a known error in the help.
chrisgannon is offline   Reply With Quote
Old 06-11-2004, 11:57 AM   #3
Navarone
Don
 
Navarone's Avatar
 
Join Date: Feb 2003
Location: Akron, Ohio USA
Posts: 1,897
Default

Ok, I changed that per your suggestion, but I still don't see my video.

PHP Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var 
ns:NetStream = new NetStream(nc);
my_video.attachVideo(ns); // my_video is a Video object on the Stage
ns.play("Videos\Intro.flv"); 
[EDIT]Hey, Navarone... AS tag is offline... Please use PHP tag instead... Thank you...[/EDIT]
__________________
Damn the torpedoes! Full speed ahead.

Last edited by CyanBlue; 06-11-2004 at 12:01 PM.. Reason: PHP tag is applied
Navarone is offline   Reply With Quote
Old 06-11-2004, 02:46 PM   #4
Navarone
Don
 
Navarone's Avatar
 
Join Date: Feb 2003
Location: Akron, Ohio USA
Posts: 1,897
Default

Ok, thanks for the tip.

I read thru the help files and got things to work. However, I want to use the media controller and I don't think I understand how to link the controller to my_video.

I would use the Media Playback component, but I don't see anywhere how to adjust the size of the component. If I change the property values, it defaults back to the component's original size.

---

Oh... never mind. I think I figured that out too!
__________________
Damn the torpedoes! Full speed ahead.

Last edited by Navarone; 06-11-2004 at 02:48 PM..
Navarone is offline   Reply With Quote
Old 06-17-2004, 05:43 AM   #5
chrisgannon
Registered User
 
Join Date: May 2004
Posts: 14
Default

I have found that changing the AS 2.0-specific syntax from:

ActionScript Code:
var nc:NetConnection = new NetConnection(); nc.connect(null); var ns:NetStream = new NetStream(nc); my_video.attachVideo(ns); // my_video is a Video object on the Stage ns.play("Videos\Intro.flv");

to

ActionScript Code:
nc= new NetConnection(); nc.connect(null); ns = new NetStream(nc); my_video.attachVideo(ns); // my_video is a Video object on the Stage ns.play("Videos\Intro.flv");

makes it alot more stable - the var declaration along with the object type (:NetStream) seems to make it fail sometimes
chrisgannon is offline   Reply With Quote
Old 07-15-2004, 11:14 PM   #6
oka_
bleh.
 
oka_'s Avatar
 
Join Date: Jun 2004
Location: melbourne.aust
Posts: 303
Default

Also you might want to try using the line

ns.play("Videos\\Intro.flv");

Being able to actually find the file helps

-oka
oka_ is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:53 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.