Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Does Flex have Abstract class

Posted on 2010-11-20
4
Medium Priority
?
1,337 Views
Last Modified: 2012-05-10
Does Flex have abstract class ?If so please can some one give an example
0
Comment
Question by:randyraj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
mawni earned 500 total points
ID: 34183059
as far as I know, Flex (Action Script) doesn't support abstract classes!
0
 
LVL 14

Assisted Solution

by:tomaugerdotcom
tomaugerdotcom earned 500 total points
ID: 34220476
AS3 does not support abstract classes directly (ie: there is no "Abstract" directive).

However, an abstract class is essentially a class for whose methods you do not define an implementation. The best practice around abstract class creation can be summed up in this example:
package {
  public class MyAbstractClass implements IMyClass {
    public function MyAbstractClass() {

    }

    public function myPublicMethod():Object {
      throw new Error("Abstract Class: you must define an implementation for myPublicMethod");
      return new Object(); // so we don't get a compile-time error
    }

    private function myPrivateMethod():String {
       throw new Error("Abstract Class: you must define an implementation for myPrivateMethod");
       return ""; / to avoid compile-time exception
    }
  }
}

Open in new window

0
 

Author Closing Comment

by:randyraj
ID: 34476156
Thanks
0
 
LVL 14

Expert Comment

by:tomaugerdotcom
ID: 34476291
I don't normally complain, but how is my answer a "C"? It's complete, it has a working code example and it addresses your question explicitly. What is your expectation of an "A" answer?
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
WooCommerce is becoming the most powerful e-commerce plugin for Wordpress. And why not. The platform comprises of numerous core plugins that may come in handy, powerful options to make your website development task much easier.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question