Connect Camera is easy, turn it off is evil!!

To turn it on is so simple as document said but to turn it off after access need specific method. After google around I found this one solution:

camera = null;


I test in an empty fla and it work like a charm. But when I test in my working project which do a lot more of connect and display video. I found that another important trick to do is below:

var cam:Camera = Camera.getCamera( id );
video.attachCamera(null);  // this need to set before the next line, always.

I know it weird but it work well for me.