Can we create static class in actionscript 3.0

Hi If yes please send me chunk of code .
thanks

Hi Prashanth,
There is no specifically a Static class in Flex that you can declare it at the compile time. However you can have Static variables and methods in your class and you can call them using the class name itself without creating an instance of that class.
Here is the chunk of code...
package com.constants
[Bindable]
public class ConsumerMessageConstants
  public static const UNABLE_TO_ENROLL_PLANS_MESSAGE_ID:String = "10000";
  public static const MARITAL_STATUS_UPDATED_MESSAGE_ID:String = "10001";
  public static const ERROR_IN_EDITING_MARITALSTAUS_MESSAGE_ID:String = "10002";
  public static const SMOKER_STATUS_SAVED_SUCCESSFULLY_MESSAGE_ID:String = "10003";
  public static const PASSWORD_RESET_REQUIRED_MESSAGE_ID:String = "10004";
  public static const ADDRESS_UPDATED_SUCCESSFULLY_MESSAGE_ID:String = "10005";
  public static const UNABLE_TO_REMOVE_THIS_DEPENDENT_MESSAGE_ID:String = "10006";
  public static const EMPLOYEE_SALARY_UPDATED_SUCCESSFULLY_MESSAGE_ID:String = "10007";
  public static const ERROR_IN_EDITING_SALARY_MESSAGE_ID:String = "10008";
  public static const PLEASE_SELECT_A_CONSIDER_PLAN_MESSAGE_ID:String = "10009";
  public static const YOU_MUST_CHOOSE_A_PLAN_COVERAGE_LEVEL_MESSAGE_ID:String = "10010";
  public static const PLEASE_SELECT_PLAN_TO_LOCK_PORTFOLIO_MESSAGE_ID:String = "10011";
  public static const DEEPDIVE_INFORMATION_SAVED_SUCCESSFULLY_MESSAGE_ID:String = "10012";
  public static const NO_DATA_TO_DISPLAY_MESSAGE_ID:String = "10013";
  public static const NO_PLANS_AVAILABLE_TO_ENROLL_MESSAGE_ID:String = "10014";
  public static const NO_PLANS_TO_BE_ENROLLED_MESSAGE_ID:String = "10015";
  public static const PASSWORD_CHANGED_SUCCESSFULLY_MESSAGE_ID:String = "10016";
  public static const NEW_PASSWORD_AND_CONFIRM_PASSWORD_SAME_MESSAGE_ID:String = "10017";
  public static const YOUR_DATA_IS_UPDATED_SUCCESSFULLY_MESSAGE_ID:String = "10018";
  public static const HEALTH_PLAN_IS_UPDATED_SUCCESSFULLY_MESSAGE_ID:String = "10019";
  public static const HEALTH_PLAN_IS_ADDED_SUCCESSFULLY_MESSAGE_ID:String = "10020";
  public static const MONEY_PLAN_IS_UPDATED_SUCCESSFULLY_MESSAGE_ID:String = "10021";
  public static const MONEY_PLAN_IS_ADDED_SUCCESSFULLY_MESSAGE_ID:String = "10022";
  public static const PROTECTION_PLAN_IS_UPDATED_SUCCESSFULLY_MESSAGE_ID:String = "10023";
  public static const PROTECTION_PLAN_IS_ADDED_SUCCESSFULLY_MESSAGE_ID:String = "10024";
  public static const UNABLE_TO_RETRIEVE_PATHS_MESSAGE_ID:String = "10025";
  public static function func1():Void
  public static function func2():Void
  public function ConsumerMessageConstants()

Similar Messages

  • Can I create private class in ABAP?

    Hi all,
    Can I create private class in ABAP? Please reply me its interview question.
    Thanks ,
    Vishal
    Moderator message : Interview type questions not allowed, read Forum Rules Of Engagement before posting.  Thread locked.
    Edited by: Vinod Kumar on Jan 16, 2012 12:20 PM

    Vishal , please read the rules of this forum.

  • How to create static class in Netbeans ?

    I want to create a static class in netbeans.
    But it gives error like : static modifier not allowed here. as far as java prog concern it is syntactically correct.
    for eg.
    public static class Emp
    -------body & methods
    it looks correct syntactically, but gives error in netbeans, static modifier not allowed here. Why ? How to create static class in netbeans ?

    DrClap wrote:
    I have occasionally seen the name "static class" used to denote a class whose members are all static.I think this is quite common.
    But taking the name literally and trying to declare a class "static" is a little naive."naive" or being used to doing that in C#.

  • Can't create a .class file

    Hello
    I am glade to know this forum, I bet it is muche better than my instructor, any how ..
    I am trying to do my first java program, the progam is working properly on netbeans 4.1 with jdk1.5.0, but when I go to the command prompt on windows XP it dose not work,
    other programs work in the command prompt but mine dose not
    what is good is that I know the problem, it is that I don't have the .class file I have the .java, and as I read it was supposed to be created automatically on neatbeans but unfortunatly it is not. can I creat it somehow ??!!
    any sugestions ??

    I did a google search and found this thread.
    Just to keep information at finger tips etc.
    I installed the recent JDK from JavaSun place for Windows (XP).
    I could not compile a class file from a java file in Netbeans.
    To compile a class file from a java file I needed to use javac.
    Using cmd prompt (Command prompt) I could not use Javac (I forgot about PATH vars).
    Right click my computer, properties in menu, advanced tab, Environment variables, Edit the path variable, add the directory c:\proram files\java\jdk????\bin\ (??? being the version of your jdk), then run cmd then javac works! (remembering of course to have ; seperator!)
    ADDTIONAL INFO:
    Should I set the PATH variable?
    Set the PATH variable if you want to be able to conveniently run the JDK executables (javac.exe, java.exe, javadoc.exe, etc.) from any directory without having to type the full path of the command. If you don't set the PATH variable, you need to specify the full path to the executable every time you run it, such as:
    C:> "\Program Files\Java\jdk1.6.0_<version>\bin\javac" MyClass.java
    It's useful to set the PATH permanently so it will persist after rebooting.
    How do I set the PATH permanently?
    To set the PATH permanently, add the full path of the jdk1.6.0_<version>\bin directory to the PATH variable. Typically this full path looks something like C:\Program Files\Java\jdk1.6.0_<version>\bin. Set the PATH as follows, according to whether you are on Microsoft Windows NT or 98/2000/ME.
    Message was edited by:
    g000we

  • Can I create a Class object without the VM?

    Using byte-code engineering, is it possible to create a class object?
    What about if I serialize a Class object to a file, can I byte-code engineer that and then reinstantiate it?

    Thanks I'll check it out. Basically I want to try it
    for fixing a problem of running two apps in the same
    VM.There's a world of problems when you try to run two programs within the same JVM. I wouldn't suggest even trying it unless it's a last resort. Why do you want to do that?

  • BUG??? Can't  create a class deriving from ActionForm using wizard

    Has anyone managed to create an class deriving from ActionForm class using the wizard in JDev 9033?
    When I try to do create a class by right-clicking.."New"..etc nothing happens!!

    Yeah. Same thing happens for me. I went to File->New->Web Tier->Struts->ActionForm. Can't get it to do anything.

  • What is the use of feeder class ? & can we create feeder class ?

    i have the fpm developer guide , more detail of feeder class ?

    Dear Madhukar.
    Your can see class assinment for feeder in transaction POWL_TYPE.
    Of course, you can create feeder class by yourself and assign it to feeder.
    Your should to imlement IF_POWL_FEEDER interface in your class.
    The best way for feeder class creation is to find fider with close behavior in transaction POWL_TYPE and make copy.
    For FPM applications there is the separate forum in sdn called Floorplan Manager for WebDynpro Abap,
    your should post your question there/.

  • Can I reference static class vars via a string?

    Hi all,
    I am trying to set the value of some static vars but I need to reference the class with a string rather than a proper constructor. In AS3 I can do this with:
    var ref:Class = getDefinitionByName(classDefinitionAsString) as Class;
    ref[varNameAsString] = newValue;
    I can't find an equivelant approach that will work in AS2 though. I have tried:
    var ref:Object = new [classDefinitionAsString];
    ref[varNameAsString] = newValue;
    This seems to just create an Object and as the vars that I am trying to access are static I don't really want to be using 'new' I just want to reference the vars.
    Is this even possible in AS2 and if so can anyone explain how I might do this?
    Cheers for any help

    I seem to have found a solution that works (for now at least). Not quite sure of the details
    but this does it for me.
    http://dynamicflash.com/2005/03/class-finder/

  • Can I create ppt file in actionscript 3 adobe air?

    Is it possible to create a Microsoft ppt file in actionscript 3 adobe air?

    Since you have her file, what happens if you open her file and place the image without first making and selecting a frame? Is it the same size as the image in the frame?
    >Yes when I make the frame, place the image, fit the image to the frame, it reads 42% -(then 100% when selected with the black arrow tool) this is the way I believe it should be.
    Unless the frame you create is exactly the same size as the image you place into it, it will always change size if you fit the image to the frame. If the frame is smaller, the image will have to be made smaller to fit into the frame. The same applies to a larger frame.
    I don't get the impression that you are confusing scaling with cropping, but it should be mentioned that you can have a 100% size image in a smaller frame if part of the image is outside the boundries of the frame.
    Also, I mentioned in an earlier post that the most likely error would be that the image in the original isn't the same (has the same name, but has been changed in its original program) as the image you are trying to place, even if your San Fran designer sent it to you (she could have sent you the wrong image). If you open her file and package it, it will spit out a copy of the image, which you can try placing to see if you still get the same results.

  • Can I create a class and package for my inframe AS and access it global

    Ls,
    I made an app using only inframe actionscript in a .fla;
    transfrerring variables from frame 1 to frame 2 is unreliable.
    Some sources say the persist over frames but i found that not to be reliable.
    Arrays seem to be filled with the right values. Normal int vars declared in frame 1 fail some time.
    You should have used classes i hear you say,  and right you are.
    But I didnt.
    Now im using either reloading, re-initing and/or the sharedobject.
    Anyhoe..
    Question:
    If I declare a class for my main .fla file.,
    then declare, instantiate and load the globals i want in this main class,
    will I be able to acces these variables in my main .fla timeline script?
    If so, I could slowely reconstruct my .fla into smaller objects/classes and make it a real app.
    Just starting from scratch is. welll..i dont even want to think about that.
    Highest regards,
    Mac

    Yes! I got it to run as Mobile project.
    Now, how to test on my mobile thru USB.
    I'm more/only used to working from FLASH CS5.5
    Although I like the builder, it feels really flexible, it also seems more work(yeah still lazy).
    Is there an advantage to using the builder over Flash CS?
    Thank you.. again...again
    Mac

  • Why can an inner.inner class not be static?

    First, look at these 2 classes:
    public class A1 {
    public A1() {
    new B1.C1();
    public class B1 {
    public static class C1 {
    public class A2 {
    public A2() {
    new B2.C2();
    class B2 {
    public static class C2 {
    Class A2 will compile just fine, but A1 will not saying that I can't define class C1 as static.
    Why not?
    Class C1 is not associated with an instance of B1 (because it's static), and we already have an instance of A1 (since we're in the constructor).
    Why is this so radically different that A2 (which works)?

    In class A1 the inner class B1 is just like a mehtod of class A1.
    So how we cant create static variable inside a method , similarly the class A1
    didnt accepting its inner class b! to create static class.
    (This is my assumption/view only, may be wrong)

  • Static class garbage collection

    Can garbage collector can garbage collect static classes ?.
    My doubt is that when you access a static class , that class is loaded through its class loader ( when first time that class is referenced ).
    So when did the garbage collector collects this static class ( assume that static class no longer referred ).
    Please do more information,
    What are the ways to prevent garbage collector for a particular class ( Assume that i m implementing a singleton for my java runtime)
    thanks and regards
    Renjith.

    Can garbage collector can garbage collect static classes ?. Static classes are nothing special in terms of class loading - they are only different in visibility for linking.
    Perhaps you mean static members of classes?
    My doubt is that when you access a static class ,
    that class is loaded through its class loader ( when
    first time that class is referenced ). Classes are always loaded through classloaders. Objects of those classes are allocated from the heap, and the object instances refer to the class object.
    Objects (either instances, or classes themselves) are garbage collected when they are no longer live (i.e. no live object refers to them). (This is a somewhat recursive definition, and sometimes, you can have cyclic dependencies that make garbage collection tricky, but the GC, while it has to be conservative for correctness, usually gets it right).
    So for a static member to be garbage-collected, the class has to be garbage-collected first. The class cannot be GC'ed until all references to it go away (this includes all dynamically allocated objects of that type, and the class loader that loaded that class).
    And yes, class loaders can go away, but only if they are created by your program. The system class loader (which is the default classloader you get if you don't create any class loaders of your own) never goes away, so any class loaded from CLASSPATH will never be unloaded.
    (As an example, servlet containers - e.g. Tomcat, Weblogic, etc.) allocate one or more classloaders for each webapp. When the webapp is un-deployed, the classloaders are "orphaned", and they, and any classes loaded by them (from the WEB-INF/lib and WEB-INF/classes directories) are unloaded and garbage-collected. (After all the dynamic objects of those classes are GC'ed, of course).
    >
    So when did the garbage collector collects this
    static class ( assume that static class no longer
    referred ).
    Please do more information,
    What are the ways to prevent garbage collector for a
    particular class ( Assume that i m implementing a
    singleton for my java runtime)
    thanks and regards
    Renjith.

  • Create a class

    I have been having problems with creating a class with actionscript project in flashbuilder.
    Here is a simple class but how do I use this with the skeleton code here?
    How do I arrange these files to make this work?
    Here I instatiate the class
    var p1 : Person2 = new Person( 1, "Xavi", "Beumala", "address1");
    Here is the Skeleton code
    package
          import flash.display.Sprite;
          public class atest2 extends Sprite
                public function atest2()
    public class Person2 {
              private var _id : int;
              public var name : String;
              public var surname : String
              public var street : String;
              public function Person2( id : int, name : String = "", surname:String = "", streetString="") {
                   this._id = id;
                   this.name = name;
                   this.surname = surname;
                   this.street = street;
              public function get id() : int {
                   return _id;

    Perhaps I am a bit confused because of the way you display your code here.  Are you creating the second class within the same file as the first?  If so that second class will only be accessable from within the first one and not to any code outside the primary class.  I.E. each class needs to be in their own seperate files.  If the Person class is in a different package you will also need to import it into the calling class.  (I assume you already know this but am just making sure.)
    Here is your person class slightly modified so that you can retrieve each vars data using a function and keep them private.  I would also suggest setting the data on each field using a setter function so that you can scrub the incomming data but that's up to you.
    package {
    public class Person{
      private var _ID:int;
      private var _name:String = "";
      private var _surname:String = "";
      private var _street:String = "";
      public function Person(id:int, name:String, surname:String, street:String){
           this._ID = id;
           this._name = name;
           this._surname = surname;
           this._street = street;
      public function get id():int{
       return this._ID;
      public function get name():String{
       return this._name;
      public function get surname():String{
       return this._surname;
      public function get street():String{
       return this._street;
    And to test it you can trace out the function call or (my preference) import Alert and ObjectUtil to pop up the object data in an alert box.  These are part of the Flex MX libraries though so you may not want to use them if your writing pure actionscript code.  Of course you would want to run this code out of another class.
    // import the libraries needed to use Alert boxes and convert the object to a string.  If your Person class was in another package you would want
    // to remember to import it also.
    import mx.controls.Alert;
    import mx.utils.ObjectUtil;
    //Create your Person variable to use locally.
    private var myPerson:Person;
    //A function to build a person and test what is returned by showing the details in an alert box.
    public function testPerson():void{
        this.myPerson = new Person(1,"John", "Doe", "1234 Anywhere Street");
        Alert.show(this.myPerson.id + " " + this.myPerson.name  + " " + this.myPerson.surname + " " + this.myPerson.street);
    Hope that helps.  Let me know if that does not make sense or if perhaps I missunderstood your question.
    -Joe

  • Using a dump how can i create a ER diagram

    Can any one tell me how can i draw a ER diagram automaticaly by using an existing Database.i mean i have a database with all the relationship,triggers and views now i want to make a ER diagram automaticaly by using this database ... is there any tool for this or is oracle provides any tool can any one help me out to solve this problem
    thx in advance....

    As you are asking on the Designer forum,I am assuming you have a Designer Repository set up. If this is the case,you can use Designer to capture the design of your schema and create a schema model. You can create an ERD from this schema model by using Designer's table to entity retrofit utility. Check out the Designer demos on this site for more. (http://www.oracle.com/technology/products/designer/demos.htm)
    If you do not have a Designer Repository setup, why not try JDeveloper? You can download the latest JDeveloper 10g Preview release from OTN and, using the connection node, connect to the required schema and pull the tables from your schema onto a Database diagram. JDeveloper allows you to quickly and easily review your schema model visually.
    You can also create UML Class models based on your schema.
    There are numerous demos on the JDeveloper area for the UML modeling JDeveloper offers. (http://www.oracle.com/technology/products/jdev/index.html)
    Regards
    Sue Harper

  • Help Needed in Creating Java Class and Java Stored Procedures

    Hi,
    Can anyone tell how can i create Java Class, Java Source and Java Resource in Oracle Database.
    I have seen the Documents. But i couldn't able to understand it correctly.
    I will be helpful when i get some Examples for creating a Java Class, Java Source and Stored Procedures with Java with details.
    Is that possible to Create a Java class in the oracle Database itself ?.
    Where are the files located for the existing Java Class ?..
    Help Needed Please.
    Thanks,
    Murali.v

    Hi Murali,
    Heres a thread which discussed uploading java source file instead of runnable code on to the database, which might be helpful :
    Configure deployment to a database to upload the java file instead of class
    The files for the java class you created in JDev project is located in the myworks folder in jdev, eg, <jdev_home>\jdev\mywork\Application1\Project1\src\project1
    Hope this helps,
    Sunil..

Maybe you are looking for

  • Acrobat Pro XI transposes numbers for month and day in dates when saving optimized pdf to Excel spreadsheet.

    Using Adobe Acrobat Pro XI and Excel 14.3.8 on a mac.  Saved PDF as "optimized PDF" then "save as other" > spreadsheet > Microsoft Excel Workbook. Problem: numbers in some random dates are  transposed so that month and day are reversed.  No particula

  • How do I change the password of a user in a group?

    I've forgotten the password of a user that is located in a group on my computer. How can I change the password or delete the user?

  • How to go back to Firefox 3

    I am not happy with Firefox 4 and want to go back to the previous Firefox version. I have several addins that no longer work. My tabs are no longer saved on exit. And it now looks more like IE and that was not a plus in my book. I like the uniqueness

  • A bit off topic, but not too far

    due to the lack of an autodownload for JRE 1.4 I am forced to use another method for installing it. Does anyone know a way to check what JRE version the user has using some sort of web scripting? I've seen examples of how to check within an applet or

  • To make Column editable in incoming excise invoice form

    Dear All, i want user defined matrix column field to be editable in incoming excise invoice form . i tried oMatrix.Columns.Item("U_mnfDet").Editable = true; while use this code add-on failed. Give me any another solution on this or code to make that