www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > Multimedia

    Multimedia For discussion of all manner of media (audio, video, flash) techniques, as they relate to the web.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 11-03-2009, 07:46 PM
    iCon iCon is offline
    Registered User
     
    Join Date: Jun 2009
    Posts: 4
    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
    Reply With Quote
      #2  
    Old 11-04-2009, 12:14 AM
    ssystems ssystems is offline
    Registered User
     
    Join Date: Oct 2009
    Posts: 246
    how bout making fire as a method of an interface?
    __________________
    Good Luck

    Santos Systems
    Reply With Quote
      #3  
    Old 11-04-2009, 10:27 AM
    iCon iCon is offline
    Registered User
     
    Join Date: Jun 2009
    Posts: 4
    Can you give an example?
    Reply With Quote
    Reply

    Bookmarks

    Tags
    actionscript, as3, flash, inheritance


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 05:15 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.