[Papervision3D] changes to VideoStreamMaterials?

AngelicD raul.companioni at gmail.com
Mon Sep 22 11:39:25 PDT 2008


Hey, i just run into the same problem, this is how i got it to work...

The basic thing is that i had to wait for the net connection to be ready
before i did the stream stuff, hope it helps.

public function load():void
{
   _connection = new NetConnection();
   _connection.addEventListener(NetStatusEvent.NET_STATUS, netConHandler);       
   _connection.connect(null);
}
		
public function netConHandler(event:flash.events.Event):void
{			
  _stream = new NetStream(_connection);
  _stream.addEventListener(NetStatusEvent.NET_STATUS, streamHandler);
  _stream.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
securityErrorHandler);
  _stream.checkPolicyFile = true;
  _stream.play(uri);
  _stream.client = new Object();
  _video = new flash.media.Video();
  _video.smoothing = true;
  _video.width = 640;
  _video.height = 480;
  _video.attachNetStream(_stream);	        
	        
  _material = new VideoStreamMaterial(_video, _stream);
  _material.doubleSided = false;
  _material.animated = true;
  _material.interactive = true;
}
		
public function streamHandler(event:flash.events.Event):void
{
			
}
		
public function securityErrorHandler(event:flash.events.Event):void
{
			
}


DJC wrote:
> 
> when I switched to PV3D 2.0 Beta 1 (from GW) my VideoStreamMaterials went
> dark.
> 
> Here's a snippet that was working:
> 
> var video:Video = new Video(w, h);
> stream = getStream();
> stream.addEventListener(NetStatusEvent.NET_STATUS, loadFlvHandler);
> stream.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
> securityErrorHandler);
> video.attachNetStream(stream);
> stream.play(_url);
> mat = new VideoStreamMaterial(video, stream) as BitmapMaterial;
> 
> ideas?
> 
> ty, DJC
> 

-- 
View this message in context: http://www.nabble.com/changes-to-VideoStreamMaterials--tp19567272p19613981.html
Sent from the Papervision3D mailing list archive at Nabble.com.




More information about the Papervision3D mailing list