-
removeChild and sounds problem
Hello,
I have code like this :
[code = as]
private function removeBall() {
var _nameisplayObject = _container.getChildByName(obj._ballMC.name);
var _index = _container.getChildIndex(_name);
var _indexArray = IndexReturn(obj._ballMC,obj.indexArray);
obj.indexArray.splice(_indexArray, 1);
_container.removeChildAt(_index);
_name.removeEventListener(Event.ENTER_FRAME, oef);
_name = null
delete obj._ballMC
lostLiveRestart()
}
[/code]
And this _ballMC object has his own oef event on his class where i check for collision with some other objects. When collision is true i play sound.
The problem is : when i removeChild(_index) and put a new _ballMC on stage, i hear two sounds for collision - i think that old _ballMC is still somewhere in memory - but i delete it and remove event OEF. What is wrong??
Thanks,
Michael
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|