Import user defined actionscript classes in mxml

Hi,
I have an mxml file -- A.mxml
I have an actionscript file asfile.as  This file has a class definition. Package name - 'MyPackage' Class name - 'asfile'
I want to import this class into A.mxml
So, I write "import MyPackage.asfile.*;" in the Script block of A.mxml. Please note that both A.mxml and asfile.as are part of the same FlashBuilder project and  are present at the same level (i.e. inside the same folder) in Package Explorer.
I get a compiler error "A file found in a source-path must have the same package structure '', as the definition's package, 'MyPackage'."
Please help me solve this issue.
Regards,
Pooja

It looks like you forgot to include asfile class in MyPackage package.
package MyPackage
     public class asfile
Write import statement in MXML as 'import MyPackage.asfile;'

Similar Messages

  • How to import user defined class in UIX page?

    Does anyone know how to import user defined class in UIX page so that the class can be called in the javascript in the UIX ?
    Thks & Rgds,
    Benny

    what you are referring to is not javascript.
    it is JSP scriptlets. These are very different.
    In order to keep a strict separation between View and Controller, it is not possible to run arbitrary java code from within your UIX code.
    However, you can run java code from within a UIX event handler; see:
    http://otn.oracle.com/jdeveloper/help/topic?inOHW=true&linkHelp=false&file=jar%3Afile%3A/u01/app/oracle/product/IAS904/j2ee/OC4J_ohw/applications/jdeveloper904/jdeveloper/helpsets/jdeveloper/uixhelp.jar!/uixdevguide/introducingbaja.html
    event handler code is run before the page is rendered.

  • How to use user defined exception class

    Hi all
    I just need som help with creating a user defined exception class.
    Im writing a small/simple text editor.
    My exception class looks like this:
    public class myExcp extends Throwable
         private String message;
         public myExcep(String message)
              this.message = message;
         public void display()
              System.out.println(message);
    I would like to use it when a user tries to open a exe-file instead of a txt file.
    Here is some code from the editor:
    if (e.getSource() == open)
    saveOld();
    if (fc.showOpenDialog(null)== JFileChooser.APPROVE_OPTION)
    readFile(fc.getSelectedFile().getAbsolutePath());           
    saveas.setEnabled(true);                
    So, should I use exception here or at the readFile method?
    readfile:
    private void readFile(String fileName)
    try
    String tmp = fileName.substring(fileName.length() -4, fileName.length());
    if (!tmp.equals(".exe"))
    FileReader r = new FileReader(fileName);
    textarea.read(r, null);
    r.close();
    currentFile = fileName;
    label.setText(currentFile);
    changed = false;
    catch (IOException e)
    JOptionPane.showMessageDialog (this, "Cannot find the file " + fileName);
    Where and how do I use my exception class.
    Do I need to create an instance? Where?
    Should the exception class extend Exception instead?
    Thank you in advance /

    Extend Exception, not Throwable. It's a checked exception that way.
    Follow the Sun coding standards and make that exception class name start with a capital letter.
    When you extend Exception, override all four ctors.
    What's that display method you added? Isn't getMessage() good enough?
    You need to create a new instance just before you throw the exception, of course.
    Sounds like a terrible design, by the way. Exceptions shouldn't be used like "go to" for app logic. They should signal unrecoverable conditions. You can easily recover from the situation you've described simply by displaying a pop-up that tells the user to open only text-readable file types. I think that's a better solution.
    %

  • IMPORT USER DEFINED FIELD USING DTW

    Hi
    I want to IMPORT USER DEFINED FIELD OF SALE ORDER THAT ARE PRESENT IN ROW LEVEL AND DOCUMENT LEVEL
    USING DTW.
    SO PLZ GIVE ME SOLUTION FOR THAT.
    THANK YOU

    Hi,
    What is your B1 version and PL? Please do not use all CAPS. It is not polite.
    Thanks,
    Gordon

  • Recon and provisioning of user-defined object class ICF Active Directory

    I have followed the documentation instructions for reconciliation of a user-defined object class in the ICF Active Directory connector. I am using OIM 11gR2 with the ICF Active Directory 11.1.1.5 connector patched to 11.1.1.5.0A. The procedure states to create the new object class in AD and then change the objectClass value in the Lookup.Configuration.ActiveDirectory lookup. In my case I am using the existing ObjectClass of contact, rather than a new object class. Just for completeness I am using a clone of the AD User Resource Object which I call AD User Contact and so my lookup name is Lookup.Configuration.ActiveDirCon.
    When I changed the ObjectClass from User to Contact, and ran the Active DirCon User Target Recon scheduled job, with Object Type also = contact. The first issue I noticed was that the connector wanted a different set of lookups, which is not in the documentation. It is looking for a lookup in my Configuration lookup where code key=contact Configuration Lookup (which I should have expected since there are code keys for User, Group, and organizationalUnit). I added a line to the lookup where code key=contact Configuration Lookup and the Decode=Lookup.ActiveDirCon.CM.Configuration and then I created a new lookup by that name, assigning the 5 values to be the Lookup.ActiveDirCon.UM.xxx lookups. I did not see any need to create a new set of Lookup.ActiveDirCon.CM.xxx lookups with the exact same values.
    I re-ran the scheduled job and it ran successfully, but did not generate any Recon Events, even though I had objects in the OU and I have that same OU in the Lookup.ActiveDirCon.OrganizationalUnits lookup (from the Org Lookup Recon). Everything looks good but getting no results. Looked at the log file from the ConnectorServer and it is building the query properly and executing it properly with the correct syntax, getting no errors, but the SearchAndReturnObjects method is returning zero results.
    Looking to see if anyone has successfully reconciled in user-defined or other non-User objectClass objects from Active Directory, and if so, can you provide Lookup configuration and Connector Server information so I can troubleshoot.
    I resolved this issue by changing the recon lookups to a blank lookup called Lookup.ActiveDirCon.CM.ReconAttrMap and only added in the parameters that are used by a Contact object. Only populate the ReconAttrMap with parameters that exist for the custom object.
    Edited by: Keith Smith AptecLLC on Mar 27, 2013 6:31 AM

    Oracle Support answered this question via SR

  • How to import User-Defined Libraries to ODI?

    Hi All,
    I am trying to execute Java programs using ODI. There are many User-Defined classes imported in the programs.
    I have these User-Defined classes in JAR form.
    My ODI is setup on a linux system.
    So, where should these JAR files be uploaded in the system so that it can be imported in the Java programs?
    Please help me in resolving this issue.
    Thanks

    Hi Sutirtha,
    My ODI is installed on a linux system and I am using it on my desktop through a remote desktop connection.
    I connect to it using Tarantella account. Here I have to create a session and a view to use the ODI.
    So, when I am looking in the linux system for the <ODI_HOME>/oracledi/drivers folder, I am finding a lot of them.
    So, Please help me in locating the exact one where I need to put the JAR files.
    Thanks

  • Prime Infrastructure 2.0 Importing user-defined group rules

    Dears,
    I'm looking for a way to import rules to put devices in a user defined group.
    I can see how I can create groups and rules manually, but not how I could export or import those rules.
    Is this possible, or on the roadmap?
    Cheers,
    Michel

    In the Cisco Prime Infrastructure 2.0 Deployment Guide under LMS 4.2 Data Migration there is a way to import settings from a "special" backup made from LMS.
    This should allow for importing userdefined groups.
    Does anyone have tried this yet?
    Cheers,
    Michel

  • Importing user defined triggers

    Hi,
    I need to import multiple user-defined triggers from one DB schema to another DB. Is this possible in 11G? Can someone help me out.
    Thanks,
    Sunita

    If you need to only export and import the triggers, then you have to generate the script for all the triggers(manually or using the DBMS_METADATA.GET_DDL.
    dbms_metadata.get_ddl(object_type => 'TRIGGER', name => 'TEST_TRIGGER');
    to get the script of all the triggers associated with a table
    SELECT dbms_metadata.get_ddl(object_type => 'TRIGGER', name => trigger_name) FROM user_triggers WHERE table_name = 'EMP';
    may be this can help you.

  • Import user defined class in JSP page

    In my test.jsp page, I tried to display the user name using the value returned from a class UserInfo's static function getUsername(), like this:
    <%@page import="toystore.view.UserInfo" %>
    <html:text property="username" value="<%= UserInfo.getUsername()%>"
    Is this allowed? I tried to run it but failed, it complained:
    OracleJSP: oracle.jsp.provider.JspCompileException:
    Errors compiling:D:\java\bc4jtoystore\ToyStoreController\classes\.jsps\_web_2d_inf\_jsp\_signin.java
    Line # Error
    0 cannot access class toystore.view.UserInfo; file toystore\view\UserInfo.class not found
    64 variable UserInfo not found in class web2d_inf._jsp._signin
    If it is allowed, what is the correct way to do it?
    Thanks.
    P.S. UserInfo is compiled in toystore.view package.

    check your classpath. it looke like the compilers complaining that it can't locate your toy store package location not that there is a problem with your jsp. Hope this helps

  • TCP/IP Sockets Comunication by user defined DLL Class

    i will describe it briefly. i need to create a dll class to establish a socket communication and that dll class i should use it between the client App and the server App. but the main task is not done yet which is how to enforce editing to the display
    controls in both Apps by the Class functions. that is it. any help will be appreciated.

    "what i missing here is how to enforce any control on the server App to display the received messages once the client thread send it"
    You cannot enforce this simply by creating a class and/or putting it into a library.  Your MySocket class could generate an event when a message is received but you cannot force client code to do anything about it.  It
    is responsibility of the server code to handle the message and react accordingly.
    "I know i have to specify by coding a specific function on the server side to override another function in the created socket class and that what i'm trying to do."
    Client and server have nothing to do with each other in this case.  Your server side code isn't going to be able to do anything on the client side.  That is the whole reason you're using a client-server architecture.  You can create a client
    class that receives pre-defined messages from the server and handles them.  You can also make these methods virtual so that clients can derive from your client class and do something different for the messages it cares about. 
    //Code on server side
    public class MyServer
    public void SendMessage ( string message )
    //Send message via socket
    //Code in client side type that can be re-used by any client
    public class MyClient
    protected virtual void OnMessageReceived ( string message )
    //Do something with the message
    private void HandleMessagesFromServer ()
    //Infrastructure to monitor socket for messages,
    //determine "message" received and call appropriate
    //method for processing
    //Ex: If server sent a message containing a single string
    OnMessageReceived(stringFromServer);
    //A client may override the behavior for the message(s)
    public class MyCustomClient : MyClient
    protected override void OnMessageReceived ( string message )
    base.OnMessageReceived(message);
    //Notify my UI of the message
    Alternatively you could define a series of events that are raised when messages are received. 
    //Server code doesn't really change
    //Client code uses events instead of virtual methods
    public class MyClient
    public event EventHandler<MessageReceivedEventArgs> MessageReceived;
    private void ProcessMessagesFromServer ()
    //Responsible for watching the socket for messages,
    //translating the messages from the socket and
    //raising the event(s)
    //i.e. Raising an event
    if (MessageReceived != null)
    MessageReceived(this, new MessageReceivedEventArgs(stringFromServer));
    //Clients can handle events instead
    public class SomeUIElement
    //Some initialize method
    private void Initialize ( MyClient client )
    client.MessageReceived += OnMessageReceived;
    private void OnMessageReceived ( object sender, MessageReceivedEventArgs e )
    //Do something with message like display it
    //Note: This is probably not running on UI thread
    Either approach allows a client to react to notifications from the server.  However on the server side all you really need to do is send the appropriate message via the socket.  The client is responsible for reacting to that message in whatever
    way is most appropriate. 
    Michael Taylor
    http://blogs.msmvps.com/p3net

  • Importing User defined package problem.

    Hi All,
    I have made to package, "forum" and "utility". DBhandler java file is in "utility" package and Forumhandler is in "forum" package.
    I want to import DBhandler classes from "utility" package into "forum" package for this i write
    "import utility.*" in forum package's Forumhandler java file. But it is giving error.
    The error is -
    forum/ForumHandler.java:13: cannot resolve symbol
    symbol : class DBHandler
    location: class forum.ForumHandler
    DBHandler dbhand = new DBHandler();

    forum/ForumHandler.java:13: cannot resolve symbol
    symbol : class DBHandler
    location: class forum.ForumHandler
    DBHandler dbhand = new DBHandler();
    Do you have your visibility right?
    The class DBHandler should be declared public.
    P.s. it's a bad practice to use wildcards for imports if you just want to import a few classes, use
    import my.company.product.utility.DBHandler;instead (or something similar).

  • Importing user defined package in JDEV

    Hi,
    new to the JDEV9i tool. i have a project arranged in packages and am tryin to import this to the jdev9i. i successfully created the workspace and project and added all the packages. I can also view the package tree and package list but when i run my project the files in one directory import the files from the package structure.
    do i have to change Project properties?
    C:\jdev9i\jdev\mywork\Workspace1\Project1\websphinx\workbench\WebGraph.java
    Error(26,14): cannot access class graph.Graph; file graph\Graph.class not found

    It sounds like the Class path is not set up properly. You can configure this manually from the Project Settings dialog (Project > Project Settings). Alternatively, if you import all the packages from the top level, the path should be set for you automatically. For example, if you have your work in a directory structure like this:
    d:\mywork
    d:\mywork\toppackage
    Class1.java
    d:\mywork\toppackage\subpackage1
    Class2.java
    Class3.java
    d:\mywork\toppackage\subpackage2
    Class4.java
    Class5.java
    You can create a new project from existing source by creating a Workspace, then selecting File > New. In the Projects category there is an item called Project from Existing Source. Launch this wizard, and select the top level package from the directory listing (d:\mywork\toppackage in the example above). You then get the option to recurse through subdirectories, picking up all the classes along the way, and the paths will be set automatically. Note that you can use the Categories View button in the Navigator to view the files by package name.
    I hope this helps!
    -- Brian (JDev Team)
    Hi,
    new to the JDEV9i tool. i have a project arranged in packages and am tryin to import this to the jdev9i. i successfully created the workspace and project and added all the packages. I can also view the package tree and package list but when i run my project the files in one directory import the files from the package structure.
    do i have to change Project properties?
    C:\jdev9i\jdev\mywork\Workspace1\Project1\websphinx\workbench\WebGraph.java
    Error(26,14): cannot access class graph.Graph; file graph\Graph.class not found

  • User defined method

    Heres the score, I have created this game but I need to create a new method (which I have never done before and need some guidance) When you play the game after each shot the programme should tell you if you are hot or cold, but this is not doing it after each shot, plus at the end of the game the programme should tell the user how good they were at the game. Anyway that bit works but i need to create a method for the "how close" part of the window. Any help would be great.
    import javax.swing.JOptionPane;
    public class CourseworkPart1{
         public static void main(String args[]) {
              int randomNum, usersGuess = 0, diffNum, numGoes = 0;
              String output= "";
              String output2 = "";
              //generate a random between 1 and 10 inclusive
              randomNum = (int) (Math.random()*10) +1;
              //Allows the user to guess three times
           for (int numAttempts = 1; numAttempts <=10; numAttempts++){
              //users guess
              usersGuess = Integer.parseInt(JOptionPane.showInputDialog("please enter a number"+ randomNum));
              //difference between random number and users guess
            diffNum = (usersGuess - randomNum);
            //users guess compared to the generated random number
              if (randomNum == usersGuess){
                   output = "You won";
                   numGoes = numGoes ++;
            //call method
                   //else {
                   //     output = "The Random number was " + randomNum ;
                   //How close is the players guess
                switch (diffNum){
                    case 1:
                        output = "hot";
                        break;
                    case -1:
                       output = "hot";
                        break;
                 case 2:
                       output = "warm";
                    break;
                 case -2:
                       output = "warm";
                    break;
                 default:
                        output = "cold";
                        break;
               //Players ratings
               switch(numGoes){
                      case 1:
                           output = "champion";
                           break;
                      case 2:
                       output = "professional";
                       break;
                      case 3:
                       output = "advanced";
                       break;
                      default:
                       output = "amateur";
                       break;
              //print message
              JOptionPane.showMessageDialog(null, output, "Player's Guess",
                                                      JOptionPane.INFORMATION_MESSAGE);
    System.exit(0);
    //User defined method

    public class AATest1
         public static void displayEvaluation(String rating)
              System.out.println("You were: " + rating);
         public static void main(String[] args)
              String str = "hot";
              displayEvaluation(str);
    }

  • User Defined Function is not recognizing java class in IR.

    Hi All,
    i have written one normal java class, and i imported that java class into IR using imported Archive as a .jar file,
    it will add just two values .
    now in message mapping i created one user defined function in that
    iam trying to call this java class. while testing it is showing error as cannot resolve symbol java class name
    so experts please help me in this or it would be appreciate if any one will provide
    step by step process of one java class and one USD just to add two numbers.
    thanks in advance,
    jasmine .

    Hi,
    The steps are as follows:
    1) Create a java file with .java extension.
    2)Compile it to create a .class file.
    3) Create a zip file for this .class file using any compressed archive program(ex-winrar)
    4) Upload this zip file as an imported archive ,save and activate.
    When you go to this archive,below , you can see your .class file with the older path,for below ex:
    ObjRecord.class     jxl/biff/drawing/
    you have to give following entry in imports section:
    jxl.biff.drawing.ObjRecord;
    Please try this and let us know if this works.
    Thanks.
    Regards,
    Shweta

  • Java class within user defined function

    Hi all,
    in order to have a JDBC-lookup java function "globally" in XI i created a java class and imported it to XI as an imported Archive (i have to do the lookup within a mapping). I then can include the class to a user defined function. However the problem is now that this works fine within one Software Component Version but when i want to use it in several SWCV i have to import the jar to every SWCV. My question is therefore if anybody has already had this problem and if there is another possible solution - maybe deploying the class to XI using SDM?
    Thank you for your thoughts.
    Mathias

    hi Markus,
    >>>>My question is therefore if anybody has already had this problem and if there is another possible solution - maybe deploying the class to XI using SDM?
    if you do that then you'll have to remember about it
    every time you import a new SP or upgreade your XI
    this is not standard so SAP may always overwrite it
    and your interfaces will stop working
    consider importing it for every SWCV  
    Regards,
    michal

Maybe you are looking for

  • Libreoffice crashes after plug in external monitor

    Hi I have XFCE. When i plug in external monitor i get a crash from libreoffice. The message says that libreoffice has crashed and that documents will be saved. Has anybody got simillar issues? LibreOffice error message: Due to an unexpected errot, Li

  • Boot Device Not Found. Please install an operating system on your hard drive. Hard Disk - (3F0)

     Model HP-G72-257CL. Purchased new Operating System & Hard Drive from HP.  Error message Boot Device Not Found popped up after attempting to  installing hard driveon laptop

  • Rotating Graphs in Pages 5.0?

    Hi guys. I need to rotate a chart for my physics lab report (scatter graph made in Numbers 3.0), and this was available in the previous version of Pages, but in the new version, it doesn't seem to be available. Could anyone help me out with this? Jus

  • How to open a swf in a new window

    I have a button in one swf that I'd like to open another swf in a new window. What's the easiest way to accomplish this task?

  • CUE AA redirect to external call not disconnecting

    Hello, I have a problem with cue AA redirect to external number not disconnecting only when the external number does not answer; if the external number redirected to does answer, the lines disconnects normally. My FXO config is as below for all the l