Hello there!
Here's the deal: I have the following class hierarchy
MovieClip // adobe
- BasicMovieClip // as2lib
-- GenericMovieClip
--- EventMulticasterMovieClip
---- GenericSection
----- DropdownSection // abstract class, private constructor
------ *Several classes extending DropdownSection
That GenericSection is part of a section handling. It has basically two
functions: load() and unload(), both public, and they basically dispatch an
event, so my section handler can act properly.
Ok, so I have several "sections" who behave almost the same, so I'm writing
generic code in DropdownSection, so I can generalize it more cleanly.
Here comes the code:
When I have this on DropdownSection:
public function load():Void
{
super.load();
}
public function unload():Void
{
super.unload();
}
(these are not necessarily needed, but just to clarify)
then everything works perfectly, when my section handler calls load() and
unload() on any of the classes that extends DropdownSection.
However, when I code something like this:
public function load():Void
{
var obj:Object = new Object({
_y: 200,
time: 1,
onComplete: super.load
});
Tweener.addTween(this, obj);
}
(and the equivalent for the unload() function)
* Tweener is Zeh Fernando's tween class - http://code.google.com/p/tweener/
Well, what that does, in the same situation as above, is that when Tweener
is done, that very own load() function is called again.
I've tried using Delegate, delegating to himself, to the superclass, nothing
did it.
I've also tried creating a local function that just calls super.load() and
delegating to that, but no luck either.
My guess at the moment is that it's a side-effect to the "weird" AS2
implementation of static classes.
However I'm curious. Am I doing something completely wrong and not noticing
it? Is my implementation flawed?
Or there is a way to work that around?
Thank you very much for your time!
--
Wagner Amaral
AgĂȘncia Ginga - Brazil
www.agenciaginga.com.br
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders