You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the beginning, a new bmx is created. When hit, bmx.createRagDoll is called, which in turn creates a new ragdoll (during the creation of a new splitBike).
Since both bmx and ragdoll inherit from vehicle, the call to _root.createEmptyMovieClip("vehiclemc", 3) occurs multiple times.
The second call removes the MovieClip of bmx, just because a new MovieClip is created with the same depth.
The removal happens in add_child_from_avm.
The inherent problem here is that MovieClips store their children in a BTreeMap indexed by their depth, so children with the same depth cannot co-exist.
I tried to convert the BTreeMap to a simple Vec, but it was just too much to rewrite.
The text was updated successfully, but these errors were encountered:
Not sure what's going on in this specific case--I'll have to take a look--but in general creating a movie on an already occupied depth removes the previous clip. A simple example:
var mc = createEmptyMovieClip("mc", 0);
mc.lineStyle(3, 0);
mc.lineTo(100, 100);
// mc2 is placed on the same depth as mc, so mc is destroyed
var mc2 = createEmptyMovieClip("mc2", 0);
mc2.lineStyle(3, 0xff0000);
mc2.lineTo(100, 200);
// Only mc2 is visible
Seems like this is a case of the original reference mymc auto-updating to the newly created clip. The clip does indeed get replaced when it uses the same depth, but since it uses the same path _root.vehiclemc, the mymc reference automatically points to the new clip. You can see it work if you manually update the references at the end of splitBike:
In Free Rider 2, the bike and player disappear when hit.
After digging into this, I think I found the root cause of the problem:
At the beginning, a new
bmx
is created. When hit,bmx.createRagDoll
is called, which in turn creates a newragdoll
(during the creation of a newsplitBike
).Since both
bmx
andragdoll
inherit fromvehicle
, the call to_root.createEmptyMovieClip("vehiclemc", 3)
occurs multiple times.The second call removes the
MovieClip
ofbmx
, just because a newMovieClip
is created with the same depth.The removal happens in
add_child_from_avm
.The inherent problem here is that
MovieClip
s store their children in aBTreeMap
indexed by their depth, so children with the same depth cannot co-exist.I tried to convert the
BTreeMap
to a simpleVec
, but it was just too much to rewrite.The text was updated successfully, but these errors were encountered: