I' making a flash file with AS2 in Flash CS3. I put a FlVPlayback in stage and let it load a couple of FLV files from my local HDD and playing continuously. I use "addEventListener" to check the current running flash movie is completed. After complete event occur, I load another flv movie to paly again.Here, I noticed that memory usage is increasing every time a new flv file is loaded and played. I heard "addEventListener" in CS3 is causing the memory leak and not being detected by GC.
Please let me know if there is a solution to solve the memory leak issue. I posted my codes here to know something I'm doing wrong.
Thanks in advance...
this.autoRewind = "true";
var _v1 = _root.v;
var _v2 = _root.FLVlists.length;
if (_v1 < _v2)
_v1 = 0;
this.contentPath = _root.FLVlists[_v1].path;
var _v3 = _root.listVids[_v1].width;
var _v4 = (stage._width - _v3) / 2;
this._x = _v4;
_root.v = _v1;
I think you have to use removeEventListener
Thanks for your feedback. The problem with removeEventListener is that , the player stops and not playing anymore. In my application, I nned to loop and play one FLV files after another. For example, I need to play 3 flv files, File1.flv, File2.flv, File3.flv. I load and play File1.flv first. Once complete event trigger from "addEventlisterner" , then I load File2.flv and then File3.flv and then Flie1.flv. So it needs play continuously and causing memory leak. Please let me know if there is another way of working around.