oop - Need to 'extend' various classes in ActionScript for one class -


I have a class which needs to use the graphics methods of the Sprite category, so I have said that using Sprite While doing the classroom, though I have my own custom class, the first class needs to expand to use the properties and methods written in it.

Of course I can increase my custom class by Sprite and use both the first grade, but my custom class has nothing to do with Sprite and should not be extended.

How do I use the properties and methods of my custom superclass and will I use the graphics properties of the Sprite class in a sub-class?


My simple example:

My custom class is renamed to MovingObject.as and has two variables and some methods included Moving object inherited by a subclass is intended to keep information about the speed and acceleration of your child's orbits.

Sprite has been expanded to create a child class 'racecaper' using given given graphics methods, but allows me to move the object speed and accelerate the racecar to get it.

How do I give both the characteristics of expanding racecrafts with Sprite and My Moving Object Class? Class = "post-text" itemprop = "text">

If your first class should be added to the display list, it will almost certainly increase the Sprite . How can you create the functionality of your second class, perhaps it will depend on the functionality that is the functionality (if you can give a brief explanation which is very easy to answer the question) < / P>

However, in addition to the extension (which you have rejected), I can think of two other ways:

  1. Give your first class of your custom class one Through Setter or your Rtham category known to immediately implement the direct custom class as the
  2. Create static methods of your custom class so that they can be turned on without its starting square. This is usually a method for use.

    Update:

    I think you can attach unnecessarily to this matter, as long as you Moving Object that are not displayed visually on screen (which is unlikely for me) If not, then it is fully valid for the moving object to increase motivation , effectively enlarging it with increasing functionality, and it is expanding your Creating base class for the race card (and any other moving, visible objects)

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -