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
AS2: When splicing unloaded/removed movie clips from an array referencing them, Ruffle's behavior does not match Flash player.
.swf attached.
When attached .swf is run in Flash Player, the yellow MovieClips are unloaded fairly quickly, and the logs/trace statements show the length of the array steadily decreasing.
When attached .swf is run in Ruffle, the MovieClips take much longer to unload and the array's length logs as 100 always. Here is the attached .swf running via Ruffle: https://typehelp.org/ruffletest/splicetest.html
Minimally reproduced as2 code:
var allItems = new Array();
populateItems();
function populateItems() {
for (var i=0; i<100; i++) {
var g = this.attachMovie("guy", "g" + i, i);
g._y = Math.floor(Math.random()*350);
allItems.push(g);
}
}
function randomRemove() {
var doIt = Math.random() * 100;
if (doIt < 30) {
var randGuy = allItems[Math.floor(Math.random()*allItems.length)];
randGuy.removeMovieClip();
randGuy.unloadMovie();
}
}
function sortClips() {
trace("allItems length: " + allItems.length);
for (var i=0; i<allItems.length; i++) {
var s = allItems[i];
if (s == undefined || s._y == undefined) {
allItems.splice(i,1);
i--;
continue;
}
}
}
this.onEnterFrame = function() {
sortClips();
randomRemove();
}
Expected behavior
In Ruffle, the allItems array length would decrease from 100 to 0 as the file runs.
This is just the already known "ghost" state that MovieClips become once removed:
var clip =this.createEmptyMovieClip("clip", 0);trace(clip._y);// traces "0" in both Flash and Ruffle.
clip.removeMovieClip();trace(clip._y);// traces "undefined" in Flash, but "0" in Ruffle.
Describe the bug
AS2: When splicing unloaded/removed movie clips from an array referencing them, Ruffle's behavior does not match Flash player.
.swf attached.
When attached .swf is run in Flash Player, the yellow MovieClips are unloaded fairly quickly, and the logs/trace statements show the length of the array steadily decreasing.
When attached .swf is run in Ruffle, the MovieClips take much longer to unload and the array's length logs as 100 always. Here is the attached .swf running via Ruffle: https://typehelp.org/ruffletest/splicetest.html
Minimally reproduced as2 code:
Expected behavior
In Ruffle, the allItems array length would decrease from 100 to 0 as the file runs.
Affected platform
Self-hosted version
Operating system
Win 10
Browser
Chrome
splicetest.zip
Additional information
No response
The text was updated successfully, but these errors were encountered: