A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Issue - Can I have multiple MC's with same Class ?

  1. #1
    Senior Member SlimSlaby's Avatar
    Join Date
    May 2005
    Posts
    158

    Issue - Can I have multiple MC's with same Class ?

    I've begun working with AS3 on a few games, and I've run into a problem.

    In AS3, you are only able to link 1 MovieClip to any given class. What I am trying to accomplish is to allow multiple movieclips to utilize the same class.


    So for instance, I'd like to have different Ant movieclips that utilize the same Ant class. Currently my workaround is to have all 5 ants in the same movieclip on different frames and then flip the frame based on which ant I am using.

    But... is it possible to do it the way I want to ?

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You need to use inheritance. I have attached an example , which shows that.
    Attached Files Attached Files
    - The right of the People to create Flash movies shall not be infringed. -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center