My current system is to create a Main class, which is the only thing on the
timeline. Then instantiate, passing in _root:

var main:Main = new Main( this );

Where my class now has an internal reference to _root, but no headaches with
embedding movies, forcing _lockroot, or anything.

eg:

import PanelHelper;

import mx.controls.Label;
import mx.core.UIObject;

class Main
{
   function Main( root:MovieClip )
   {
       var panel:PanelHelper = root.createObject( "PanelView", "panelView",
0 );
       panel.setLabel( "What is going on?" );
   }
}

Again, you can take it to next level, by associating a class with the clip
itself. In the library in the linkage option, you can specify an AS2 class
to associate with your clip (here, PanelHelper). I believe that this class
can extend UIObject or UIComponent, both of which give you a lot of advanced
functionality. However, inside that class, you need to create references to
whatever assets are on the stage of that library clip, such as:

import mx.core.UIObject;

class PanelHelper extends UIObject
{
   private var input:TextField;

   function PanelHelper()
   {
       trace( "\n *** PanelHelper()" );

       trace( "input.text: "+input.text );
   }
}


This would probably be a good place to read more:

http://livedocs.macromedia.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00003023.html


Sorry if this isn't going anywhere, but wanted to get people thinking - and
correcting me, if they have better ways!

Scott

On 8/24/06, Ricardo Sánchez <[EMAIL PROTECTED]> wrote:

Can you share some hints? Is it OOP? If you tell me that book is good I'll
probably buy it but it would be nice if you share a little of what you are
talking about.

Thanks!

On 8/24/06, Wouter <[EMAIL PROTECTED]> wrote:
>
> For the system you are describing I use one from this book (chapter 3)
>
> http://www.amazon.com/gp/product/1590595947
>
> It is a nice system formenus, doing exactly what you want and it is easy
> to
> customize
>
> Wouter
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Ricardo
> Sánchez
> Sent: Thursday, August 24, 2006 2:53 PM
> To: Flashcoders mailing list
> Subject: [Flashcoders] Re: OOP methodology and flash. I'm loosing my
> faith...
>
> Maybe I'm not explaining my self clear.
>
> What I want to know is what is the best approach to make a site with a
> menu
> with some buttons with rollOvers, rollOuts... When you click a button it
> stays selected until you click another one.
>
> Clicking any button will load content on a specific place on the web,
> making
> it appear with some animation and making also the last one desapear...
>
> I ask this because 80% of the projects I make have that structure or
very
> similar. And I think it can be helpfull to other people too.
>
> On 8/23/06, Ricardo Sánchez <[EMAIL PROTECTED]> wrote:
> >
> > ... well, not really but I thought it was good as I title
> >
> > I always use OOP for my flash projects but, even if I find it easier
> > than timeline coding, I dont know if I'm taking all the advantage of
> > OOP. I'm not even sure if I am aplying the correct patterns for every
> problem.
> >
> > My insecurity probably has to do with the lack of normal work OOP
> > flash examples. For example the typicall top menu/content web. How can
> > OOP be applied to that?
> >
> > I guess I find a gap in the theory of knowing how to link the symbols,
> > movieclips, timeline and graphics in flash with the code in external
> files.
> >
> > Am I opening a can of worms?
> >
> > Thanks.
> >
> _______________________________________________
> [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
>
_______________________________________________
[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




--

: : ) Scott
_______________________________________________
[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