Hello,

beside the many AS3 questions, IMHO most of the current real-world
projects are still based on FlashPlayer 7 and 8 and thus on AS2,
because of the player penetration.
This was probably asked before, but I want to know which workflow
works best for you guys:

Do you prefer
a) the attachMovie method
b) the use of a static create method
c) a GUI toolkit like ASWING and extend from JComponent
d) some other workflow

Here's a class to illustrate (a) and (b):

/**
* SomeMovieClip
*/
import net.lizu.*

class net.lizu.SomeMovieClip extends MovieClip
{
        // register class
        public static var SymbolName:String = 
"__Packages.net.lizu.SomeMovieClip";
        public static var SymbolOwner:Function = SomeMovieClip;
        public static var SymbolLinked = 
Object.registerClass(SymbolName,SymbolOwner);

        public var _some:String;

        // constructor
        public function SomeMovieClip()
   {
   }

        // alternative to attachMovie call
        public static function create(target:MovieClip, name:String,
initObject:Object):SomeMovieClip
        {
                return 
SomeMovieClip(target.attachMovie(SomeMovieClip.SymbolName,
name, target.getNextHighestDepth(), initObject));
        }

        // entrypoint
        static function main()
        {
                
_root.attachMovie(SomeMovieClip.SymbolName,"clipId1",_root.getNextHighestDepth(),
{_x: 30, _some: "Hello 1"});
                SomeMovieClip.create(_root, "clipId2", {_x: 30, _some: "Hello 
2"});
        }

}

And is there a way to automate the writing of SymbolName,SymbolLinked
and create for all my classes which extend MovieClip?

Thanks,
Matthias
_______________________________________________
[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

Reply via email to