[Flashcoders] Programmatically instantiating a class that extends MovieClip.

2006-06-29 Thread Jason Lutes
Since this relates to some things that were brought up recently...

Is it possible to have a class that extends MovieClip, but doesn't
relate/link to a Library symbol, FULLY instantiate itself without
additional Timeline code?

I'd like to simplify object creation for some classes I created, so that I
can just use the "new" operator to instantiate them.

I'm currently using the instatiating procedure that involves this general
code:

FooClass(this.attachMovie(FooClass.pseudoSymbolName, 'fooInstance',
this.getNextHighestDepth()));

I've looked around and haven't found a tidier way to accomplish this kind
of instantiating, so I presume it's not possible. Does anyone know
differently?


-
pixelTwiddler, a.k.a. Jason

___
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


Re: [Flashcoders] Programmatically instantiating a class that extends MovieClip.

2006-06-29 Thread Ian Thomas

To the best of my knowledge, no, unfortunately.

That's one of the reasons that I'm looking forward to AS3. :-)

Ian

On 6/29/06, Jason Lutes <[EMAIL PROTECTED]> wrote:

Since this relates to some things that were brought up recently...

Is it possible to have a class that extends MovieClip, but doesn't
relate/link to a Library symbol, FULLY instantiate itself without
additional Timeline code?

I'd like to simplify object creation for some classes I created, so that I
can just use the "new" operator to instantiate them.

I'm currently using the instatiating procedure that involves this general
code:

FooClass(this.attachMovie(FooClass.pseudoSymbolName, 'fooInstance',
this.getNextHighestDepth()));

I've looked around and haven't found a tidier way to accomplish this kind
of instantiating, so I presume it's not possible. Does anyone know
differently?

___
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


Re: [Flashcoders] Programmatically instantiating a class that extends MovieClip.

2006-06-29 Thread Jim Kremens

Google 'Ted Patrick' and 'MCE'.

You can't use 'new' but it's a lot better and you don't need a library
symbol.  I've been using a variant of it for about 18 months now with no
trouble.

Jim Kremens


On 6/29/06, Ian Thomas <[EMAIL PROTECTED]> wrote:


To the best of my knowledge, no, unfortunately.

That's one of the reasons that I'm looking forward to AS3. :-)

Ian

On 6/29/06, Jason Lutes <[EMAIL PROTECTED]> wrote:
> Since this relates to some things that were brought up recently...
>
> Is it possible to have a class that extends MovieClip, but doesn't
> relate/link to a Library symbol, FULLY instantiate itself without
> additional Timeline code?
>
> I'd like to simplify object creation for some classes I created, so that
I
> can just use the "new" operator to instantiate them.
>
> I'm currently using the instatiating procedure that involves this
general
> code:
>
> FooClass(this.attachMovie(FooClass.pseudoSymbolName, 'fooInstance',
> this.getNextHighestDepth()));
>
> I've looked around and haven't found a tidier way to accomplish this
kind
> of instantiating, so I presume it's not possible. Does anyone know
> differently?
___
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





--
Jim Kremens
___
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


Re: [Flashcoders] Programmatically instantiating a class that extends MovieClip.

2006-06-29 Thread Scott Hyndman

Why not subclass object instead? Both ActionStep and ASwing work this
way, then create movieclips on the fly. It's very nice to work with.

Scott

On 29/06/06, Jim Kremens <[EMAIL PROTECTED]> wrote:

Google 'Ted Patrick' and 'MCE'.

You can't use 'new' but it's a lot better and you don't need a library
symbol.  I've been using a variant of it for about 18 months now with no
trouble.

Jim Kremens


On 6/29/06, Ian Thomas <[EMAIL PROTECTED]> wrote:
>
> To the best of my knowledge, no, unfortunately.
>
> That's one of the reasons that I'm looking forward to AS3. :-)
>
> Ian
>
> On 6/29/06, Jason Lutes <[EMAIL PROTECTED]> wrote:
> > Since this relates to some things that were brought up recently...
> >
> > Is it possible to have a class that extends MovieClip, but doesn't
> > relate/link to a Library symbol, FULLY instantiate itself without
> > additional Timeline code?
> >
> > I'd like to simplify object creation for some classes I created, so that
> I
> > can just use the "new" operator to instantiate them.
> >
> > I'm currently using the instatiating procedure that involves this
> general
> > code:
> >
> > FooClass(this.attachMovie(FooClass.pseudoSymbolName, 'fooInstance',
> > this.getNextHighestDepth()));
> >
> > I've looked around and haven't found a tidier way to accomplish this
> kind
> > of instantiating, so I presume it's not possible. Does anyone know
> > differently?
> ___
> 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
>



--
Jim Kremens
___
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


Re: [Flashcoders] Programmatically instantiating a class that extends MovieClip.

2006-06-29 Thread Jim Kremens

"Why not subclass object instead? Both ActionStep and ASwing work this
way, then create movieclips on the fly. It's very nice to work with."

So you never really subclass movieclip, you use composition instead.  In
other words, your class has a movieclip, but it isn't a movieclip.,,

Is that what you mean, or am I missing the point?  Can you give a small code
example?

Thanks,

Jim Kremens
___
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


Re: [Flashcoders] Programmatically instantiating a class that extends MovieClip.

2006-06-29 Thread Scott Hyndman

That's exactly what I mean. As a result you can do cool things like
reparenting -- like moving a button from one window to another. It
handles the MovieClip creation itself.

A code example really isn't too easy, because the framework that
allows this to be possible is quite large. If you were really
interested, you could look at the code. Here's a link:

http://tinyurl.com/jqtwv

It's a gigantic class...so it might be difficult to work through. The
important method is createMovieClips(), which is called when a view
(the type of object that encapsulates movieclips) moves to a new
superview.

Scott

On 29/06/06, Jim Kremens <[EMAIL PROTECTED]> wrote:

"Why not subclass object instead? Both ActionStep and ASwing work this
way, then create movieclips on the fly. It's very nice to work with."

So you never really subclass movieclip, you use composition instead.  In
other words, your class has a movieclip, but it isn't a movieclip.,,

Is that what you mean, or am I missing the point?  Can you give a small code
example?

Thanks,

Jim Kremens
___
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


Re: [Flashcoders] Programmatically instantiating a class that extends MovieClip.

2006-06-29 Thread eka

Hello :)

it's easy, you must use __proto__

AS2 - MyClass extend MovieClip !!!

MyClass extends MovieClip {

// o Constructor

public function MyClass() {

}

}



var mc = createEmptyMovieClip("myInstance", 1) ;
mc.__proto__ == MyClass.prototype ;
MyClass.call(mc) ;

EKA + :)




2006/6/29, Scott Hyndman <[EMAIL PROTECTED]>:


That's exactly what I mean. As a result you can do cool things like
reparenting -- like moving a button from one window to another. It
handles the MovieClip creation itself.

A code example really isn't too easy, because the framework that
allows this to be possible is quite large. If you were really
interested, you could look at the code. Here's a link:

http://tinyurl.com/jqtwv

It's a gigantic class...so it might be difficult to work through. The
important method is createMovieClips(), which is called when a view
(the type of object that encapsulates movieclips) moves to a new
superview.

Scott

On 29/06/06, Jim Kremens <[EMAIL PROTECTED]> wrote:
> "Why not subclass object instead? Both ActionStep and ASwing work this
> way, then create movieclips on the fly. It's very nice to work with."
>
> So you never really subclass movieclip, you use composition instead.  In
> other words, your class has a movieclip, but it isn't a movieclip.,,
>
> Is that what you mean, or am I missing the point?  Can you give a small
code
> example?
>
> Thanks,
>
> Jim Kremens
> ___
> 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