playing video messes up when done.
hello everyone,
i'm trying play opening animation in flash movie before move on interactive stuff. have tried in 2 ways.
the first way:
my movie 2 frames. in first frame on timeline, have movieclip has video object in on stage. add code to play video in , go frame 2 there movieclip linked external class of rest of code in it:
//////////////////////////////////////
stop();
var nc:netconnection = new netconnection();
nc.connect(null);
var ns:netstream = new netstream(nc);
movieholder.video.attachvideo(ns);
movieholder.video._width = 800;
movieholder.video._height = 600;
ns.onstatus = function(e:object):void {
if(e.code == "netstream.play.stop") {
trace("video done playing");
_root.gotoandstop(2);
}
}
ns.play("cut_scenes/opening_animation.flv");
////////////////////////////////////////////////////////
this plays video fine. problem once video done, trace statement works, weird error. popup box says "there no disk in drive. please insert disk drive \device\harddisk1\dr1"... heck mean???
my external class work because when on it's own in single frame works fine. video thing wanted add on it. second way it, in actual external class itself. movieclip associated class on frame one. inside class have this:
////////////////////////////////////////
public function main() {
playopeninganimation();
}
private function playopeninganimation():void {
//i have tried both _root.attachmovie , this.attachmovie. attaches movie video object inside of it.
//both movieholder , movieholder.video trace out fine, exist.
var movieholder:movieclip = _root.attachmovie("movieholder", "movieholder", getnexthighestdepth());
var nc:netconnection = new netconnection();
nc.connect(null);
var ns:netstream = new netstream(nc);
movieholder.video.attachvideo(ns);
ns.onstatus = function(e:object):void {
trace(e.code);
if(e.code == "netstream.play.stop") {
startgame();
}
}
ns.play("cut_scenes/opening_animation.flv");
}
///////////////////////////////////////
this 1 here doesnt play @ all, , no status codes @ in onstatus event listener.
i got 2nd way work finaly changing netconnectino , netstream variables class instance vars instead of local play function. same weird pop hard disk. ever see before? i've seen both in flash , in illustrator.
More discussions in ActionScript 1 and 2
adobe
Comments
Post a Comment