-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
removeChild not working #1038
Comments
This was mentioned just recently in #1048 (comment) So... it sounds like it is not the right behavior to add the clip back again once it is removed. Your proposed solution would be to set the _off property to true when removeChild() is used and set the _off property to false when the addChild() is used. I have made a test version of CreateJS here: https://zimjs.org/cdn/1.3.3/createjs_doc_off.js The three changes in it can be found by searching: If you could test it and see if it works, that would be great. If not, then I will set up tests here, etc. Just going out for a swim! (hahaha - funny, the issue is from December and I am hoping for a test by the time I get back from swimming eight months later - I am so used to fixing bugs with developers as soon as they report them.) |
Issue Details
if a Tween is added to some timeline on some target.
tween = cjs.Tween.get(target);
timeline.addTween(tween.wait(1));
if target is an instance of createjs.DisplayObject then in below mentioned
_resolveState
function(MovieClip.js)_addManagedChild
(MovieClip.js) adds that target as a child to owner of the timeline.Consider
this.removeChild(target)
is called and target is removed from parentbut child is still there because on next tick target again gets added as child in _resolveState function
and it looks like removeChild didn't work.
Mac 10.15.1 Chrome 78.0.3904.108
Possible solution:
setting child._off = true on removing child and
setting false on adding child.
this.removeChild(target);
target._off = true;
this could be done either outside createjs or can be made part of removeChild and addChild
functions.
Is this ok or is there any other solution or any other approach to solve this problem?
https://jsfiddle.net/jaswant0709/mocqfj3s/17/
The text was updated successfully, but these errors were encountered: