I have a class that I use to create a video object on the stage and
play it, works really well except for if you use setInterval ANYWHERE
AT ALL it stops the video on the first interval whether you tell it
to or not and won't resume playing it till you clearInterval
Really don't understand - hope someone can help!!
Slightly simplified (but functional) code as follows:
[PLAYTEST.FLA]
import video.videoPlayer;
var vidvid:videoPlayer = new videoPlayer();
vidvid.attachRef = this;
vidvid.videoObject("viza", this.getNextHighestDepth(), "transcoding/
mrandmrssmith_624x336_700.flv", 10, true, 1, 50, 0, 0, 624, 336, 0);
vidvid.videoObject("ehlo", this.getNextHighestDepth(), "transcoding/
stargate.flv", 10, true, 1, 100, 200, 0, 624, 336, 45);
function poll() {
trace("hello world");
}
setInterval(poll, 5000);
[/PLAYTEST.FLA]
[CLASSES/VIDEO/VIDEOPLAYER.AS]
class video.videoPlayer{
var attachRef:MovieClip;
function videoPlayer(rootRef) {
trace("video.videoPlayer class loaded");
attachRef = rootRef
}
function videoObject(objectName, depth, url, buffer, smooth,
deblock, alpha, xpos, ypos, widt, heigh, rotation) {
trace("videoobjectcalled");
attachRef.createEmptyMovieClip(objectName, depth);
var loader = new MovieClipLoader();
loader.onLoadInit = function(targetMC) {
var netConn:NetConnection = new NetConnection();
netConn.connect(null);
var netStream:NetStream = new NetStream(netConn);
targetMC.videoObj.attachVideo(netStream);
netStream.setBufferTime(buffer);
targetMC.videoObj.smoothing = true;
targetMC.videoObj.deblocking = deblock;
targetMC.videoObj._alpha = alpha;
targetMC.videoObj._rotation = rotation;
targetMC.videoObj._x = xpos;
targetMC.videoObj._y = ypos;
targetMC.videoObj._width = widt;
targetMC.videoObj._height = heigh;
netStream.play(url);
};
loader.loadClip("videoObj.swf", objectName);
}
}
[/CLASSES/VIDEO/VIDEOPLAYER.AS]
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders