I was able to have someone test the sample code below and it worked fine
for them. I had their files sent to me but couldn't open the FLA. I'm
using MX2004 and I assume they have 8 or higher. I tested using the sample
that was sent and still had the same errors.
Has anyone heard of this before? Assuming this affects Flash 7 MX2004?
Thanks.
Chris
> Hi all. It's been a LONG time since I've posted and now I need your help
> again.
>
> I have come across something that to me doesn't seem correct and I don't
> know why things are behaving this way. I have 2 classes, one a subclass of
> the other. Both have public static variables (AS2.0 Flash 7).
>
> class mypackage.Fruit {
> public static var COLOR:Number = 0;
> }
>
> class mypackage.Orange extends mypackage.Fruit {
> public static var SEEDS:Number = 0;
> }
>
> Now in the Orange class or any other class that needs to use Orange. The
> following code: Orange.COLOR returns 0.
>
> import mypackage.Orange;
> class Table {
> public function Table() {
> trace("Orange.COLOR: " + Orange.COLOR); // outputs 0
> }
> }
>
> Things change when this code is applied to the timeline:
>
> Table.fla
> import mypackage.Orange;
> trace("Orange.COLOR: " + Orange.COLOR); // outputs undefined
> trace("Orange.SEEDS: " + Orange.SEEDS); // outputs 0
>
> Tracing Orange.COLOR gives me undefined. But if I import mypackage.Fruit.
> Fruit.COLOR traces out 0.
>
> Table.fla
> import mypackage.Fruit;
> trace("Fruit.COLOR: " + Fruit.COLOR); // outputs 0
>
> Can someone shed some light on why in an FLA that the subclass (in this
> case Orange) cannot access its super class static variables
> (Orange.COLOR)?
>
> Thanks.
> \m/
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com