I thought I was getting this, but am confused right now, so thought I’d ask here. In a class, I have a function that instantiates a VideoPlayer clas:
private function attractPlay(e:KioskEvent)
{
stage.addChild(new VideoPlayer());
}
And then in the VideoPlayer constructor I do:
public function VideoPlayer()
{
//setup stuff…
vid = new Video(1137, 768);
vid.attachNetStream(ns);
ns.play(“test.flv”);
//addChild(vid);
}
If I do like shown, and omit the addChild() in the constructor then all I get is the sound. If I use the addChild, the video plays. VideoPlayer extends Sprite… and this is where I’m confused. I thought the: stage.addChild(new VideoPlayer()); would be enough, I’m not sure why I also need to addChild(vid) inside the player class itself.
When I want to clear the video, do I need to removeChild on both?
Hope this makes sense…