Calling a function on an object passed as argument

Hi everyone,
i'm trying to call an actionscript function on an object passed as argument to a c function. Here are how I do :
I have a class named test_class implemented as
package
     public class test_class
          public var bliblou:int;
and a C function that have to modify the bliblou var of an test_class object passed as argument. Here is my function :
static AS3_Val test_obj_param( void* self, AS3_Val args )
     AS3_Val obj;
     AS3_ArrayValue( args, "AS3ValType ", &obj );
     AS3_Set( obj, AS3_String("bliblou"), AS3_Int( 123456 ) );
     return AS3_Null();
Then I call the function in my actionscript main function like this :
var loader:CLibInit = new CLibInit;
var lib:Object = loader.init();
var test:test_class = new test_class();
lib.test_obj_param( test );
But when the test_obj_param is trying to run, I obtain an error saying "unable to access a propriety of a null object".
What am I doing wrong ? Is it possible to do what I try to (calling a function on an object passed as argument) ?
Thanks in advance

After a long trip to Alchemy possibilities and a lot of tests I have finally found a solution to my question.
Instead of using AS3ArrayValue to get my objet, I use the AS3 function shift on the args array to get my object. Here is how I do
static AS3_Val test_obj_param( void* self, AS3_Val args )
     AS3_Val emptyParams = AS3_Array("");
     AS3_Val obj = AS3_CallS( "shift", args, emptyParams );
     AS3_SetS( obj, "bliblou", AS3_Int( 123456 ) );
     AS3_Release(emptyParams);
     return AS3_NULL();
Maybe there is a bug in the AS3ValType getter.

Similar Messages

  • Muse JS Assert: Error calling selector function:Type error: Object has no method Muse Menu

    When exporting html and viewing locally we receive the following error... This error disappears after removing menu from top of page. This error does not occur when viewed on Outdoors360.businesscatalyst.com (our temporary site)
    Muse JS Assert: Error calling selector function:Type error: Object has no method Muse Menu
    Any ideas??

    I fix the problem.
    I have carefully reviewed JAVASCRIPT files and I could see that these are not a major influence within the site, only are reference code and utilities of the same application.
    By removing these files nothing has stopped working, I thought I would have some error in the sliders, or opacities, but no, nothing happened.
    DELETE IT
    FRANCISCO CATALDO DISEÑADOR GRÁFICO

  • Can we call custom functions in view objects?

    Can we call custom functions in view objects?these custom functions are from my backing bean...
    Please help.....

    User,
    You can certainly add code to your view objects to do whatever you like.
    However, it would be considered a very bad practice to call something in the backing bean from your view object. It violates the whole MVC design principle of ADF.
    Perhaps if you can share your real use case, someone will give you ideas about the best way to do it, but I, for one, would advise you to forget about calling a backing bean function from your view object.
    Best,
    John

  • Calling a function of an object

    If I have an object, and then create a function in this
    object, what syntax
    do I use to call this function?
    SEND_VOTE_OBJECT = new Object();
    SEND_VOTE_OBJECT.SEND_VOTE=function(){
    //function code
    SEND_VOTE_OBJECT.SEND_VOTE();
    I thought this would work but it doesn't!
    What would be the correct syntax?
    Many thanks
    Dave

    Thanks for the reply, it has made me look closer.
    In my actual code I was calling the function before the
    function was
    defined, and that was why it wasn't working.
    i.e like this
    SEND_VOTE_OBJECT = new Object();
    SEND_VOTE_OBJECT.SEND_VOTE();
    SEND_VOTE_OBJECT.SEND_VOTE=function(){
    trace('hi')
    "NSurveyor" <[email protected]> wrote in message
    news:e7m93a$29d$[email protected]..
    > That code works fine:
    >
    > SEND_VOTE_OBJECT = new Object();
    >
    > SEND_VOTE_OBJECT.SEND_VOTE=function(){
    > trace('hi')
    > }
    >
    > SEND_VOTE_OBJECT.SEND_VOTE();
    >
    > As you can see, hi is traced in the output panel, as it
    should. Perhaps
    > you
    > have a problem with your function code. If you post
    that, perhaps I can
    > help.
    >

  • Jsp calling a function in js -- object expected runtime error

    Hi,
    I have a js file. script.js
    *function popup( url ) {*
    newWin=window.open(url,'popupWindow,resizable=yes,menubar=no,status=no,toolbar=no,scrollbars=yes');
    newWin.focus();
    void(0);
    and a jsp calling the function in js
    *<HTML>*
    *<HEAD>*
    *<SCRIPT>*
    *<jsp:include page="script.js"/>*
    *</SCRIPT>*
    *</HEAD>*
    *<BODY onLoad="javascript:popup('http;//www.google.com');">*
    *</BODY>*
    *</HTML>*
    Now when i execute the jsp, it gives runtime error -> object expected..
    Not able to figure out why this occurs.. am I doing it the right way ?

    Do you think is this the right way to include .js file...
    <SCRIPT>
    <jsp:include page="script.js"/>
    </SCRIPT>I generally do this way...
    <head>
    <script language="javascript" src = "script.js">
    </script>
    </head>

  • JAVA Calling Oracle Function and Returning OBJECT

    HI,
    I am working as a developer in java/j2ee project.
    I am facing one issue:
    I need to call Oracle function from java code. Oracle User define function is residing in oracle package and returning Object which contains data.
    Can you please help me
    With Best Regards

    golduniya wrote:
    I need to call Oracle function from java code. Oracle User define function is residing in oracle package and returning Object which contains data.
    Can you please help meIt requires a great deal of Oracle jdbc driver specific code.
    [http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/oraint.htm#1012664]

  • Problem with Call Library Function. Want to pass a string and return a string, but my compiler does not recognize "CStr" and Labview does not recognize my "char *function()" callout

    Hi, I'm trying to use a .DLL I wrote in Visual C++ .NET. The Call Library Function generates a function prototype of "CStr Parser(CStr arg_raw)"
    but my compiler won't accept this. So I change it to how C normally deals with strings "char *Parser(char *arg_raw). Now the Call Librafy Function does not find "Parser" in my .DLL though it is definitely there!
    Help!
    -Fong

    Hello
    You will need to include extcode.h in your C file. You can find this under ..\LabVIEW\cintools folder.
    The include has all the defines you will need.
    Bilal Durrani
    NI
    Bilal Durrani
    NI

  • Call package function in view object

    ok i have a viewobject with a select statement to a table.
    in the where clause i would like to call to a package function,
    how can i do this?

    If you can call the function in a sql statement (i.e. in SQLDeveloper) you can use expert mode in the VO and type in the sql statement there. It should work like in SQLDeveloper.
    Timo

  • Parameters into Call Library Function Node not being passed

    I am trying to configure an instrument using IVI Instrument drivers. In the first vi that does this, the instrument (a sig gen) is being set correctly to the desired frequency and power. In a second vi I try to change the frequency and power, the sig gen does not change.
    If I run the second vi stand-alone with the original settings, again there is no change. But if I change the value of frequency or power by any amount, that parameter is now set properly on the sig gen.
    When I look at the IVI vi, I can see that the parameters I send in are getting to the Call Library Function Node.
    Any idea what the problem is.
    Thanks.
    p.s., Are there instructions on how to paste a picture or link to a vi into my post. This question would have been a lot easier and clearer to ask.

    Hi cgantz,
          While it sounds, possibly, like a "state-caching"-related bug in the IVI driver, it certainly would be good to have a look at your code.   Look a the bottom-left area of the "Message Body" when replying - there's an "Attachment" tool for this purpose!
    Cheers.
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • Error while calling XQuery Function with xs:date type as Argument

    Hi,
    I have follwing function in my DataService .
    declare function tns:getXXXDetail($effectiveDate as xs:date,
    $cancelDate as xs:date) as element(ns26:XXXAccount)* {
              implCode
    declare function tns:testGetXXXDetail($searchCriteria as element(ns15:locateMemberXXXDetail))
                   as element(ns26:XXXAccount)* {
    for $Account in tns:getXXXDetail($searchCriteria/ns16:accountTypeDates/ns18:effectiveDate,
         $searchCriteria/ns16:accountTypeDates/ns18:cancelDate)
    return $Account
    I am trying to test the getXXXDetail() function from testGetXXXDetail .
    The searchCriteria is a complex type with date elements effectiveDate and cancelDate, both are optional
    When i test with effectiveDate,cancelDate elements present in $searchCriteria its working fine.
    When i remove these dates element i am getting follwing error
    "expected exactly one item, got 0 items" error
    Any Clue ?

    When i remove these dates element i am getting follwing error"expected exactly one item, got 0 items" error
    Sounds like your schema for these items indicates minOccurs="1" (or relies on that as the default).
    Edit the schema and change the definitions to be...
    <xs:element name="effectiveDate" minOccurs="0" ... />

  • Why can't I call the function in the swf from the javascript?

    Hello,
    I have an html file that calls the function in swf file. In the swf file, I registered the function to be called using ExternalInterface.addCallback, as the book says.
    And I put this swf file in the html file using <object> tag and attempted to call the function using this object's id attribute.
    But every time to run this file, what I see is the error message such as "test1.show is not a function".
    Why is it?
    Please anyone help me. I am enclosing my work file. It's very simple one.
    Thank you.
    Daniel.

    It is entirely possible your college has decided to block certain websites. It's easy to do.

  • Call a function, which name is in an Array of Strings...

    hey all
    i have a simple Temp class (made to check things) in a file called Temp.java with the following definition :
    public class Temp {
         int data1;
         int data2;
         public Temp (){
              data1=0;
              data2=0;
         (here i have get and set functions for both data1 and data 2, and i have the two following functions)
         public void printAdd(){
              System.out.println("Result : "+(data1+data2));
         public void printSubtract(){
              System.out.println("Result : "+(data1-data2));
    }i have another class called Server who has the following simple code :
    public class Server {
          public static void main( String args[] )
               String[] table={"printAdd","printSubtract"};
               Temp game=new Temp();
               game.setdata1(8);
               game.setdata2(4);
              //the following two calls work perfectly
               game.printAdd();
               game.printSubtract();
                   System.out.println(table[0]);
    //but the following does not...
               game.(table[0]);
    }as probably you have understood i am trying to call a function to the object game which name is in the String table... how can i actually made a call game.(THE_VALUE_OF_STRING_IN_AN_ARRAY) ...?

    i want to call the function printAdd() to the game object..
    but i want the program to find out the name of the function to call.. i want to execute the function whose name is at the array in position 0 -> table[0]
    so i want the program to resolve the table[0] to printAdd and the use it and call it on object game...

  • Calling a function and passing parameters via Variables

    I've got an XML file that is loading in data and is calling functions.
    I've figured out how to call the methods from classes with variables set from the XML file:
    var functionToCall:String = xml.functions.func[0].to_fire.toString();
    myClass[functionToCall]();
    This calls the function perfectly.
    I was wondering if there is anyway to pass parameters into the function as well through variables.  Some functions may have no parameters, some functions could have 5... so the xml could be like this:
    <functions>
       <func>
        <to_fire>function1</to_fire>
        <param>
         <value>true</value>
         <type>Boolean</type> <!-- Must be set to Boolean, String or Number -->
        </param>
       </func>
       <func>
        <to_fire>function2</to_fire>
        <param/>
       </func>
       <func>
        <to_fire>function3</to_fire>
        <param>
         <value>false</value>
         <type>Boolean</type> <!-- Must be set to Boolean, String or Number -->
        </param>
        <param>
         <value>My String Value</value>
         <type>String</type> <!-- Must be set to Boolean, String or Number -->
        </param>
        <param>
         <value>10</value>
         <type>Number</type> <!-- Must be set to Boolean, String or Number -->
        </param>
       </func>
    </functions>
    whats the best way to set something like this up?

    how would I set something like that up?
    in the class:
    public function myFunction(_param1:String, _param2:Number):void {
    then to call it, would ParamTypes be cast as an array or object or something?
    var functionVariable:String = "myFunction";
    myClass[functionVariable](??);
    Or do I structure the XML file in some way to pass in the information?

  • Passing arrays with Call Library Function does not work after application builder

    Calling a DLL with Call Library Function which requires an array of data works correctly in Labview, but after building an exe with application builder, the call no longer works.  Dereferecing the pointer in the DLL retuns all 0s and not the actual values.
    Solved!
    Go to Solution.
    Attachments:
    TEST.zip ‏28 KB

    I did not run your code because it is a little unclear to me what it does.
    Two things:
    First, is the DLL you are calling the DLL-ified version of PopUpNames.vi? Then the problem is likely that the panel is not being built into the DLL.
    When LabView builds an application / dll, it strips the front panel and block diagram from all VIs that it doesn't think need to show a panel at run time. This reduces file size and increases code security. The App Builder's panel inclusion logic can be overridden by Build Specifications -> Source File Settings -> Remove front panel. A better method is to put a property node on a control in a window you want to show marking it "visible"; this is sufficient to tell the App Builder it should keep the panel.
    Currently Source File Settings shows "no dependencies" (clearly incorrect---another evil side effect of Express VIs I guess) but if you change the settings as shown below to keep ALL panels, one might hope the App Builder can figure it to keep the panel when it deconstructs the Express VI. (Alternatively convert the Express VI into a regular one.)
    A second comment: I am a bit flummoxed at the larger goal here. You are calling LabView DLL from LabView, which doesn't make a lot of sense, so I assume your larger goal is to call LabView from C or vice-versa. In that case be aware that your DLL is x86 (32-bit) but you are passing 64-bit ints as your pointers. In this case it is 32-bit LabView with 32-bit pointers in embedeed in 64-bit containers calling 32-bit LabView with 32-bit pointers in embedeed in 64-bit containers, so it all works, but if your going to call this from C or whatnot you're going to have to follow that same design.
    When calling C code the LabView Call Library Function does have a "unsigned pointer-sized integer" data type that always appears to be 64 bits in the dev env but which actually passes a 64 or 32-bit int to the DLL depending on the environment. The "pointer sized int" has to be 64 bits in the "LabView" part of the code because LabView's strong typing requires the data type to be determined at compile time. Casting all pointers to the largest data type in LabView makes it possible to write platform-independent code, but down at the Call Library level you still have to put the right number of bytes on the stack.

  • I am trying to generate purchase order and i create a BAPI also which is active. But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)".

    i am trying to generate purchase order and i create a BAPI also which is active.
    But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)".

    Hi,
    Yeah i tried my Z_BAPI in R3 and then giving some ERROR.
    This is my CODE-
    FUNCTION ZBAPIPOTV2.
    *"*"Local Interface:
    *"  IMPORTING
    *"     VALUE(POHD) TYPE  ZPOHD OPTIONAL
    *"     VALUE(POITEM) TYPE  ZPOITEM OPTIONAL
    *"  TABLES
    *"      RETURN STRUCTURE  BAPIRET1 OPTIONAL
    data: ls_pohd type bapimepoheader,
             ls_pohdx TYPE bapimepoheaderx,
             lt_poit TYPE TABLE OF bapimepoitem,
             lt_poitx TYPE TABLE OF bapimepoitemx,
             ls_poit TYPE bapimepoitem,
             ls_poitx TYPE bapimepoitemx.
       MOVE-CORRESPONDING pohd to ls_pohd.
       MOVE-CORRESPONDING poitem to ls_poit.
       ls_pohdx-comp_code = 'x'.
       ls_pohdx-doc_type = 'x'.
       ls_pohdx-vendor = 'x'.
       ls_pohdx-purch_org = 'x'.
       ls_pohdx-pur_group = 'x'.
       ls_poit-po_item = '00010'.
       APPEND ls_poit to lt_poit.
       ls_poitx-po_item = '00010'.
       ls_poitx-po_itemx = 'x'.
       ls_poitx-material = 'x'.
       ls_poitx-plant = 'x'.
       ls_poitx-quantity = 'x'.
       APPEND ls_poitx to lt_poitx.
    CALL FUNCTION 'BAPI_PO_CREATE1'
       EXPORTING
         POHEADER                     = ls_pohd
        POHEADERX                    =  ls_pohdx
    *   POADDRVENDOR                 =
    *   TESTRUN                      =
    *   MEMORY_UNCOMPLETE            =
    *   MEMORY_COMPLETE              =
    *   POEXPIMPHEADER               =
    *   POEXPIMPHEADERX              =
    *   VERSIONS                     =
    *   NO_MESSAGING                 =
    *   NO_MESSAGE_REQ               =
    *   NO_AUTHORITY                 =
    *   NO_PRICE_FROM_PO             =
    *   PARK_COMPLETE                =
    *   PARK_UNCOMPLETE              =
    * IMPORTING
    *   EXPPURCHASEORDER             =
    *   EXPHEADER                    =
    *   EXPPOEXPIMPHEADER            =
      TABLES
        RETURN                       = return
        POITEM                       = lt_poit
        POITEMX                      = lt_poitx
    *   POADDRDELIVERY               =
    *   POSCHEDULE                   =
    *   POSCHEDULEX                  =
    *   POACCOUNT                    =
    *   POACCOUNTPROFITSEGMENT       =
    *   POACCOUNTX                   =
    *   POCONDHEADER                 =
    *   POCONDHEADERX                =
    *   POCOND                       =
    *   POCONDX                      =
    *   POLIMITS                     =
    *   POCONTRACTLIMITS             =
    *   POSERVICES                   =
    *   POSRVACCESSVALUES            =
    *   POSERVICESTEXT               =
    *   EXTENSIONIN                  =
    *   EXTENSIONOUT                 =
    *   POEXPIMPITEM                 =
    *   POEXPIMPITEMX                =
    *   POTEXTHEADER                 =
    *   POTEXTITEM                   =
    *   ALLVERSIONS                  =
    *   POPARTNER                    =
    *   POCOMPONENTS                 =
    *   POCOMPONENTSX                =
    *   POSHIPPING                   =
    *   POSHIPPINGX                  =
    *   POSHIPPINGEXP                =
    *   SERIALNUMBER                 =
    *   SERIALNUMBERX                =
    *   INVPLANHEADER                =
    *   INVPLANHEADERX               =
    *   INVPLANITEM                  =
    *   INVPLANITEMX                 =
    ENDFUNCTION.
    i am trying to generate purchase order and i create a BAPI also which is active. But when i call the BAPI from SYbase Mobile Object RFC then after calling it gives an Error "Conflict when calling a Function Module (Field Length)". 

Maybe you are looking for