Ignoring scope of _root level functions is fine.  Ignoring duplication of 
efforts is not.  You can always wrap your functions in a class in 5 minutes. 
Removing duplication in code, however, takes way longer and may cause 
unforseen problems if not solved early enough.

----- Original Message ----- 
From: "Manuel Saint-Victor" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
Sent: Friday, February 17, 2006 12:12 PM
Subject: Re: [Flashcoders] coding the main stage as if it were a class


Okay- actually I like that approach.  I had seen you do part of that in a
tutorial before but not with actually setting the class as the view from the
timeline.  It actually makes it a lot clearer now.

I guess it's not as much not being comfortable with it as much as sometimes
during a quick scripting I hesitate to create a class for a really small
app.  But as you know then a request here and there suddenly has the app
doing a lot more and while I'm waiting for the downtime to put it in a class
I regret every new line of code that I'm putting in _root and antiucipating
trying to place in a class file.

I know that if I code it correctly on root to begin with the transition is
not that big a deal but it still makes me cringe.


Thanks again- I'll probably use that as my crutch method at times when I'm
not quite ready to drop something in a class file.

M


On 2/17/06, JesterXL <[EMAIL PROTECTED]> wrote:
>
> What aren't you comfortable with?  Some don't like extending the timeline,
> and do something like:
>
> class MyController
> {
>     private var view:MovieClip;
>
>     function MyController ( mc:MovieClip )
>     {
>         view = mc;
>     }
> }
>
> And then on _root;
>
> controller = new MyController(this);
>
> or:
>
> class MyController
> {
>
>     private var view:MovieClip;
>
>     public static function init ( mc:MovieClip )
>     {
>         view = mc;
>     }
> }
>
> and then on _root:
>
> MyController.init(this);
>
> there are a few other variations.  I like making _root a class, though!
> ----- Original Message -----
> From: "Manuel Saint-Victor" <[EMAIL PROTECTED]>
> To: "Flashcoders mailing list" <flashcoders@chattyfig.figleaf.com>
> Sent: Friday, February 17, 2006 9:19 AM
> Subject: [Flashcoders] coding the main stage as if it were a class
>
>
> I've seen this done in a few tutorial where the code placed in the main
> time
> line is written as if it were in a class file.  By this I mean things like
> writing addEventListener(this); and having the functions sitting in the
> main
> timeline that handles the event.  I think this is a convenient approach-
> and
> I know the response by siome will be--"well just make the main timeline a
> class- etc and sometimes I do that but others I'm not fully comfortable
> doing that but have found this to be a good halfway point.  Can anyone who
> uses this approach tell me the their thoughts on this.  I wish I could
> think
> of some more examples of this but am coming up blank right now.
>
> Thanks,
>
> Mani
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> 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
>
> _______________________________________________
> Flashcoders@chattyfig.figleaf.com
> 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
>
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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 


_______________________________________________
Flashcoders@chattyfig.figleaf.com
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