Derive new class from air.File

Could some kind person show me how to derive a new class from air.File using javascript.  Everything I try seems to be wrong.  Essentially I need a new class called RegattaFile that has some extra properties and methods.
When an object method to be the callback to a dispatcher - how do you do it?  When I try, the callback function gets called, but it's lost the 'this' context.
I'm getting reallty confused.

Most of the runtime classes are final for performance reasons. You generally can't (as far as I know) extend hem in JavaScript using the prototype change.
The this problem in callbacks and event handlers in JavaScript usually occurs because "this" is evaluated as the calling object rather than the class object. One way to solve the problem is to capture the this variable in another local variable in the class and use that variable in the callback or event handler. Something like:
//in class definition
var that = this;
function callback()
     that.value = nnn; //instead of this.value

Similar Messages

  • Unable to load new information from configuration file /var/ldap/ldap_clien

    Hi all,
    When I run the command "ldapclient init", I got the error message:
    # ldapclient init -a proxyDN=cn=proxyagent,ou=profile,dc=example,dc=ca -a domainName=example.ca -a profileName=UserProfile -a proxyPassword=pwd 10.1.10.50
    Unable to load new information from configuration file '/var/ldap/ldap_client_file' ('Unable to open filename '/var/ldap/ldap_client_file' for reading (errno=2).').
    Any idea?
    Thanks a lot for your help!

    Does the profile UserProfile exist on your LDAP server?
    Do the logs on your LDAP server show access problems?
    Try using -v to get more verbose output

  • Enable to  run .exe file which is created from .air file  in windows 7?

    Enable to  open .exe file which is created from .air file which is created from adt command in windows 7 .
    for run .exe file ::
    The user must right click and select "Run as Administrator" for run successfully.
    so How to remove this above permission issue in Windows 7?
    Thanks
    Sunil

    Right-click on the exe file and choose Properties.
    Switch to the compatibility tab and uncheck the box next to "Run this program as an administrator". Click "ok".

  • Makin a new object from the file in activeX

    hi
    How can i make a new object from a file in ActiveX.
    i am Making an object of the following 
    C:\Program Files\Microsoft Office\OFFICE11\WINWORD in order to use Word in LabVIEW but when i use the property nodes, then no properties are being displayed.
    so further i cannot use Microsoft word. I dont want to use the Microsoft word in the CREATE DOCUMENT option of the ActiveX. This is because , from there, i cannot access the SPEECH function of the word.
    Help me out of this
    Somil Gautam
    Think Weird

    Duplicate² post: http://forums.ni.com/ni/board/message?board.id=170​&thread.id=437939&jump=true
    Somil: if you want to add something to an existing post then reopen that post, scroll down to the last entry and press "reply". Insert your new entry and then press "Post". Create a NEW post only if you want to start a NEW topic.
    By doing so there's a possibility to start a discussion rather than a one-way one-shot conversation. This increases the chance for you to get an answer to your questions and solutions to your problems.  
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • When I click on 'open a new tab' or if I select 'new tab' from the file menu a new tab does not open. It used to.

    When I click on the tab to 'open a new tab' or when I select 'new tab' from the file menu then a new tab does not open. It used to.

    This has recently been answered below - Ask toolbar issue - this was the problem

  • [svn:fx-trunk] 5067: In preparation for adding ASDoc version tags for Flex, remove old tags from AIR files

    Revision: 5067
    Author: [email protected]
    Date: 2009-02-25 08:21:22 -0800 (Wed, 25 Feb 2009)
    Log Message:
    In preparation for adding ASDoc version tags for Flex, remove old tags from AIR files
    QE Notes: None
    Doc Notes: None
    Bugs: -
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemComboBox.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemDataGrid.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemEnumerationMode .as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemHistoryButton.a s
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemList.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemSizeDisplayMode .as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FileSystemTree.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/FlexNativeMenu.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/controls/HTML.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/FlexHTMLLoader.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/IWindow.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/Window.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/WindowedApplication.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/windowClasses/StatusBar.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/core/windowClasses/TitleBar.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/events/AIREvent.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/events/FileEvent.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/events/FlexNativeMenuEvent.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/events/FlexNativeWindowBoundsEvent .as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/events/WindowExistenceEvent.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/NativeDragManagerImpl.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/managers/WindowedSystemManager.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/ApplicationTitleBarBack groundSkin.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/StatusBarBackgroundSkin .as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowBackground.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowCloseButtonSkin.a s
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowMaximizeButtonSki n.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowMinimizeButtonSki n.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/skins/halo/WindowRestoreButtonSkin .as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/utils/DirectoryEnumeration.as
    flex/sdk/trunk/frameworks/projects/airframework/src/mx/utils/DirectoryEnumerationMode.as

    I'm also having this problem. I'm using Flash Builder 4.6, AIR 3.4 and I've made a DLL (e.g. ExtensionDll.dll) which needs to call functions in another DLL (e.g. DllUsedByExtensionDll.dll) . I've made sure my ANE is working with the ExtensionDll.dll already, so there are no issues with my actionscript code or my ANE packaging or my DLL compilation. However, once I start calling functions from the other DLL, it starts throwing me Error #3500. Even if I call this function (e.g. abc()) in ExtensionDll.dll, but I never actually use the function from actionscript, and I call another function (e.g. def()) from actionscript, the Error #3500 still appears, so it does not seem to depened on the whether the code is used or not.
    It's similar to this problem.
    http://stackoverflow.com/questions/9823504/how-to-use-external-dll-in-air-native-extension
    Does anyone have a solution or at least a way to debug this?

  • I cannot open a new browser window by double clicking Firefox icon or selecting NEW WINDOW from the file menu.

    I can open only 1 browser window and I can't open another or multiple windows by double clicking Firefox icon or selecting NEW WINDOW from the file menu.
    Looking forward to your earliest reply.
    Thanks and regards,
    Sheraz

    Do you have that problem when running in the Firefox SafeMode? <br />
    [http://support.mozilla.com/en-US/kb/Safe+Mode] <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this: <br />
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • Instantiate class from jar file

    Need a quick hand...little bit of a rush here.
    How do I go about instantiating a class from a jar file?
    If my jar file resides at c:/MyApp/MyJar.jar
    The contents of the jar file are:
    meta-inf/MANIFEST.MF
    A.java
    How do I go about creating an instance of A? I see people saying to use the URLClassLoader, but I can't find any good sample code to clarify how it's done. Assuming I already know the name of the class I'm instantiating, could someone show me how the URLClassLoader is used please? Also, please note that the jar file is NOT in my classpath, and I am not able to put it there....because it needs to be dynamically loaded as a plugin. I'm not sure if that matters or not with regards to the instantiation.

    Thanks so much for that..I think it's just about what I need. However, I'm still running into a bit of a snag. After executing the code and trying to run a method to print something out from the object I just loaded, it instead prints a memory location. So I don't think it is quite working as intended. Here's the code I'm working with at the moment....
    String jarPath = baseDir + "myApp/plugins/" + fileName;
    Manifest mf = jar.getManifest();
    Attributes att = mf.getMainAttributes();
    String className = att.getValue("Main-Class");
    //System.out.println(className);
    File file = new File(jarPath);
    URL[] urls = new URL[] {file.toURL()};
    ClassLoader loader = URLClassLoader.newInstance(urls);
    Class dynmicallyLoadedClass = Class.forName(className, true, loader);
    PlugIn plugin = (PlugIn) dynmicallyLoadedClass.newInstance();
    System.out.println(plugin.toString());  //This prints out "TMGImporter@1ce50a9" instead of what it's supposed to....Also, I am using Java 1.4.2_08 so I can't use generics. There are no error messages, just the wrong output. The jar this is using actually contains two files, besides the manifest. The TMGImporter (which Im trying to instantiate) and a TMGImporter$1 anonymous inner class. There is no package declaration on the class.
    Any thoughts?

  • Read at each new line from .txt file

    Hi guys
    I want to read from a file which I am saving using labview. What I am doing is reading 128 bytes fro VISA port and saving it in .txt file with new line constant. At some later time I want to read 128 bytes from that text file do some processing and display it. The "read from text file" vi has convert EOL but I am not able to configure it. Please help me..
    Thanks in advance
    Niladri

    Hi Newbee_3,
                                                  Do 1 thing, Read the txt file & convert this into string, Then you have all the flexibility to do whatever you want.
    Thanks
    Kudos are always welcome if you got solution to some extent.
    I need my difficulties because they are necessary to enjoy my success.
    --Ranjeet

  • Importing classes from Jar files..?

    I've run into a problem that I am having some difficulty solving. I currently trying to port a two part Java UI project from Solaris to Windows. The first is a package of core classes out of which I (successfully) create a jar file. The second is a product-specific package that imports the core classes from the package created in the first. The problem is that the second package fails to build because javac says the package from part one does not exist. Here's what I know:
    - This UI (built via a Makefile) builds successfully under Solaris
    - The jar file that I created in the first part exists in the appropriate directory.
    - When I view the contents of that jar it appears as though everything is there.
    - The jar file is appropriately included in the classpath of the second build.
    Any suggestions you could provide, or resources you could point me to would be greatly appreciated

    jh.jar is a static, 3rd party component. Doesn't seem to be giving me any grief, at least not yet.
    Correct on your second point.
    This is interesting. When I open my "CoreConsole.jar"
    file, I DO NOT see any reference to the
    com.emc.avalon.core.server package, only a list of
    class files that make up that package. You should see the .class files on the left and the relative path on the right.
    Also, all of the class file listings have absolute paths according
    to the location on my machine they were built, for example:
    m:/xpe/CoreConsole/classes/com/emc/avalon/core/server/MessageLogUtility.class
    Is this a problem..?Yes, that should be a relative path, with the first entry being the first name in the package statement. So you should see an entry MessageLogUtility.class, and the path should be com.emc.avalong.core.server.
    If you can't see the class that's missing, that would explain why the class loader can't find it, either.

  • Instantiation of a class from a file name

    Basically here's how it goes:
    I have a FilenameFilter looking into a folder for files ending on .java (java code). It stores them in a file array. I want to turn that file into a class so I can get some info from it.
                    Class c= (Class)list[j].getClass();
                    Page i = (Page)c.newInstance();
                    System.out.println("Creating "+ i.getName()+" entry on map");
                    this.putPageInMap(i);Where list is the list with the file names, Page is the Class/Object for the code and putPageInMap(i) is a method to put info from the "Page" in a map. This last method uses get methods from the Object to get the values to map.
    An Idea?
    Here's the full code just in case:
    * WWWMap.java
    * Created on February 28, 2005, 9:32 AM
    package WWW;
    import java.util.*;
    import java.io.*;
    * @author PRSJJOZ
    public class WWWMap {
        /** Creates a new instance of WWWMap */
        private Properties page= new Properties();
        private Properties SS= new Properties();
        private Properties PageNames= new Properties();
        public WWWMap() {
        public boolean pageInMap(String p)
            if(page.get(p)==null)
                return false;
            return true;
        public boolean SSInMap(String p)
            if(SS.get(p)==null)
                return false;
            return true;
        public void putPageInMap(Page p)
            System.out.println("Placing "+ p.getName() +" into map, (Values: "+p.getName()+"\t"+p.getEd()+", "+
                    p.getClass().toString());
            page.put(p.getName()+"\t"+p.getEd(),
                    p.getClass().toString());
        public Object getPageFromMap(String p)
            if(this.pageInMap(p))
                return page.get(p);
            if(this.SSInMap(p))
                return SS.get(p);
            else
                return null;
        public void saveMap()
            System.out.println("Saving...");
            try{
            FileOutputStream out = new FileOutputStream("E:/WWW/Decks/Map.txt");
            page.store(out,"Page Map");
            System.out.println("Map saved to E:/WWW/Decks/Map.txt");
            catch (IOException e1) {
            System.out.println("IO problem: "+ e1);
                e1.printStackTrace();
        public void loadMap()
            System.out.println("Loading...");
            try{
            FileInputStream in = new FileInputStream("E:/WWW/Decks/Map.txt");
            page.load(in);
            System.out.println("Map loaded");
            catch (IOException e1) {
            System.out.println("IO problem: "+ e1);
            e1.printStackTrace();}
        public void Iterate()
            System.out.println("Iterating page map...");
            int size = page.size();
            Iterator keys = page.entrySet().iterator();
            for (int i=0;i<size;i++)
                Map.Entry entry = (Map.Entry) keys.next();
                Object key = entry.getKey();
                Object value = entry.getValue();
                System.out.println("Key: "+ key.toString()+", Value: "+ value.toString());
        public void fillMap()
            System.out.println("Filling Map");
            File directory = new File("E:/WWW/Data/Pages");
            File[] list = directory.listFiles(new FilenameFilter() {
            public boolean accept(File dir, String name) {
                return name.endsWith(".java");
            System.out.println(list.length);
            for(int i=0;i<list.length;i++)
                System.out.println(list.getName());
    for(int j=0;j<list.length;j++)
    /*try{
    Class c= (Class)list[j].getName().getClass();
    System.out.println(.getClass());
    Page i = (Page)c.newInstance();
    System.out.println("Creating "+ i.getName()+" entry on map");
    this.putPageInMap(i);
    catch (InstantiationException e) {
    System.out.println("IO problem: "+ e);
    e.printStackTrace();
    catch (IllegalAccessException e1)
    System.out.println("IO problem: "+ e1);
    e1.printStackTrace();
    public static void main(String args[]) {
    WWWMap map = new WWWMap();
    map.fillMap();
    //map.loadMap();
    /*Punch p = new Punch();
    map.putPageInMap(p);
    map.saveMap();
    map.loadMap();
    map.Iterate();*/

    Runtime.exec the compiler on that .java file (you might have to parse for the package structure first). Then Class.forName() it. Then do whatever you like with it. Or, depending on the info you need, simply parse the source or the bytecode.

  • How to derive new attributes from the levels of a hierarchy

    Hello,
    I have a hierarchy based on object XYZ where each level has a specific meaning, for example: Continent, Country, Region.
    I would like to create new attributes to this object XYZ that would be derived from the hierarchy levels.
    Can anyone provide some help?
    Thanks,
    Tom

    Hi.
    If I understand correctly you want to fill an attribute of XYZ with information on where in the hierarchy the particular XYZ-value is placed?
    If so, I guess you would want attributes on XYZ for each "thing" you derive from the hierarchy levels, but at any rate, you can look up the level each XYZ value belongs to in the H table so, /bic/Hxyz. Fx value 123 is on level 5 and you get the parent ID as well.
    Keep checking the parent ID and which level it is on in order to know when you have reach the next logical "thing" and then read the value of the node and put it as an attribute of XYZ.
    regards
    Jacob

  • Automator: Create new folders from .csv file and put images inside.

    I have a challenging Automator task to achieve. I need to
    1) create a set of folders labeled with the contents in column A of a csv file. (example: column A1 JoeBrown A2 SuzyBrown A3 JimBrown etc..) resulting in
    3 folders titled JoeBrown, SuzyBrown, and JimBrown
    2) take the image represented by an image number in column B of the same csv file and move that file into the folder that was created (example: A1 JoeBrown gets a folder created by the name JoBrown and column B IMG_1234.jpg is physically moved from within the same folder as the .csv file into the folder created by column A.
    Both the csv and img files would be in the same folder. I have the script to create a set of folders from a csv list just can't complete the moving of files based on the contents of column B.
    SUMMARY: I have a folder containing several images img_0001, img_0002, img_0003 etc. and a csv file that contains columnA a series of names and column B a series of jpg image numbers. I need to have a script that will create folders labeled whatever name is in column A (see the script below. it works great!) then move the images from column B to the folders generated from column A.
    The csv script is:
    tell application "Finder"
      set mgFolder to container of mgCSVfile as string
      repeat with x from 1 to count paragraphs of mgList
        set text item delimiters of AppleScript to ","
        set mgThisList to text items of paragraph x of mgList as list
        set text item delimiters of AppleScript to ""
        set mgTopFolder to item 1 of mgThisList
        if (exists folder mgTopFolder of folder mgFolder) is false then
          make new folder at mgFolder with properties {name:mgTopFolder}
        end if
        set mgNewFolder to (folder mgTopFolder of folder mgFolder) as alias
        repeat with i from 2 to count mgThisList
          if item i of mgThisList is not "" then
            set mgSubFolder to item i of mgThisList
            if (exists folder mgSubFolder of folder mgNewFolder) is false then
              make new folder at mgNewFolder with properties {name:mgSubFolder}
            end if
          end if
        end repeat
      end repeat
    end tell
    Thanks for any help that may come my way.

    This should work
    (assumes a true "," seperated file with only two items per line, i.e.: Test,Test.jpg):
    The Run Shell Script Action is:
    cd "${1%/*}"
    while read line         
    do         
         FolderName=${line%,*}
         ImageName=${line#*,}
         mkdir "$FolderName"
         mv "$ImageName" "$FolderName"
    done < "$1"

  • Premiere Pro crashes after making a new sequence from media file

    Every time I upload a video file and make it into a new sequence, a message pops up saying, "A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available." I've already re-installed the program, and checked to see if I had SP1 which I do. The crash report says:
    Faulting application name: Adobe Premiere Pro.exe, version: 8.2.0.65, time stamp: 0x5486db4a
    Faulting module name: OpenCL.dll_unloaded, version: 0.0.0.0, time stamp: 0x50eb1a5b
    Exception code: 0xc0000005
    Fault offset: 0x000007fee3d916a0
    Faulting process id: 0x18b4
    Faulting application start time: 0x01d01f2d436f22a0
    Faulting application path: C:\Program Files\Adobe\Adobe Premiere Pro CC 2014\Adobe Premiere Pro.exe
    Faulting module path: OpenCL.dll
    Report Id: d2fb308f-8b20-11e4-80e1-d897ba034251
    Any ideas on what I can do to get it to work again??

    In light of the faulting module (OpenCL.dll) and the exception code (0XC000005), I'd start by updating the graphics driver--manually through the card manufacturers site--or, if it's a laptop, from the computer manufacturer's site. Don't rely on Windows to get you the latest. If that doesn't work, try switching the Renderer to Software Only [File>Project Settings>General].
    If those measures don't work, then check the suggestions in this article: Computer tricks and tips: How to Fix 0xC0000005 Error 

  • Getting a Java class from WSDL file

    Hello,
    I have a WSDL file at http://gis13.exp.sis.pitt.edu:8080/axis/services/BufferProcessorService?wsdlI would like to know how to get a java class file from the WSDL posted here.
    For instance, I have a class entitled InsightPoint. How do I get this from the WSDL to a java class in order to use it in my web service?
    Cheers,
    Chris

    Setareh,
    Here is an excerpt from the javadoc for ExceptionInInitializer:
    Signals that an unexpected exception has occurred in a static initializer
    or the initializer for a static variable.
    Before running your function in SQL*Plus, do the following:
    set serveroutput on size 1000000
    exec DBMS_JAVA.SET_OUTPUT(1000000)Then you may get more information. If you don't then you may find more details in the Oracle log files in the "bdump" destination. The following query will tell you where that is:
    select VALUE
      from V$PARAMETER
    where NAME = 'background_dump_dest'Then, if you are still having trouble, post the entire error message and stack trace, as well as your java code.
    Good Luck,
    Avi.

Maybe you are looking for

  • Function Module to Generate Outbound IDOC for Sales Documents

    Hello Experts, Can someone please help me, I need to know which function module to use in order to generate the outbound IDOC for sales documents.  Some of the fm's I have come across are the following: IDOC_OUTPUT_ORDERS, but actually for Purchase O

  • View albums for a photograph

    First off...I apologize...I accidentally published this in the Book Design area by mistake but I'd really like to have it here - where it should be. I couldn't find a move thread function anywhere...nor a delete one for that matter so I apologize for

  • How to set a value in dashboard prompt based on user id

    Hi i have a requirment like i need to set a dashboard prompt value based on user's login.i.e.if i login as administrator the adminstrator is belongs to circle(my requirment)then the circle name willbe displayed in dashboard prompt . if any idea pease

  • Help Regarding BAPI_EMPPERSID_CREATE

    HI TECHIES, I WANT TO POST PASSPORT DETAILS OF EMPLOYEE BY USNING 'BAPI_EMPPERSID_CREATE'. THE MANDATORY FIELDS ARE ONLY 3 PERNR, VALIDITY BEGIN DATE,. VALIDITY END DATE . I AM GETTING THE ERROR MESSAGE "428A COMPLEX APPLICATION ERROR HAS OCCURRED".

  • Why are compound clips not showing as such in FCPX any more?

    I opened a project in FCPX which has been languishing for a while. It consists if a number of compound clips. However these are not being treated as such by the application anymore. They appear as regular clips, and I have to right click on them and