Well, I ran the same code through Flash MX Professional 2004, and the
getter bug disappeared. Decompiling the swf reveals their trick: they
replace the getter reference "some_value" with a direct call to the
getter method "__get__some_value()". Tricky.

Here's the comparison between the code from Flash and MTASC (with the
offending line marked with >>>>>>):


MTASC:
======
        v1.__set__some_value = function (v) {
          Main.my_trace('SETTER called with \'' + v + '\'',
'ClassWithGetter::some_value', 'ClassWithGetter.as', 14);
          Main.my_trace('SETTER calling getter...',
'ClassWithGetter::some_value', 'ClassWithGetter.as', 16);
>>>>>>    var v3 = this.some_value;
          Main.my_trace('SETTER received (' + typeof v3 + ')' + v3 + '
from getter', 'ClassWithGetter::some_value', 'ClassWithGetter.as',
18);
          Main.my_trace('SETTER calling Main.check_getter()...',
'ClassWithGetter::some_value', 'ClassWithGetter.as', 20);
          Main.check_getter();
          this.__some_value = v;
          Main.my_trace('SETTER done', 'ClassWithGetter::some_value',
'ClassWithGetter.as', 24);
          return this.__get__some_value();
        };


Flash MX 2004 Professional:
===========================
        v2.__set__some_value = function (v) {
          var v2 = this;
          Main.my_trace('SETTER called with \'' + v + '\'');
          Main.my_trace('SETTER calling getter...');
>>>>>>    var v1 = v2.__get__some_value();
          Main.my_trace('SETTER received (' + typeof v1 + ')' + v1 + '
from getter');
          Main.my_trace('SETTER calling Main.check_getter()...');
          Main.check_getter();
          v2.__some_value = v;
          Main.my_trace('SETTER done');
          return v2.__get__some_value();
        };


Regardless, I'm going to start compiling my swf's to version 7, and
sidestep the whole issue.

Thank you all for your help and feedback.

- matt


On 6/2/06, Nicolas Cannasse <[EMAIL PROTECTED]> wrote:
> > Can anyone confirm the same bug when compiling with Flash MX? Perhaps
> > the authoring tool is somehow patching its way around this problem?
>
> I don't think it does. Look like this is a bug in FP6 that was fixed in FP7.
>
> Nicolas
>
> _______________________________________________
> osflash mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to