jrmuizel / tweener

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

_colorTransform_splitter in AS3 version throws an error on legacy color support #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
[Flash CS3 IDE & external class, strict mode on & off]

Color transformation with ColorShortcuts throws an error:

ReferenceError: Error #1069: Property ra not found on flash.geom.ColorTransform 
and there is no 
default value.
    at caurina.transitions.properties::ColorShortcuts$/_colorTransform_splitter()
    at caurina.transitions::Tweener$/addTween()

After commenting out legacy color support in this splitter error does not 
occur. I think it's time to 
get rid of this legacy support anyway. Cheers!

Original issue reported on code.google.com by rolekgrz...@gmail.com on 8 Nov 2007 at 3:11

GoogleCodeExporter commented 9 years ago
rolekgrzegorz, I've changed this quite a bit recently. Now both the AS2 and AS3
version  use the new color transformation model as default. Both support the old
syntax, but resolve them to the new one when applying. This is just to avoid 
rewrites.

So all in all it shouldn't have thrown an error. Which version are you using?

Original comment by zisfor...@gmail.com on 8 Nov 2007 at 3:27

GoogleCodeExporter commented 9 years ago
I'm using ColorShortcuts posted on svn repository today (Thu, 8 Nov 2007 
11:42:18 GMT) with most recent 
Tweener AS3. I have seen this error while compiling external class few days ago 
(funny thing is, I was 
rewriting some code with old color syntax to the new one). Here's a sample code 
for IDE I've used to 
reproduce this problem. And like I said, after commenting out legacy color 
support error does not occur.

import caurina.transitions.Tweener;
import caurina.transitions.properties.ColorShortcuts;

ColorShortcuts.init();

var shape: Shape = new Shape();
shape.graphics.beginFill(0xFF0000);
shape.graphics.drawRect(0, 0, 100, 100);
addChild(shape);
Tweener.addTween(shape, {_colorTransform: new ColorTransform(0, 0, 0, 1, 0x00, 
0xFF, 0x00), time: 1});

Original comment by rolekgrz...@gmail.com on 8 Nov 2007 at 4:18

GoogleCodeExporter commented 9 years ago
Oh, okey, I was wondering if it was with the most recent version (the one where 
I've
changed the behavior) or not.

This seems to be a problem alright, so I'll have a look at it. Thanks.

Original comment by zisfor...@gmail.com on 8 Nov 2007 at 4:25

GoogleCodeExporter commented 9 years ago
Temp solution: Line 123, file caurina > transitions > 
SpecialPropertiesDefault.as

public static function _colorTransform_splitter (p_value:*, 
p_parameters:Array):Array {
            var nArray:Array = new Array();
            if (p_value == null) {
                // No parameter passed, so just resets the color
                nArray.push({name:"_color_ra", value:1});
                nArray.push({name:"_color_rb", value:0});
                nArray.push({name:"_color_ga", value:1});
                nArray.push({name:"_color_gb", value:0});
                nArray.push({name:"_color_ba", value:1});
                nArray.push({name:"_color_bb", value:0});
            } else {
                // A color tinting is passed, so converts it to the object values
                if (p_value.redMultiplier != undefined) nArray.push({name:"_color_ra",
value:p_value.redMultiplier});
                if (p_value.redOffset != undefined) nArray.push({name:"_color_rb",
value:p_value.redOffset});
                if (p_value.greenMultiplier != undefined) nArray.push({name:"_color_ba",
value:p_value.greenMultiplier});
                if (p_value.greenOffset != undefined) nArray.push({name:"_color_bb",
value:p_value.greenOffset});
                if (p_value.blueMultiplier != undefined) nArray.push({name:"_color_ga",
value:p_value.blueMultiplier});
                if (p_value.blueOffset != undefined) nArray.push({name:"_color_gb",
value:p_value.blueOffset});
                if (p_value.alphaMultiplier != undefined) nArray.push({name:"_color_aa",
value:p_value.alphaMultiplier});
                if (p_value.alphaOffset != undefined) nArray.push({name:"_color_ab",
value:p_value.alphaOffset});
            }
            return nArray;
        }

Original comment by bodyvis...@gmail.com on 14 Dec 2007 at 9:19

GoogleCodeExporter commented 9 years ago
Geez, I suck. I forgot to update this. I'm sorry.

rolekgrzegorz, it turns out you're absolutely right. There's no reason to keep 
the
old properties on the AS3 version. They've been removed from the colorTransform
object parsing.

Commited the fix now.

Original comment by zisfor...@gmail.com on 14 Dec 2007 at 11:17

GoogleCodeExporter commented 9 years ago
Jepp, it works - using the newest version from the SVN. But I guess it would be 
more
helpful to less technical users to release a new stable version? :-) I mean, the
newest is from Sep 07, while the latest SVN-Patch (based on the change-log) is 
13
months newer...

Original comment by LennartK...@gmail.com on 24 Oct 2008 at 9:36

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Yes, I will do so soon.

Original comment by zisfor...@gmail.com on 24 Oct 2008 at 12:44