Sebastian,

You didn't include the timeline code, but I made some assumptions. I think
the most relevant issue is that your NetConnection and NetStream variables
are local and expire after the function is called. This works:

//in class PostView.as, in com/blabla/
class com.blabla.PostView extends MovieClip {
    
    private var _netConn:NetConnection;
    private var _netStream:NetStream;

      public function playVideo () {
            _netConn = new NetConnection();
            _netConn.connect(null);
            _netStream = new NetStream(_netConn);
            _netStream.onStatus = function (infoObject:Object) {
                 trace (infoObject.code);
            }

            _root.vid.attachVideo(_netStream);
            _netStream.play("video/video.flv");
      }

}

//in timeline
import com.blabla.PostView;

var myVar:PostView = new PostView();
myVar.playVideo();

//


I'm not a fan of classes without constructors, though. If you only included
a snippet, disregard. If not, you can unify the class and function name
above and omit the last line in the timeline. Or, even throw in a generic
constructor for clarity/possible info.

Rich Shupe


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to