|
|||||||
| Multimedia For discussion of all manner of media (audio, video, flash) techniques, as they relate to the web. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
as3 evaluating
Hi
In the Rifle class I want to let its parent (Weapon class) to know which bullet class to use. I was thinking of the following: ==== class Weapon extends MovieClip { public var bulletClassName : String public function fire () : void { var bullet:Bullet = new bulletClassName(); } } class Rifle extends Weapon { public function Rifle () { bulletClassName = "RifleBullet"; } } var rifle:Rifle = new Rifle(); rifle.fire(); === How can I do an evaluation on "new bulletClassName()"? Or does anyone has another solution? greetings |
|
#2
|
|||
|
|||
|
how bout making fire as a method of an interface?
|
|
#3
|
|||
|
|||
|
Can you give an example?
|
![]() |
| Bookmarks |
| Tags |
| actionscript, as3, flash, inheritance |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|