Groups | Blog | Home
all groups > flash actionscript > march 2004 >

flash actionscript : MovieClip class - prototype question


szd
3/1/2004 6:48:27 PM
I would like to create a method for the MovieClip class. So, something like
MovieClip.prototype.someMethod(){ . . .

Dumb question - I have assumed "MovieClip" is a class. Is this correct?

Next question - can you only employ a method of the MovieClip class to
dynamically created movie clip objects or even those "hand crafted" objects
that I make the old fashioned way?

Final question - In the method, I use an event handler to trigger the action I
want to run ( an "onRollOver") event. Can I write more than one method which
uses the onRollOver event handler. I won't apply the different prototype
methods to the same movie clip, I just want to know if it is possible.

Thanks,szd



Laiverd.COM
3/1/2004 7:59:41 PM
Dumb question - I have assumed "MovieClip" is a class. Is this correct?
YES (or Object, whatever)

Next question - can you only employ a method of the MovieClip class to
dynamically created movie clip objects or even those "hand crafted" objects
that I make the old fashioned way?
NO (first part of question ;-)

Final question - In the method, I use an event handler to trigger the
action I
want to run ( an "onRollOver") event. Can I write more than one method
which
uses the onRollOver event handler. I won't apply the different prototype
methods to the same movie clip, I just want to know if it is possible.
DON'T exactly understand what you mean, but think the answer is yes.

BAsically a prototype function is an extra method you add to an Object. From
that method, you can call any other method belonging to that class, whether
default or self-created.

John
--
----------------------------------------------------------------------------
-----------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
----------------------------------------------------------------------------
-----------
TUTORIALS at
www.laiverd.com
Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------

Carl Fink
3/1/2004 10:41:50 PM
[quoted text, click to view]

YES, though. Use the MovieClip.createEmptyMovieClip() method, or perhaps
even better for the OP's purpose, MovieClip.duplicateMovieClip().
--
Carl Fink
Please respond to the newsgroup only.
Laiverd.COM
3/1/2004 11:49:05 PM
You mean manually created instances not? I think yes if you register them
with the class??

John

--
----------------------------------------------------------------------------
-----------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
----------------------------------------------------------------------------
-----------
TUTORIALS at
www.laiverd.com
Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------

szd
3/2/2004 7:33:52 AM
Sorry, my question wasn't clear. Can you apply the
MovieClip.prototype.someMethod example to both manually created and
programmatically created MCs? Or can you only apply it to programmatically
created MCs?

It sounds like you cannot apply the method to a manually created MC until you
register the manually created object with the class (...er, programmatically).
Is this correct?

Thanks for all of the help.
Laiverd.COM
3/2/2004 10:36:53 AM
As far as I know that is correct, but Carl seems to have some knowledge I do
not have at which point I would love to be enlightened ;-)

John

--
----------------------------------------------------------------------------
-----------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
----------------------------------------------------------------------------
-----------
TUTORIALS at
www.laiverd.com
Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------

Carl Fink
3/2/2004 2:32:29 PM
[quoted text, click to view]

it would seem, rather, that I misunderstood the question.
--
Carl Fink
Please respond to the newsgroup only.
Laiverd.COM
3/2/2004 4:21:01 PM
;-) Tnx for this small contribution to my self esteem.

John

--
----------------------------------------------------------------------------
-----------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
----------------------------------------------------------------------------
-----------
TUTORIALS at
www.laiverd.com
Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------

AddThis Social Bookmark Button