How to create a new class

Hi,
I'm trying to create a new class called Questions, which has
two properties (type and condition).
The action script is saved in the folder myComponents under
the project.
When I compile the Main app, I get the following error
message:
"1172 Definition myComponents:Question could not be found."
Why?
How do you call a constructor for a new class, that is not an
extension of an existing class?
Regards
/Acke
//-----------Class----------//
package myComponents
// Import all classes in the mx.events package
import mx.events.*;
public class Question {
// Public constructor.
public var Question(){
// Call the constructor in the superclass.
//super();
// Define properties and methods.
// Define public vars.
public var type:string;
public var condition:string;
//------Main----------//
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute"
xmlns:MyComp="myComponents.*">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.CloseEvent;
import myComponents.Question;
etc, etc....

quote:
Originally posted by:
MannenMytenLegenden
Hi,
I'm trying to create a new class called Questions, which has
two properties (type and condition).
The action script is saved in the folder myComponents under
the project.
When I compile the Main app, I get the following error
message:
"1172 Definition myComponents:Question could not be found."
Why?
How do you call a constructor for a new class, that is not an
extension of an existing class?
Regards
/Acke
//-----------Class----------//
package myComponents
// Import all classes in the mx.events package
import mx.events.*;
public class Question {
// Public constructor.
public var Question(){
// Call the constructor in the superclass.
//super();
// Define properties and methods.
// Define public vars.
public var type:string;
public var condition:string;
//------Main----------//
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="absolute"
xmlns:MyComp="myComponents.*">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.CloseEvent;
import myComponents.Question;
etc, etc....
Here is a test class I created a while back, although this
one does extend Object it might help you out a bit with your
constructor issue:
package com.evilest
import mx.controls.Alert;
public class Testing_class extends Object
private var message:String = new String();
public function Testing_class(input:String) {
this.message = input;
public function showAlert():void {
Alert.show(this.message, "sup");
}

Similar Messages

  • Create a new class which extends DataGrid

    Can someone give me a simple example on how to create a new
    class that extends DataGrid. Still having a little trouble
    understanding classes.
    Thanks for any help.
    Jeremy

    import mx.controls.DataGrid
    public class MyGrid extends DataGrid {
    It is pretty much as you would extend a class in Java

  • Error during creating a new class diagram

    Hi everbody,
    I'm using JDeveloper 10.1.3.3.0 with ADF Faces and Toplink. I'm exposing to an error message in JDeveloper while creating a new class diagram. The error message is shown in dialog and saying "The name of the element can not be set to 'package name' as another element has got the same name in the package". I have controlled the name of the new class diagram. The name is unique in the package. Also I'm creating this new file in the package "tr.com.bilisim.class_diagram" and details part of this error message in dialog also says
    "BME-02002 : The name of the element can not be set to 'class_diagram' as another element has got the same name in the package"
    "BME-02002 : The name of the element can not be set to 'bilisim as another element has got the same name in the package"
    "BME-02002 : The name of the element can not be set to 'com' as another element has got the same name in the package"
    "BME-02002 : The name of the element can not be set to 'tr' as another element has got the same name in the package"
    As I understand from the error message, during creating a new class diagram from 'new file dialog' also tries to create the directories in relevant package (tr.com.bilisim.class_diagram).
    How can I solve this problem? Please urgent help!
    best regards...
    --baris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    -repost
    please urgent
    --barisk                                                                                                                                                                                                                           

  • How to create a new value for template classification??

    I want to classify a workflow template, I mean I will not classify my template as a general task. Using TA PFTC_CHG I get a list with all the entries that a customized in my system. My question is how to create a new entry in that list? System is 46C.
    thanks in advance for any hints
    Jochen Winler

    Hi Jochen,
    Follow the customiztion path:
    SAP Web Application server->Business Mgmt->SAP Business WF->Basic Settings->Maintain task classes
    (For 4.6c the path is:
    Basis Components->Business Mgmt->SAP Business WF->Basic Settings->Maintain task classes)
    By this you can maintain task class entry as you required.
    Hope this helps.
    Pls. close the thread once your problem is solved.
    Regds,
    Akshay Bhagwat
    Note: Pls. reward with points if it helps:)
    Message was edited by: Akshay Bhagwat
    Message was edited by: Akshay Bhagwat

  • Creating a new "Class type" in release procedure.

    Hi guys,
    how can I create a new <b>"Class type"</b> in release procedure?

    Hi,
    But I do not know why anyone would create a new batch type for release strategies, it is totally unnecessary and provides no additional options. The class type indicates which objects can be classified and there is already one for release strategies.
    You can create a new class or add characteristics to the existing class used in the release strategy anyway.
    Ther is also NO WAY that two classes can be used in the release strategy and this new class type would not change this either???
    Steve B

  • Creating a new class using a template class

    I am very new to Java.
    I need to make a new class by using a template class that was given to us.
    I go to File / New / Class but cannot find how to select a template class to create a new class.
    Thanks,
    gs

    gs2010 wrote:
    I am very new to Java.
    I need to make a new class by using a template class that was given to us.
    I go to File / New / Class but cannot find how to select a template class to create a new class.
    Thanks,
    gsYou need to be much more specific as to what you are trying to do.
    What is a "template class"?
    How are you trying to "go to" and "select" the template?
    Etc.

  • Creating a new class type in the classification system

    We are wanting to classify objects in a ZTABLE.  We have a home grown system for defining our customer requirements that is used as the way for the sales people to communicate to the engineering dept. what the customer wants.  A new need has come up that seems to be a good fit to be able to classify our customer requirements.  I have been trying to create a new class type that is linked to our ZTABLE.  However, even though it looks like we should be able to do this I have not been able to do it.  I ran across some documentation that seems to imply that adding a new class type used to be possible, but no longer is.
    Can anyone verify that creating a new class type is still possible to do?  We are on ECC 5.0.

    Can someone point me in the right direction as to how to create my own Class Type.  Is there some documentation as to how to dow this? Other than what is fould in SPRO I have tried and tried but no joy for me. 
    This is what I have done so far:
    in SPRO:
    1) Created an Object Key for my table ZLO_CUSTREQ.  This table has a primary key of CRQNR (custormer requirements number which is I created)  The documentation says that I need to add this key field to structure RMCLY (I did that).  BUT, it also says the RMCLY is embeded in structure RMCLX and it is not.  Do I need to modify RMCLX to add RMCLY as an append structure?
    2) Went to Maintain Object types and Class types and selected my table. Double clicked on Class Types in the Dialog Structure tree, which displayed an empty list of class types. 
    I then Clicked New Entries button and filled in the fields: Class type(Z10), Description(Customer Requirements), Table(ZLO_CUSTREQ).  in the Screens group I selected Keywords and Characteristics.  In the Functions group I selected: Standard class type and Multiple classifications. I then Clicked the back arrow.  This returned me to the Class Types list which now displayed my new class type. 
    When I click the save button it kicks me out the the SPRO menu screen and I get the warning message "Class type Z10 does not have the classification status incomplete system" . 
    Then, it won't let me re-enter the Maintain Object types and Class Types screen due to an error "View cluster is already open, go back with F3"
    When I hit F3 I am returned to the main SPRO screen.  After navigating back to the Maintain Object types and Class types I continue to get the View cluster already open error.  The only way I can get back to Maintain Object types and Class types  is to completely exit SPRO and start over.  When I do, class type Z10 is gone.
    I have repeated this procedure several times with always the same results.
    Can anyone please help me?

  • How to create a new User / Contact using APIs

    I am not able to figure out how to create a new User / Contact in WLPS using APIs
    . Is there a factory class ?
    Thanks,
    AJ

    Hi Bala,
    Try using these function modules
    SUSR_BAPI_USER_CREATE
    BAPI_USER_CREATE
    BAPI_USER_CREATE1
    BAPI_USER_INTERNET_CREATE ( This internally calls BAPI_USER_CREATE1)
    Please read the FM documentation for more information.

  • How to create a new variant and a job sheduled to use it for the ......

    How to create a new variant and a job sheduled to use it for the exisisting programs

    Hi
    1. The ALV Grid Control is a tool with which you can output non-hierarchical lists in a
    standardized format. The list data is displayed as a table on the screen.
    The ALV Grid Control offers a range of interactive standard list functions that users need
    frequently (find, sort, filter, calculate totals and subtotals, print, print preview, send list,
    export list (in different formats), and so on. These functions are implemented in the
    proxy object class. You as the programmer have the possibility to turn off functions not
    needed. In most cases the implementations of the standard functions provided by the
    control are sufficient. However, if required, you can adjust these implementations to
    meet application-specific needs.
    You can add self-defined functions to the toolbar, if necessary.
    The ALV Grid Control allows users to adjust the layout of lists to meet their individual
    requirements (for example, they can swap columns, hide columns, set filters for the
    data to be displayed, calculate totals, and so on). The settings (list customizing) made
    by a specific user are called a display variant. Display variants can be saved on a userspecific
    or on a global basis. If such display variants exist for a list, they can be offered
    to the user for selection. If a display variant is set as the default variant, the associated
    list is always displayed based on the settings of this variant.
    2. REUSE_ALV_LIST_DISPLAY
    REUSE_ALV_GRID_DISPLAY
    REUSE_ALV_FIELDCATALOG_MERGE
    REUSE_ALV_COMMENTARY_WRITE
    3. Use of Field Catalog is to determines the technical properties & add formating information of the column.
    6. all the definition of internal table, structure, constants are declared in a type-pool called SLIS.
    7.fieldcat-fieldname
    fieldcat-ref_fieldname
    fieldcat-tabname
    fieldcat-seltext_m
    5. Form user_command using r_ucomm like sy-ucomm rs_selfield type slis_selfield.
    Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length.
    In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output.
    The report output can contain up to 90 columns in the display with the wide array of display options.
    <b>The commonly used ALV functions used for this purpose are;</b>
    1. REUSE_ALV_VARIANT_DEFAULT_GET
    2. REUSE_ALV_VARIANT_F4
    3. REUSE_ALV_VARIANT_EXISTENCE
    4. REUSE_ALV_EVENTS_GET
    5. REUSE_ALV_COMMENTARY_WRITE
    6. REUSE_ALV_FIELDCATALOG_MERGE
    7. REUSE_ALV_LIST_DISPLAY
    8. REUSE_ALV_GRID_DISPLAY
    9. REUSE_ALV_POPUP_TO_SELECT
    Purpose of the above Functions are differ not all the functions are required in all the ALV Report.
    But either no.7 or No.8 is there in the Program.
    <b>
    How you call this function in your report?</b>
    After completion of all the data fetching from the database and append this data into an Internal Table. say I_ITAB.
    Then use follwing function module.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = 'Prog.name'
    I_STRUCTURE_NAME = 'I_ITAB'
    I_DEFAULT = 'X'
    I_SAVE = 'A'
    TABLES
    T_OUTTAB = I_ITAB.
    IF SY-SUBRC <> 0.
    WRITE: 'SY-SUBRC: ', SY-SUBRC .
    ENDIF.
    ENDFORM. " GET_FINAL_DATA
    The object F_IT_ALV has a field, the activity ACTVT, which can
    contain four permitted values: 01, 02, 03 and 70. Each of the
    activities 01, 02 and 70 controls the availability of particular
    functions (in the menu and the toolbar) of the ALV line item list:
    a) 01: "Settings -> Display variant -> Save..."
    b) 02: "Settings -> Display variant -> Current..." and
    "Settings -> Display variant -> Current header rows "
    c) 70: "Settings -> Display variant -> Administration..."
    Activity 03 corresponds to the minimum authorization, which is the
    most restricted one: The user can only select layouts which have
    been configured already. In particular, all of the other functions
    named above are inactive with activity 03.
    Now if you want to permit a user to change the column selection and
    the headers as well as to save the layout thus created, for example,
    but if you do not want to permit the user to administrate the
    layouts, you grant him or her the authorization for activities 01
    and 02.
    Check this link it will be mosty usefull for u
    http://www.sap-img.com/fu017.htm
    Reward all helpfull answers
    Regards
    Pavan

  • How to create an object class programmatically?

    Guys,
    I need your help. If possible with a simple example of how to do it.
    I need to create an aplication that read an specification of a repository type from a file and then creates it inside my BEA Repository. The problem are few:
    1 - How to Create an Object Class programmaticaly?
    I looked at documentation of ObjectClassOps but havent figured out how to do it.
    2 - How to Create a Property Definition programmaticaly?

    Sorry, ITypeManager only exists in 9.2. If you are working on 8.1, then the previous example becomes:
    RepositoryManager repositoryMgr = RepositoryManagerFactory.create();
    //connect to the repository
    repositoryMgr.connect();
    //get ObjectClassOps
    ObjectClassOps ocops = repositoryMgr.getObjectClassOps();
    ID repId = new ID();
    repId.setRepositoryName(repositoryName);
    PropertyDefinition[] pds = new PropertyDefinition[1];
    pds[0] = new PropertyDefinition(repId, "stringProp", null, Property.STRING, false, false, false, false, false, null);
    ObjectClass oc = new ObjectClass(repId, "myType", null, pds);
    oc = ocops.createObjectClass(oc);

  • How to create a container class for 2 object?

    I use JDK to create 2 objects, one is Customer and one is Book. I need to enqueue these 2 objects, but they canot share the same queue class. Some one told me that I can create a container class for these 2 objects but I don't know how to create it. Can some one tell me how to create the container class?

    I use JDK to create 2 objects, one is Customer and one
    is Book. I need to enqueue these 2 objects, but they
    canot share the same queue class. Some one told me
    that I can create a container class for these 2
    objects but I don't know how to create it. Can some
    one tell me how to create the container class?
    class CustomerBook{
    Book m_book;
    Customer m_customer;
    pulbic CustomerBook (Customer customer, Book book){
    m_book = book;
    m_customer = customer;
    }If you want to create a class that represents one customer and many books, do this:
    class CustomerBooks{
    Vector m_books;
    Customer m_customer;
    pulbic CustomerBook (Customer customer){
    m_books = new Vector();
    m_customer = customer;
    public void addBook (Book book){
    m_books.addElement (book);
    public void displayBooks (){
    //I assume the Book class has a toString method or something similar
    for (int i = 0;i < m_books.size();i++){
      System.out.println ("book: "+((Book)m_books.elementAt(i)).toString());

  • How to create a new custom tag in JSF 1.2

    Hi there,
    In JSF 1.2, all the classes (CommandButtonTag, CommandLinkTag, DataTableTag,...) in package com.sun.faces.taglib.html_basic are defined as final class. In JSF 1.1, we can create a custom tag that extends the tag in JSF taglib; it save us lots of time.
    Could anybody know how to create a new custom tag in JSF 1.2?
    Many thanks,
    Emily

    If I recall, it was done because how tags were to be handled in 1.2 was very different from 1.1 and it was felt that developers shouldn't rely on implementation specific classes (unless they were SPI) for several other reasons (application portability being the big one here).
    If it's felt that this was the wrong decision, please feel free to log an issue [1] against the RI (to date, no one has).
    As to the 'borked' dependency URLs, please log an issue [1] if you find these. We have nightly builds going that work from a clean workspace and checking today's result, it seems ok.
    [1] https://javaserverfaces.dev.java.net/issues

  • Service Manager 9.21: How to create a new instance of scautolistener and assign a port to it.

    Hi,
    2 instances of scautolistener are already running and i want to create a new instance of scautolistener.
    The sm.cfg file entry of scautolistener instances are:
    sm -scautolistener:12670 -debugscauto -log:..\logs\scauto.log
    sm -scautolistener:12690 -log:..\logs\scsmtp.log
    Please guide me as how to create a new instance of scautolistener.

    first, you cannot create instances of methods. but you can create instances of classes (==objects).
    the algorithm for primes does not work yet (its your work) but i inserted the code to create your object.
    import java.math.*;
    public class IsPrime {
    public boolean isPrime1(int arg){
    for(int e = 2; e < arg; e++){
    int remainder=arg%e;
    if(remainder==0){
    System.out.println("This number is not a prime number");
    break;
    else {
    System.out.println("This number is a prime number");
    break;
    return true;
    public static void main(String[] args){
    System.out.println(args.length);
    if (args.length>1){
    System.out.println("Sorry you can only enter one number");
    else{
    String sNum =args[0];
    int iNum=Integer.parseInt(sNum);
    IsPrime myPrimesObject = new IsPrime(); // here is your object
    if (myPrimesObject.IsPrime1(iNum)==true)
    System.out.println("is a prime");else System.out.println("is not a prime");
    }

  • How to use a new class in SAP XI

    Hi @,
    I have created one new class for the purpose of exception and error handling .I dont know as to where and how i should use this class within SAP XI .How can i include this class so that the effect can be viewed during runtime
    Regards

    Hi,
    In general we will create the package and import under archieves and create USDF in mapping there , you can mention as undr import that package , in code , in UDF , you can use package.class
    see the below link for more details
    /people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
    Regards
    Chilla
    <i>reward points if it is useful..</i>

  • How to Create a new column from two different result sets

    How to Create a new column from two different result sets, both the result set uses the different date dimensions.

    i got solutions for this is apply filters in column formula it self, based on the requirement.

Maybe you are looking for

  • Need Help With Basics of SQL

    Hey I'm trying to get a working understanding of some of the basics behind SQL, I've composed a few questions that I think may help me with this. Anyone that can help me with any of them will greatly help me thanks. 1. How to create synonym for table

  • New Bank A/C Creation Error

    Hi everyone, While creating a new bank Account i am getting following error.... "Unable to verify the value entered into the OrgName field. Please select the List of Values icon for this field to select a valid value." this error actually arrises whe

  • Case insensitive in-memory search

    I'm trying to create a case-insensitive in-memory search on a ViewObject. I'm using the following code for performing an in-memory search (~ filtering already retrieved rows from the ViewObject which is based on a webservice) ViewObject vo = service.

  • Premium Channels

    Verizon's Premium Channel selections are horrible. I pay for all of the premium channels.. and there is not ONE movie I want to watch.. ok so HBO added avatar.. I've watched it.. now what.. nothing.. their HBO list is short, they show the same movies

  • Login name problem

    How can I correct a problem with my login name? My problem started when I could not get InDesign CS2 to open. I ran Disk Aid to repair permissions and found my login was showing as an "illegal name." This problem apparently is only connected to the I