<commit_before>//
// Flump - Copyright 2012 Three Rings Design

package flump.xfl {

import flash.utils.Dictionary;

public class XflMovie extends XflTopLevelComponent
{
    use namespace xflns;

    public var md5 :String;
    public var libraryItem :String;
    public var symbol :String;
    public var layers :Array;

    public function XflMovie (baseLocation :String, xml :XML, md5 :String) {
        const converter :XmlConverter = new XmlConverter(xml);
        libraryItem = converter.getStringAttr("name");
        super(baseLocation + ":" + libraryItem);
        this.md5 = md5;
        symbol = converter.getStringAttr("linkageClassName", null);

        const layerEls :XMLList = xml.timeline.DOMTimeline[0].layers.DOMLayer;
        if (new XmlConverter(layerEls[0]).getStringAttr("name") == "flipbook") {
            layers = [new XflLayer(location, layerEls[0], _errors, true)];
            if (symbol == null) {
                addError(ParseError.CRIT, "Flipbook movie '" + libraryItem + "' not exported");
            }
        } else {
            layers = new Array();
            for each (var layerEl :XML in layerEls) {
                layers.push(new XflLayer(location, layerEl, _errors, false));
            }
        }
    }

    public function checkSymbols (lookup :Dictionary) :void {
        if (flipbook && !lookup.hasOwnProperty(symbol)) {
            addError(ParseError.CRIT, "Flipbook movie '" + symbol + "' not exported");
        } else for each (var layer :XflLayer in layers) layer.checkSymbols(lookup);
    }

    public function get flipbook () :Boolean { return layers[0].flipbook; }
}
}
<commit_msg>Order layers for correct display.<commit_after>//
// Flump - Copyright 2012 Three Rings Design

package flump.xfl {

import flash.utils.Dictionary;

public class XflMovie extends XflTopLevelComponent
{
    use namespace xflns;

    public var md5 :String;
    public var libraryItem :String;
    public var symbol :String;
    public var layers :Array;

    public function XflMovie (baseLocation :String, xml :XML, md5 :String) {
        const converter :XmlConverter = new XmlConverter(xml);
        libraryItem = converter.getStringAttr("name");
        super(baseLocation + ":" + libraryItem);
        this.md5 = md5;
        symbol = converter.getStringAttr("linkageClassName", null);

        const layerEls :XMLList = xml.timeline.DOMTimeline[0].layers.DOMLayer;
        if (new XmlConverter(layerEls[0]).getStringAttr("name") == "flipbook") {
            layers = [new XflLayer(location, layerEls[0], _errors, true)];
            if (symbol == null) {
                addError(ParseError.CRIT, "Flipbook movie '" + libraryItem + "' not exported");
            }
        } else {
            layers = new Array();
            for each (var layerEl :XML in layerEls) {
                layers.unshift(new XflLayer(location, layerEl, _errors, false));
            }
        }
    }

    public function checkSymbols (lookup :Dictionary) :void {
        if (flipbook && !lookup.hasOwnProperty(symbol)) {
            addError(ParseError.CRIT, "Flipbook movie '" + symbol + "' not exported");
        } else for each (var layer :XflLayer in layers) layer.checkSymbols(lookup);
    }

    public function get flipbook () :Boolean { return layers[0].flipbook; }
}
}

{'fraction_non_alphanumeric': 0.11279104928938614, 'fraction_numerical': 0.00725733293014817, 'mean_word_length': 2.683741648106904, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4927048', 'n_tokens_mistral': 972, 'n_tokens_neox': 923, 'n_words': 260}