alstrup / arctic

Automatically exported from code.google.com/p/arctic
0 stars 0 forks source link

Impossible use of the resources as picture source #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Impossible use of the resources as picture source
      Picture(resource_picture_name, 25, 25, 1)

Solution:

Replace 

case Picture(url, w, h, scaling, resource, crop, cache, cbSizeDiff):
    if (mode == Metrics) {
        return { clip: null, width : w, height : h, growWidth : false, growHeight : false };
    }
    var clip : ArcticMovieClip = getOrMakeClip(p, mode, childNo);
    var width = w;
    var height = h;
    var checkSizes = function (realWidth : Float, realHeight : Float) {
        if (cbSizeDiff != null && (realWidth != w || realHeight != h)) {
            cbSizeDiff(realWidth, realHeight);
        }
    }
    #if flash9
        if (mode == Create) {
            if (Type.resolveClass(url) != null) {
                var loader = flash.Lib.attach(url);
                clip.addChild(loader);
            } else {

with lines

case Picture(url, w, h, scaling, resource, crop, cache, cbSizeDiff):
    if (mode == Metrics) {
        return { clip: null, width : w, height : h, growWidth : false, growHeight : false };
    }
    var clip : ArcticMovieClip = getOrMakeClip(p, mode, childNo);
    var width = w;
    var height = h;
    var checkSizes = function (realWidth : Float, realHeight : Float) {
        if (cbSizeDiff != null && (realWidth != w || realHeight != h)) {
            cbSizeDiff(realWidth, realHeight);
        }
    }
    #if flash9
        if (mode == Create) {
            var clResolved : Class<Dynamic> = Type.resolveClass(url);
            var clName : String = Type.getClassName(Type.getSuperClass(clResolved)).split('.').pop();
            if ( clResolved != null) {
                if (clName == "MovieClip") {
                    var loader = flash.Lib.attach(url);
                    clip.addChild(loader);
                } else if (clName == "Bitmap") {
                    var image:Bitmap = Type.createInstance(clResolved, []);
                    clip.addChild(image); 
                }
            } else {

Original issue reported on code.google.com by fov...@gmail.com on 6 Jun 2011 at 4:14