Hi all! I’m generating a bunch of thumbnail videos that should have various mouse reactions. Since the Video class doesn’t dispatch mouse events I put the videos in sprite containers:
private function makeVideo(src:String):void {
videos.push(new Object);
var this_index:uint = videos.length - 1;
var this_container:Sprite = videos[this_index].video = new Sprite();
var this_stream:NetStream = videos[this_index].stream = new NetStream(connection);
this_stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
this_stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
var this_video:Video = new Video();
this_video.attachNetStream(this_stream);
this_video.smoothing = true;
resizeThumb(this_container, thumb_width_max, thumb_height_max);
this_container.x = this_index * (thumb_width_max + 50) + 50;
this_container.y = 200;
this_container.addEventListener(MouseEvent.MOUSE_DOWN, vidClick);
this_container.addEventListener(MouseEvent.MOUSE_OVER, vidOver);
this_container.addEventListener(MouseEvent.MOUSE_OUT, vidOut);
videos[this_index].src = src;
this_stream.play(src, 2);
this_container.addChild(this_video);
addChild(this_container);
}
…but nothing shows up, and mouse movements over the area where they should be don’t generate any events. What am I missing? I had the videos displaying fine before I tried putting them in containers, they just couldn’t react to mouse events. For the record, the videos[] array is just a reference array of objects. I don’t think that’s interfering, but … Thanks in advance!
–Ted