Go Back  HTML Forums - Free Webmaster Forums and Help Forums > WEBSITE DEVELOPMENT > Flash Development
User Name:
Password:
 

Reply
Thread Tools   Display Modes
  View First Unread
 
Old 07-25-2008, 03:32 PM
  #1
STOMPFROG
Myrmidon (Level 12)
 
Join Date: Jan 2005
Posts: 184
iTrader: (0)
STOMPFROG is on a distinguished road
Looping an flv using NetStream

Hi,

I am trying to get an external flv file to loop but cant get it to work.

My code is...

Code:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachNetStream(ns);
ns.play("flv_file.flv");
This is working fine but I want the flv clip to loop. I have done some searching and have found several solutions which depend on listening for a NetStream.Play.Stop event but whenever i try to access this info I get errors.

Using the code...

Code:
ns.onStatus = function(info){
	trace("info="+info.code);
	if (info.code == "NetStream.Play.Stop") {
		ns.seek(0)
		ns.play("flv_file.flv");
	}
}
I get the error...

1178: Attempted access of inaccessible property onStatus through a reference with static type flash.net:NetStream.

I am publishing the movie with flash 9 and AS3 from CS3.

Thanks
STOMPFROG is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 07-26-2008, 04:16 AM
  #2
STOMPFROG
Myrmidon (Level 12)
 
Join Date: Jan 2005
Posts: 184
iTrader: (0)
STOMPFROG is on a distinguished road
Just switched it to AS2 and it seems to be working... sort of :SGetting the following trace...
Code:
info=NetStream.Play.Start
info=NetStream.Buffer.Full
info=NetStream.Buffer.Flush
info=NetStream.Buffer.Flush
info=NetStream.Buffer.Flush
info=NetStream.Play.Stop
info=NetStream.Play.Start
info=NetStream.Buffer.Full
info=NetStream.Buffer.Empty
info=NetStream.Buffer.Full
info=NetStream.Buffer.Flush
info=NetStream.Buffer.Flush
info=NetStream.Buffer.Flush
info=NetStream.Play.Stop
info=NetStream.Play.Start
info=NetStream.Buffer.Full
This looks promising, but although i am getting a trace saying this stuff is looping I can no longer see the video clip in my published movie. Any ideas?
STOMPFROG is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Old 07-26-2008, 04:48 AM
  #3
STOMPFROG
Myrmidon (Level 12)
 
Join Date: Jan 2005
Posts: 184
iTrader: (0)
STOMPFROG is on a distinguished road
Got this working in the end with AS2 and the following code
Code:
// Create a NetConnection object 
var netConn:NetConnection = new NetConnection(); 
// Create a local streaming connection 
netConn.connect(null); 
// Create a NetStream object and define an onStatus() function 
var netStream:NetStream = new NetStream(netConn); 

netStream.onStatus = function(info){
	trace("info="+info.code);
	if (info.code == "NetStream.Play.Stop") {
		netStream.seek(0)
		netStream.play("flv_file.flv");
	}
}
// Attach the NetStream video feed to the Video object 
my_video.attachVideo(netStream); 
// Set the buffer time 
netStream.setBufferTime(5); 
// Begin playing the FLV file 
netStream.play("flv_file.flv");
Hope someone finds it useful one day
STOMPFROG is offline   Add to del.icio.us Add to del.icio.us    Can you digg it?Can you digg it? Reply With Quote
Reply
« Previous Thread | Next Thread »


 
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
  
 
 
 



 
  POSTING RULES
 
 
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Thread Tools
Display Modes

Forum Jump

 

All times are GMT -5. The time now is 09:45 PM.

   

Mascot team created by Drawshop.com

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.

Server Monitoring by ENIACmonitor 0.01
HTMLforums.com © Big Resources, Inc. Web Design by BoxedArt.com
vRewrite 1.5 beta SEOed URLs completed by Tech Help Forum and Chalo Na.