matthias382 wrote in flashdev 😡aggravated

Want to play Spot the Bottleneck?


I've got a Flash movie with a fairly large bottleneck in it (somewhere in the neighborhood of a 20-second delay). It happens when an onPress event is responded it and the movie just seems to sit there "spinning its wheels" as it were. The end result of the event is to redirect to a different Scene in the movie. That scene has events that occur when it finishes loaded that appear to happen fairly quickly. It's just the transition between the scenes that seems fairly slow, which leads me to believe that it lies somewhere in my event handling. Is there a better way to do what I'm doing, or am I way off-course on what my problem might be?


for(x = 0; x < block_no.length; x ) {
    _root[block_no[x]].gotoAndStop(2);
    _root[block_no[x]].locationID = locationIDs[x];
    _root[block_no[x]].onPress = function() {
        if(this._currentframe == 2) {
            _root["locationID"] = this.locationID;
            gotoAndStop("Jobs", 1);
        }
    }
}


The problem ended up being (I think) that there were too many other objects (and thus too many other listeners) in the movie. I'm going to try exporting the objects to individual movies and dynamically import whichever one is requested. Hopefully, that will speed things up.