Export for AS: Class vs Base Class

when i export a movie clip for actionscript, what are the differences between Class & Base Class?  i see most tutorials change Base Class and leave Class as the name of the movie clip defined in the library.

the main use of the base class is to extend it so many different classes can share it's functionality.
but even when not needed as a super class, the base class is also helpful when you want to instantiate many different objects using code and you don't want to write/compile many different class files.
if flash finds you failed to write a class file (for every class exported for actionscript), flash writes a default class files for you.

Similar Messages

  • How to call derived class to base class

    Hello everybody,
    I create a GUi application in java swing. Now i want to navigate between the screen but the timing between the screen is very slow bcoz i imported the class from package to another package. Now i want to extends one package to another package to reduce the navigation time but it saying error bcoz i cant able to call my derived class to base class. if anyone know the answer for this please answer this immediately.
    If any other method is there to optimise the navigation time please tell me
    by
    (kamal)

    Sorry, I've got major difficulties understanding your query:
    I create a GUi application in java
    ication in java swing. ok
    Now i want to navigate between
    the screenwhat? switch screens? display a different dialog?
    but the timing between the screen is very
    slowtiming? do you mean the time it takes to display a different dialog?
    bcoz i imported the class from package to
    another package.how did you come to the conclusion that that is the reason for the slowness? Did you do any profiling or is this just guess-work?

  • Owner Class and Base Class ?

    hi,
    What is an Owner class and base class?
    thanks,
    Hanu

    Hi,
    the question is related to oracle java class or samething else?
    I dont understand your question.
    Regards,
    Tom

  • Set fields of derived class in base class constructor via reflection?

    Does the Java Language Specification explicitly allow setting of fields of a derived class from within the base class' constructor via reflection? The following test case runs green, but I would really like to know if this Java code is compatible among different VM implementations.
    Many thanks for your feedback!
    Norman
    public class DerivedClassReflectionWorksInBaseClassConstructorTest extends TestCase {
    abstract static class A {
        A() {
            try {
                getClass().getDeclaredField("x").setInt(this, 42);
            } catch (Exception e) {
                throw new RuntimeException(e);
    static class B extends A {
        int x;
        B() {
        B(int x) {
            this.x = x;
    public void testThatItWorks() {
        assertEquals(42, new B().x);
        assertEquals(99, new B(99).x);
    }

    why not just put a method in the superclass that the subclasses can call to initialize the subclass member variable?In derived classes (which are plug-ins), clients can use a field annotation which provides some parameter metadata such as validators and the default value. The framework must set the default value of fields, before the class' initializer or constructors are called. If the framework would do this after derived class' initializer or constructors are called, they would be overwritten:
    Framework:
    public abstract class Operator {
        public abstract void initialize();
    }Plug-In:
    public class SomeOperator extends Operator {
        @Parameter(defaultValue="42", interval="[0,100)")
        double threshold;
        @Parameter(defaultValue="C", valueSet="A,B,C")
        String mode;
        public void setThreshold(double threshold) {this.threshold = threshold;}
        public void setMode(String mode) {this.mode = mode;}
        // called by the framework after default values have been set
        public void initialize() {
    }On the other hand, the default values and other metadata are also used to create GUIs and XML I/O for the derived operator class, without having it instantiated. So we cannot use the initial instance field values for that, because we don't have an instance.

  • Extending class + accessing base class's children

    Hello.
    I'm trying to create a sort of info and tool panels for a project, similar to the ones on the Adobe Suite's products. They'll have a tab that you can double click to open or close them and the panel's title will be on this tab.
    So I created a MovieClip called MainPanel and inside it I placed a textfield called txtTitle and a rectangular MovieClip called mTab. I duplicated the MainPanel twice on the stage, called them PanelA and PanelB, and added individual elements to them, but kept the txtTitle and mTab.  I edited PanelA and PanelB's linkage options to link them to specific custom classes.
    First I created a base class for the MainPanel.
    package com.panels{
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import fl.text.TLFTextField;
        public class MyPanel extends MovieClip {
            public function MyPanel ():void {
                txtTitle.mouseEnabled = false;
                mTab.doubleClickEnabled = true;
                mTab.addEventListener(MouseEvent.DOUBLE_CLICK, clickedPanel);
    And then the classes for Panel A and B, which extend the MainPanel.
    package com.panels{
        import com.panels.MyPanel;
        public class PanelA extends MyPanel {
            public function PanelA ():void {
    When I test the movie, I get an error saying "Access of undefined property txtTitle" (and the same for mTab). If I just link PanelA to the MainPanel class it all works - I got it to open, close, dragged it with the mouse... I can access mTab, txtTitle and anything else already on the stage. But if I extend the class, I no longer can. Does anyone know why this happens and the best way to get it to work? Thank you.

    Still didn't do the trick, I even tried building a project from scratch with just the classes I mentioned in my example and nothing else, and then a second version where I have all files on the same directory. Not sure if it might have something to do with this being for an AIR app.
    I have found a solution that seems to be working. My new MyPanel class:
    package com.panels{
        import flash.display.MovieClip;
        import flash.events.MouseEvent;
        import fl.text.TLFTextField;
        public class MyPanel extends MovieClip {
            private var _title:TLFTextField;
            private var _tab:MovieClip;
            public function MyPanel ():void {
                _title = MovieClip(getChildByName("txtTitle")); //If I don't cast the result as a MovieClip I get an error
                _tab = TLFTextField(getChildByName("mTab")); //Same for the TLFTextField
                _title.mouseEnabled = false;
                _tab.doubleClickEnabled = true;
                _tab.addEventListener(MouseEvent.DOUBLE_CLICK, clickedPanel);
    Still I'd like to understand why I need to go through these hoops so I don't make the same mistake again.

  • Objective-C class without base class

    I'm in doubt about the sense of letting a class to have no base class (neither NSObject nor Object).
    I have observe that in this case you could not send messages to the object, so you can't use:
    Point* p =[[Point alloc]init];
    But you can use:
    Point* p = (Point*) malloc(sizeof(Point));
    And access attributes of the object:
    p->x = 5;
    Is there any other advantage of using classes in this way (instead of a C struct)? Why language designed allowed this feature?
    Greeting: Fernando

    I would guess that it is because of it's C roots. Essentially all objects in obj-c are C structs. There is nothing really preventing a person creating their own NSObject like root class and using that in their framework.

  • Can a derived class catch base class object

    can a derived class object catch a base class object
    e-g if i have a class
    class Test {
    // code
    }and
    class Test2 extends Test {
    }and lets say there is a method that return an object of Test (base class), so is it possible to write
    Test2 t=getTestObj(); // i-e subclass holding base class objectif its not.. how can we do so? so that derived class should hold base class object....

    sorry..
    here is how it goes
    i have a function a class
    public Test getObj() {
    // code
    }The constraint is that i cant change the implementation of this above function.
    Now when i call this function, it returns me a Test object. But i cant do
    Test t=getObj();because the Test class is written purely in java whereas i want to use write a new Test class that implements the same functionality [using the above given function] in JNI.
    so what i did, i created a new package [nativ] and created a class "Test" in that. But since i have to use the function that returns me Test and not "nativ.Test", so what i did, i inherited nativ.Test from "Test" so that the object might resolve the reference.
    So this is it.. that i cant modify the function and i need some way to do it.. plz reply

  • BUG? Default Project Properties, Business Components: Base Classes

    Is it just me, or is there a bug in the Default Project Properties Dialog when attemptiong to specify custom classes for the Business Component Base Classes.
    I have extended EntityCache and can successfully specify it as a base class via the Project Properties dialog, but in Default Project Properties, I get an error stating: "The selected class is not a valid superclass. Either is does not implement the interface oracle.jbo.server.EntityCache or it has an invalid modifier".
    FYI: My custom library has been added to the Default Project Properties->Libraries.
    Any help?

    Does it work if you use the:
    Tools | Preferences... | Business Components > Base Classes panel instead?

  • Introspector calling the Base Class multiple times

    Hi
    I am having a Java Bean C (which extends B which in turn extends A) ...and each of these Classes have the BeanInfo classes .. ABeanInfo , BBeanInfo , CBeanInfo....
    And i had written my beaninfos such a way that they are optimised by extending the basebeaninfo and calling super.getPropertyDescriptors and adding them to the Descriptoirs of extra methods like
    Class A
    private String name;
    public void getName()
    Class B extends A
    private String city ;
    public void getCity
    class ABeanInfo extends SimpleBeanInfo
    public PropertyDescriptors[] getPropertyDescriptors()
    // Got the property descriptor for name
    // return by forming array
    My Class B bean info will look like this
    class BBeanInfo extends ABeanInfo
    public PropertyDescriptors[] getPropertyDescriptors()
    PropertyDescriptors[] baseDesc = super.getPropertyDescriptors();
    // Get the property descriptor for City
    // Club the base class desc and the new ones added
    // return by forming array
    But when i use Introspector.getBeanInfo(B.class) , the A.getPropertyDescriptors method is getting called twice (One internally by the introspector and the other when my super.get...)
    How can this be avoided ?? Ofcourse after the first time , the introspector is caching the instances of BeanInfos...
    If this is the implicit behaviour , can i change my BeanInfo classses in such a way that it won't get called

    Why is this a problem?

  • Base Class vs Class in the linkage panel

    I have 2 dozen movie clips in the libarary that are all the same structure, but with different content, and I wanted to write a single class that would work for all of them. Popping this in as the base class worked great until I wanted to pass in some arguments to the constructor. Suddenly, it seems I have to write a "shell" class for each asset that contains nothing but super(arg1,arg2) in its constructor (all 24 of them - ugh!). This ends up being really clunky. Is there any way around it?
    Also - in discussing this with a colleague, an issue came up about the exact relationship between the items in the Class and Base Class fields in the linakge panel for a library asset. What exactly is therelationship? Does the class always extend the base class, or is there something else going on?

    undo whatever you did that caused that problem.  you probably assigned a class name that matched one of your base classes.

  • AS3: How to create one base class for classes loaded in multiple swfs?

    Our application have 3 different modules and all use
    fscommand and ExternalInterface alot. Now the problem is we are
    combining all those modules, but they all will reside in different
    swfs. Is there any way that they extend to same base class and its
    static members have only one instance accessible by all
    three?

    Hi,
    You can achieve this via Workshop 9.2 by using the exported Ant script for your project as follows:
    -Ensure that all Jars needed to resolve com.bea.p13n.property.EntityPropertyManager (this particular class is found in weblogic92/common/p13n/lib/p13n_ejb.jar) and all referenced classes are added to the Java build path for your WebLogic EJB project (Properties->Java Build Path->Libraries)
    -Export the "Workshop Ant Script" for your WebLogic EJB project (File->Export->Workshop Ant Script); this will generate a "build.xml" Ant script under your project root directory.
    -Edit this default build script as follows: in the call to the "ejbgen" task within the "build" target, add the attribute: propertyFile="ejbgen.properties"
    -Create a file "ejbgen.properties" under the root of your WebLogic EJB project and add the following entry:
    YourSessionBeanClassName.remote.baseClass=com.bea.p13n.property.EntityPropertyManager
    -Add a "<path refid="java.classpath"/>" within the "<classpath>" for the "java" task element that calls "weblogic.ejbc" (this will ensure that the p13n classes are resolved by EJBC)
    Follow the instructions for executing the Ant build script found here: http://edocs.bea.com/workshop/docs92/ws_platform/ideuserguide/conUseCustomAntBuild.html
    For more information on the EJBGen property file support, see: http://e-docs.bea.com/wls/docs92/ejb/EJBGen_reference.html

  • How to specify a base class for Remote Interface in Workshop 9.2? -- URGENT

    Hi,
    I am trying to create a UUP EJB in WebLogic 9.2 workshop. I am using @FileGeneration to create my home & remote interfaces. And the generated remote interface is extending javax.ejb.EJBObject;I want my remote interface to extend com.bea.p13n.property.EntityPropertyManager which in turn implements javax.ejb.EJBObject. Can someone tell how i can do it in Workshop?.
    I came across Predefined Variable: remote.baseClass and as per docume
    ntation..."If specified, the value of this variable will be used as the base class for all generated remote classes. Where i should specify it?. @FileGeneration does nt have any option for it. Any help is grtly appreciated.
    Following are my code snippets:
    IMPL Class
    @FileGeneration(remoteClass = Constants.Bool.TRUE,remoteHome = Constants.Bool.TRUE, localClass = Constants.Bool.FALSE, localHome = Constants.Bool.FALSE,remoteClassName = "MyEntityPropertyManager",remoteHomeName = "MyEntityPropertyManagerHome")
    public class MyEntityPropertyManagerImpl extends GenericSessionBean implements
              SessionBean {
    //code
    }

    This question was posted to both the bea.workshop.developer.general and weblogic.developer.interest.workshop (I had replied to the later on 10/19); after seeing an identical question today on this list want to include a reference to that reply here:
    http://forums.bea.com/bea/message.jspa?messageID=600044925&tstart=0
    -Rob

  • Proxy for base class

    I attempted to write a proxy for a base class on an Entity today and got an error saying this wasn't supported. Are there any plans to support this in the future?
    Trevor

    Hi Trevor,
    No, there are no plans to support that. The proxy mechanism as designed isn't appropriate for a base class. The proxy represents a complete instance, and is responsible for creating the instance. That approach won't work at all for a base class.
    Can you describe your use case in more detail? Perhaps I can suggest another approach.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Using base classes for common attributes

    Can TopLink handle use of non-mapped abstract base classes? There are a number of fields that are common to each and every one of my domain objects which, following good OO design principals, are moved up to a common superclass. So I have:
    public abstract class AbstractDomainObject
    private Integer id;
    private Date dateCreated;
    private Integer creatorId;
    private Date dateModified;
    private Integer modifierId;
    // ... appropriate attribute accessors
    Then a concrete class which gets mappped in Workbench:
    public class Address
    extends AbstractDomainObject
    ... specific attributes
    I tried mapping all the specific attributes explicitly defined in the Address class and then using "Map Inherited Fields > To SuperClass" in Workbench. However, when attempting to test my mappings in the SessionConsole, only the attributes explicitly defined on Address are present in the SELECT clause.
    Can what I am trying be done? If so, how?

    Steve,
    What you are trying to do is very common and the process you described is exactly how map the class. I will summarize a couple of points for mapping this scenario.
    1. You only need to import Address in and map it. If AbstractDomainObject is imported into the Mapping Workbench make sure that it is disabled. The abstract class is only required on the project's CLASSPATH.
    2. You should not enable inheritance for the Address class. Inheritance is for situations where the abstract base class has its own independent table. I am assuming that your Address class has its own table that contains fields for all of the attributes it needs along with those of the abstract base class.
    Assuming these conditions are met then TopLink will work fine with you Address class just as if it had all of the inherited attributes directly.
    If you are still having trouble take a look through your generated project (XML or Java) to ensure that mappings exist in Address for All attributes. If the project looks good then I am at a loss. Customers have been using this pattern of use for over 5 years with TopLink and Java inheritance.
    Cheers,
    Doug

  • Unable to locate specified base class 'resources.style1.HelpButtonIcon' for component class

    Hi,
    I have a Flex (4.1.0) project, which has many skinnable custom components. The application allows a user to choose another style which changes these skins via loading a new compiled CSS. These non-default skins are in a separate Flex project.  I've not had a problem with this method until now.
    The custom component I am skinning contains several icons which are defined in the component like this:
    [SkinPart(required="true", type="mx.core.IVisualElement")]
    public var componentIconHelp:IFactory;
    then I use the iconRendererFunction to return the appropriate component part:
    private function iconRendererFunction(item:Object):IFactory
         //truncated method    
         return componentIconHelp;
    Within the skin for "style1", I then have
    <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
         xmlns:s="library://ns.adobe.com/flex/spark"
         xmlns:mx="library://ns.adobe.com/flex/mx"
         xmlns:style1="resources.style1.*">
    <!-- host component -->
    <fx:Metadata>
         [HostComponent("myApp.components.ButtonComponent")]
    </fx:Metadata>
    <fx:Declarations>
         <fx:Component id="componentIconHelp">
              <style1:HelpButtonIcon />
         </fx:Component>
    </Declarations>
    When I try to compile this, I get the "Unable to locate specified base class 'resources.style1.HelpButtonIcon' for component class 'resources.style1.ButtonComponentSkinInnerClass0'" error.
    If I remove the HelpButtonIcon from the <fx:Component> declaration, and just put it in the main body of the skin, it compiles and renders, but I need it to be a component (there's multiple components I have to choose from to display, similar to the ButtonBar skin).
    Any ideas why it's not compiling and what I need to do to achive this?
    Thanks

    Thanks, one step closer (or further away :-)
    I tried adding the airspark.swc to the library path for the project and it made no difference so I added:
    -external-library-path /Applications/Adobe Flash Builder 4/sdks/4.0.0/frameworks/libs/air/airspark.swc
    to the external tools configuration and now get the error:
    command line: Error: unable to open 'Flash'
    The project itself runs fine, it's only the ASDocs that's causing problems.

Maybe you are looking for

  • HT201263 how to fix error 9 for recovery

    How do I fix error (9) for recovery in i tunes?

  • Shortcut for switching / tabbing between open documents?

    Hi. In Mac OS in general, you can switch between open documents or windows in the same program via the shortcut COMMANDO + >. Like for instance different windows in Firefox. But in Numbers and Pages, this means zoom in or out. Does anybody know a sho

  • IMovie-Problem with hangups.

    I just upgraded to IMovie 11 from IMovie 8. I only have about three short projects (15 min each) and one longer one (5 1/2 hours worth of clips) in IMovie, so it shouldn't be too slow. I had no problems with hangups working on 8, but immediately had

  • JDBC BatchUpdateException

    I have the following problem: If I try to insert values to a database table with a batch update and somehing goes wrong during statement.executeBatch() (e.g a unique constraint is violated), the Oracle driver throws a SQLException instead of an Batch

  • Changing text size of radio button label

    Is it possible to change the size of the text of the label of a radio button component? I'm trying to create a questionnaire for youngsters and need much larger text... I know I could have no label and a text area but the text area would not be "clic