Calling a function from an external AS file

I create a AS file that contains my DAO functions. I imported
the class into my application, but what do I have to do to call one
of its functions?
In my ProjectDAO.as I have updateProject(projectID:Number),
in my mxml I have a button that calls that function but I get a
'function cannot be found' error.
What am I missing?

In your first post you said you wanted to call
updateProject(projectID:Number).
In your latest post you have this:
<mx:Button label="New Project"
click="PDAO.addNewProject(event)" />
I think it should be this
<mx:Button label="New Project"
click="addNewProject(event)" />
Where addNewProject is not in class ProjectDAO, but is the
click handler function in the mxml file.
Then within that addNewProject click handler you call
PDAO.updateProject(projectID).
If in fact addNewProject is another method in class
ProjectDAO, and is an instance method, then create a click handler
like myClickHandler(event) and do this:
<mx:Button label="New Project"
click="myClickHandler(event)" />
and here is the handler function:
private function myClickHandler(e:MouseEvent):void{
PDAO.addNewProject(projectID);
If instead addNewProject is a class method, call it like
this:
private function myClickHandler(e:MouseEvent):void{
ProjectDAO.addNewProject(projectID);
Your actual click handler function may differ, but these are
some hints. If none of this makes sense, start by reading FB3 help
topic Flex Programming Elements and all its sub-topics, compiling
all the sample apps, otherwise you will find it difficult to
proceed with Flex.

Similar Messages

  • Calling a variable from a external txt file that is equal button name

    Hello
    I have a variable in an external txt file that is = the name
    of my button. I have loaded the file in to flash in an object
    called my_lv.
    How do I make line three in the code valid ?
    _root.map.name1900.onRollOver=function() {
    this._alpha=20;
    txName=my_lv.+(this._name); // this line is wrong!! I need
    to place name1990._name in side the ().

    do you have an object called "my_lv" and a child object have
    named as "name1900" . ie "my_lv.name1900"\
    if i am right then...
    >> txName=my_lv.+(this._name); //
    should be
    txName= eval("my_lv."+ this._name)

  • Can LabVIEW call a function from a .sys file or is LabVIEW limited to dll access?

    My vendor has sent me a .sys file with functions accessing their hardware.  Can i call these function from labview directly or do I have to wrapper the .sys with a dll?

    Well a sys file is a kernel device driver. LabVIEW does not have any direct way of accessing such a driver. The way kernel drivers are accessed is usually through a DLL which makes calls to WinAPI functions such as CreateFile(), ReadFile(), WriteFile(), CloseHandle() and DeviceIORequest(). Since these WinAPI calls are basically just DLL calls too, you could theoretically use the Call Library Node to call them and access the kernel device driver in such a way.
    However for any kernel device driver with more than one or two device driver calls, it will certainly be easier in terms of development, debugging and maintenance of the code, to write actually a dedicated DLL in C/C++ for this device driver and access that DLL from LabVIEW, especially if you consider the LabVIEW datatype limitations when designing the DLL interface (Basically this same DLL can then be called from any other Windows development environment, be it Visual Basic (similar datatype limitation as LabVIEW), Delphi, (Visual) C, LabVIEW or also various scripting environments like Python and Lua.
    Some of the necessary WindAPI calls are rather involved and pose quite a bit of trouble to get the parameter data right in LabVIEw.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Can Any one tell me what is the step in calling a function from a *.lib file in Labview application

    Hi, I am working on Labview 8.0.
    I am trying to  communicate to a thrid party HW using the driver file he has provided to me.
    The drive file is a *.lib file.
    I am unable to call the function from the lib file.
    I could get only from a DLL.
    Pls help .
    Regards
    -Patil

    patil wrote:
    When it is possible in Lab Windows, why calling a function from a static library is prohibited?
    I was trying to use Function node, but found that it is only for functions from a DLL file.
    Will CIN be useful.? 
    LabWindows is not the same as LabVIEW. LabVIEW cannot call .lib files. LIB files are intermediary products and you need to use a wrapper DLL that's compatible with the object format of the .lib file. It's as simple as that. LabWindows creates C application and from that perspective is no different than a regular C
    compiler. That's why you can call .lib files because that's how .lib
    files are used.
    A CIN, as pointed out, is something completely different and will not help you.  

  • How do I call a function from another file?

    In MainView.m I have one function -(void)goTell;
    I want to be able to call the function from SecondView.m. How do I do this?
    I have declared the function in the MainView.h and added #include MainView.h to SecondView.m, but it still doesn't work.
    This code crashes my program (for some reason this board takes away my brackets... assume the code is written correctly):
    [[MainView alloc] init];
    MainView *myMainView;
    [myMainView goTell];
    By the way... goTell has nothing in it. It's just a blank function for testing purposes.
    Ethan

    BTW - Wrap your code like this in posts tags so it stay readable.
    put code here
    Your code needs to be:
    MainView *myMainView = [[MainView alloc] init];
    [MyMainView goTell];

  • Calling a function from a DLL, exectution in background mode.

    Dear Experts,
    We have created an ABAP report the calls a function from a DLL file. If the report is executed in on-line mode the program calls and executes the function from the DLL, but if the ABAP programa is executed in background mode it doesnt calls the DLL function.
    Do you know a way to solve the problem when executing in background mode?
    Best regards.
    Antonio

    Hi Gabriel,
    Let me explain in details about my DLL function.
    We are importing the business partners from legacy system into the SAP CRM system, so at the moment we created the BP master data via BAPI, I get the name of the BP and this moment I call the function in the DLL file. I export the parameter name and I receive back a simplified string with the name reduced to a code. This code I get back from the dll it is insert in a Z table, so there is no interaction in the screen, all must be executed in background mode, because there are a lot of business partners to be converted in SAP system.
    I am sending my code for your considerations.
    Instancia a DLL
      CREATE OBJECT dll 'MTCODE.CPFONET'.
      IF sy-subrc NE 0.
        RAISE without_dll.
      ENDIF.
    Move para a tabela interna IT_NAME os valores recebidos na TI_NAME
      it_name[] = ti_name[].
    Para cada registro importado
      LOOP AT it_name.
        CLEAR v_string_ret.
        wa_matchcode-zregid     = it_name-zregid.
        wa_matchcode-name1_text = it_name-name1_text.
        v_string = it_name-name1_text.
        CONDENSE  v_string.
        TRANSLATE v_string TO UPPER CASE.
        CALL METHOD  OF dll 'SetNome' EXPORTING #1 = v_string.
        CALL METHOD  OF dll 'ExecMatch'.
        CALL METHOD  OF DLL 'GetMCData' = v_string_ret.
        FREE OBJECT dll.
      Preenche os campos do match-code de acordo com o retorno da DLL
        SPLIT v_string_ret
        AT '|'
        INTO wa_matchcode-zparmcln
             wa_matchcode-zparmcfn
             v_empty
             wa_matchcode-name_first
             wa_matchcode-name_last
             wa_matchcode-namemiddle.
      Adiciona o registro com o match-code correspondente na TE_MATCHCODE
        APPEND wa_matchcode TO te_matchcode.
      ENDLOOP.

  • How to call javascript function from PL/SQL procedure

    Can anybody advice me how to call javascript function from PL/SQL procedure in APEX?

    Hi,
    I have a requirement to call Javascript function inside a After Submit Process.
    clear requirement below:
    1. User selects set of check boxes [ say user want to save 10 files and ticks 10 checkboxes]
    2. user clicks on "save files" button
    3. Inside a After submit process, in a loop, i want to call a javascript function for each of the file user want to save with the filename as a parameter.
    Hope this clarify U.
    Krishna.

  • Calling JavaScript function from Servlet ?

    I have a Servlet that needs to call a general purpose JavaScript function to retrieve some data. The JavaScript function sits in a file on the web server called general.js.
    How can I call this function from my servlet to retrieve an integer result ?
    Sarah.

    http://developer.netscape.com/docs/manuals/js/client/jsguide/index.htm
    Look for Java to JavaScript communication.

  • How do I call Vee functions from TestStand ?

    I wish to call Vee functions from TestStand steps.
    I am using Vee 6.01 and TestStand 2.0.

    Hi Gerry,
    Sorry about that. Below is a sequence file created in 2.0.1f1. Please copy the contents of the zip file (previous attachment) into the folder \Examples\VEE\Using ActiveX (VEE 6.0). Please create this directory if it does not exist. The next thing you will need to do, is register the TestStand VEE server located in \Examples\VEE\Using ActiveX (VEE 6.0)\VEE_StepType.dll. To do this:
    1) Select Start>>Run.
    2) Type regsvr32 "C:\TestStand\Examples\VEE\Using ActiveX (VEE 6.0)\VEE_StepType.dll"
    You should get a message saying that the registration was successful. You should now be able to run the example. Please let me know if you encounter any further problems. Thanks!
    Attachments:
    Computer.seq ‏66 KB

  • Call JavaScript function from Acrobat Plugin

    Hi All,
    I want to call JavaScript function from Acrobat Plugin? Where is to write JavaScript function in Acrobat SDK? Please reply..
    Thanks in advance..

    Hi Malkyt,
    Thanks.. where is to write JavaScript code in the application..
    function GetWelcome()
    alert("Welcome");
    this above code. how to use this javascript code to plugin application.
    static ACCB1 ASBool ACCB2 AVPageViewMouseClick (AVPageView pageView, AVDevCoord xhit, AVDevCoord yhit, AVFlagBits16 flags, AVTCount clickNo, void *data)
    char jsscript[200];
    AFExecuteThisScript (pddoc, jsscript, NULL);
    i want to display welcome message of JS file.. give me step to perform above task.. Please reply...

  • Is their a possibility to call SDK functions from TestStand directly?

    Hello!
    I want to call a function from the Windows SDK.
    Is this possible?
    Regards,
    Brosig
    Using TestStand 3.5 and Windows XP

    Brosig,
    sadly i dont know what the error with the pdb-file could be. but as far
    as i see from the description to the function found here, there should
    be no such dependency.
    please take a look into the "requirements"-section of the link. it
    seems that kernel32.dll is sufficient for usage of the function. and
    for myself, i never had such problems when using the kernel32.dll.....
    one problem could be the type of the parameter you are using. i know
    that there are sometimes odd issues on SDK when the parameters do not
    fit exactly the needed type.  so make sure that all strings are
    null-terminated and the buffers you pass are preallocated!
    Norbert B.
    Edit: forgot the link.....
    Message Edited by Norbert B on 12-22-2005 09:31 AM
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Calling c function from java!!

    hi all,
    I want to call c function from java . I have gone through the link http://java.sun.com/docs/books/tutorial/native1.1/stepbystep/index.html for JNI.
    According to this link we need to write the native method implementation in such a way that the method signature should exactly match the method signature created in the header file.
    My problem is that i have a c application which i cannot modify in any ways i.e., i cannot change its code. But i want to call its function from my java code.
    Please suggest me appropriate solution for this. Please let me know whether it can be done using JNI or is there any other method for this.
    thanks

    This link is amazing since those sources were wrote in 1998 and I started to develop JNative in 2004. I did not found them when I started.
    Since JNative can deal with callbacks and probably COM in a near future, I expect to see it living to Dolphin at least.
    --Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How can I call a function from a procedure

    I have a function named: f_calc_value which return the variable v_result. This function is part of a package.
    How can I call this function from a new procedure I am creating?
    Thanks

    or refer this theread....calling function from procedure

  • Can I call a function from a dll in LabVIEW that returns:double*string and int.?

    I have a function from a dll that return a double* string and an integer. How can I call this function from LabVIEW? There is a possibility to work in LabVIEW with a double* string?

    pcbv wrote:
    > Hello all,<br><br>The header of the function is:
    >
    > "HRESULT WRAPIEnumerateDevices(WRAPI_NDIS_DEVICE **ppDeviceList, long *plItems);"
    >
    > where WRAPI_NDIS_DEVICE have this form:
    >
    > typedef struct WRAPI_NDIS_DEVICE<br>{<br>
    > WCHAR *pDeviceName;<br>
    > WCHAR *pDeviceDescription;<br><br>}
    > WRAPI_NDIS_DEVICE;<br><br>
    >
    > The function is from WRAPI.dll, used for communication with wireless card.
    > For my application I need to call in LabVIEW this function.
    Two difficulties I can see with this.
    First the application seems to allocate the array of references
    internally and return a pointer to that array. In that case there must
    be another function which then deallocates that array again.
    Then you would need to setup the function call to have a pointer to an
    int32 number for the deviceList parameter and another pointer to int32
    one for the plItems parameter.
    Then create another function in your DLL similar to this:
    HRESULT WRAPIEnumExtractDevice(WRAPI_NDIS_DEVICE *lpDeviceList, long i,
    CHAR lpszDeviceName, LONG lenDeviceName,
    CHAR lpszDeviceDesc, LONG lenDeviceDesc)
    if (!lpDeviceList)
    return ERROR_INV_PARAMETER;
    if (lpDeviceList[i].pDeviceName)
    WideCharToMultiByte(CP_ACP, 0,
    pDeviceList[i].pDeviceName, -1,
    lpszDeviceName, lenDeviceName,
    NULL, NULL);
    if (lpDeviceList[i].pDeviceName)
    WideCharToMultiByte(CP_ACP, 0,
    pDeviceList[i].pDeviceDescription, -1,
    lpszDeviceDesc, lenDeviceDesc,
    NULL, NULL);
    return NO_ERROR;
    Pass the int32 you got from the first parameter of the previous call as
    a simple int32 passed by value to this function (and make sure you don't
    call this function with a higher index than (plItems - 1) returned from
    the first function.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Calling user function from Interface mapping

    I am getting error "Bad query:ORA-00904: invalid identifier" while calling function in the mapping of an interface.
    Can some one provide the syntax of calling user function from interface mapping.
    Thanks,
    RP

    user452108 wrote:
    Can some one provide the syntax of calling user function from interface mapping.Oracle's Call Iinterface, the OCI, does not work differently when coding using a Dvorak keyboard, or writing code using a pretty pink font in the editor.. or coding the call from an interface mapping (whatever the hell that that is).
    You have 2 types of calls. SQL and PL/SQL.
    To call a function via SQL, it can be done using a the standard cursor interface. E.g.
    select MyFunkyFunction from dualIt will return the function value via a single row with a single column. The standard cursor fetch and close cursor calls are used.
    To call it via PL/SQL, an anonymous PL/SQL block is needed, and the caller needs to use a bind variable to receive the value from the function. The anon block will look as follows:
    begin
      :bindVar := MyFunkyFunction;
    end;Refer to your client's abstract layer for interfacing with the Oracle Call Interface, on how to deal with bind variables.

Maybe you are looking for

  • Safari + 10.4.6 = Problem (HELP)

    I updated to 10.4.6 through my update software. It dowloaded the PPC update. Then every page that I upload in Safari will not have pictures, banners etc. For example I go to myspace.com and backgrounds and pictures will not load up. Here is a list of

  • How to capture the message recived to the soap server from client -onMessag

    Hi, I want to send JAXM message from client to server and In server print the message to a text file. My client SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance(); SOAPConnection con = scf.createConnection(); MessageFactory mf = MessageF

  • Cost Centre Currency

    Hi We have got number of cost centres with wrong currency as part of the cost centre master data. All of them have got postings against them. Can you please tell me ! - Can I change the currency to correct currency ( I suppose, we can create another

  • Joomla Integration

    Hello, I am trying to figure out, how to integrate Dreamweaver and Photoshop to develop templates for Joomla. Is there a way to see the Joomla site in Action through the Dreamweaver panel? Couldn't I just have my Joomla Installation running on my loc

  • AIA XREF Functions in Jdeveloper

    Hi, I am using XREFs and DVMs in my flows using AIA 3.0. I am not able to see the functions like generate-guid(), functions related to XREF and DVM in the XSLT designer. I remember having installed a AIAXpathFunctions patch for JDeveloper in SOA 10g.