Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3351444
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:54:34+00:00 2026-05-18T01:54:34+00:00

I primarily work in Java, but I’ve recently started using ActionScript 3.0 for a

  • 0

I primarily work in Java, but I’ve recently started using ActionScript 3.0 for a multi-player Flash game that I am helping to develop. The project is in it’s early stages, so I’m still working on the class structure. I keep running into limitations with the ActionScript language when I try to use many of the OOP features I expect in Java.

For example:

  • I need an abstract Character class. There is no reason why Character would ever be instantiated, but ActionScript doesn’t support abstract classes. As a result my code has this comment at the top:

Character should be an abstract class,
but AS doesn’t support abstract
classes.

DO NOT CREATE AN INSTANCE
OF THIS CLASS. (Only instantiate
classes that extend this one (ex.
Player, Zombie))

  • As a result of the design of Flixel (the library we are using), I need to have a CharacterGroup class with an inner class Character so that a CharacterGroup can also contain other sprites like guns and stuff. In Java, I would use an inner class. ActionScript doesn’t support inner classes. There is something called a “helper class”, but helper classes are not inherited, which makes them useless in this context.

My question is this: Is ActionScript’s ability to deal with OOP design just less developed or am finding ActionScript so frustrating because I am trying to write it as if it were Java instead of working my head around how ActionScript was desinged?

In other words, is the “correct” way of doing OO design different in ActionScript than it is in Java?

(Note: I’m not asking for opinions about why ActionScript is better/worse than Java. I’m only asking if I am coding correctly or trying to pull too much of my experience from Java.)

Thanks!

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T01:54:34+00:00Added an answer on May 18, 2026 at 1:54 am

    AS3 is not missing features and you cannot define it as ‘less developed’.

    Firstly for your problem – there are ways around the abstract class methodology.
    For your abstract class Character – you can make it so the user developer receives an error on trying to instantiate it.

    package com.strangemother.database.abstract
    { 
    
        public class CentralDispatch extends EventDispatcher
        {
            private static var _centralDispatch:CentralDispatch;
    
    
            public static function getInstance():CentralDispatch
            {
                if(!_centralDispatch)
                    _centralDispatch = new CentralDispatch(SingletonLock);
    
                return _centralDispatch;
    
            }
    
            public function CentralDispatch(lock:Class)
            {
                if(!lock is SingletonLock)
                {
                    throw new Error("CentralDispatch is a singleton. Use CentralDispatch.getInstance() to use.");
                }
            }
    
        }
    }
    
    internal class SingletonLock{}
    

    AS you can see – this must be used by the ‘.getInstance Method’ – but to extend of that, only this class can make a new instace of itself as its the only class of which can see the internal class ‘SingletonLock{}’.
    For your purpose – you may remove the ‘getInstance()’ method and force another way the user to receive an instance of this class.

    This should also display the ability to make internal classes. These cannot be seen by any other class – only this package and the parent class CentralDispatch can use it.


    Another way you may use the abstract function method – is write then into an interface

    package com.strangemother.database.engines
    {
        import com.strangemother.database.Model;
        import com.strangemother.database.ModelSchema;
        import com.strangemother.database.events.ModelEvent;
    
        public interface IEngine
        {
            /**
             * Reads modelSchema and calls generateModel upon
             * each model found.
             * */
            function generateModelSchema(modelSchema:ModelSchema=null):String
    
            /**
             * Generate your CREATE syntax model to output to your SQL
             * 
             * If you are extending the framework with your own database
             * engine, you must override this with your own model generation
             * format.
             * */
            function generateModel(model:Model):String
    
        }
    }
    

    then at any point to use this, you implement it at class level

    public class SQLite3 extends EngineBase implements IEngine
    {
    

    now my SQLite3 class must have the methods defined in IEngine


    I much prefer to write classes with defined functions of which are overridden when implemented.

    AbstractBase.as

    /**
             * connect to the database. This is not usually
             * required as the abstraction layer should
             * automatically connect when required.
             * */
            public function connect(onComplete:Function=null):void
            {
    

    SQLite3 of which extends AbstractionBase at some point

    overide public function connect(onComplete:Function=null):void
    

    Now to refute @Allan’s comment of it being less developed (Sorry dude)

    No operator overloading – thats correct but neither does Java. it wasn’t applied to ensure AS3 was readable.

    function overloading – You can’t hard type it, but you can have function makeTea(...args) passing in as many or as little data as you wish. you’ve also got getters/setters.

    for inline functions you can create anonymous functions.

    var myFunction:Function = Function(name:String):String{ return name + ' - rocks!'; }

    You’ve got dynamic classes therefore class level overloading –


    and good example of real code is Flex Lib – it open source and you can read read how all these elements are managed by glacing through the code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've started work on a project that will be primarily acting as a Sync
My background is primarily as a Java Developer, but lately I have been doing
We primarily use an ASP.NET environment at work. Right now I'm building an application
I am primarily a .NET developer, and in that sphere alone there are at
I use Emacs primarily for coding Python but sometimes I use IDLE. Is there
I'm primarily interested in pgsql for this, but I was wondering if there is
Despite primarily being a windows user, I am a huge fan of rsync. Now,
Being primarily a C++ developer the absence of RAII (Resource Acquisition Is Initialization) in
I'm currently primarily a D programmer and am looking to add another language to
As a primarily Windows developer, perhaps I'm missing something cultural in the Linux community,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.