Problems calling a function from another function

Hello all.
I am trying to create a function that will loop a few other function.
Basically the main function is this
                    private function publish(event:MouseEvent):void
                        if (doPublish.label == 'Publish')
                            // create a new NetStream object for video publishing
                            nsPublish = new NetStream(nc);
                            nsPublish.addEventListener(NetStatusEvent.NET_STATUS, nsPublishOnStatus);
                            // set the buffer time to zero since it is chat
                            nsPublish.bufferTime = 0;
                            // publish the stream by name
                            nsPublish.publish(publishName.text);
                            // add custom metadata to the stream
                            var metaData:Object = new Object();
                            metaData["description"] = "Chat using VideoChat example."
                            nsPublish.send("@setDataFrame", "onMetaData", metaData);
                            // attach the camera and microphone to the server
                            nsPublish.attachCamera(camera);
                            nsPublish.attachAudio(microphone);
                            doPublish.label = 'Stop';
                        else
                            // here we are shutting down the connection to the server
                            nsPublish.attachCamera(null);
                            nsPublish.attachAudio(null);
                            nsPublish.publish("null");
                            nsPublish.close();
                            doPublish.label = 'Publish';
I am then trying to call that function like this
            protected function startloop():void {
                publish(event);
But i get the error Access of undefined property event.
Any ideas on how i can call this function ?  I need to call it as part of a loop against a timer..
Thanks in advance

Need more info. Are you using a ViewStack or other navigator container, and trying to access a view that has not been displayed yet, due to deferred instantiation?
If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
www.ChikaraDev.com
Flex Training and Support Services

Similar Messages

  • Calling a Function from another Function within CFC

    Hi all,
    I have many functions in my CFC that do various things, but
    one query is a query that selects absolutely every record from a
    table.
    The thing is, I need to do a query like this in another
    function to obtain only a recordcount of the same table used in
    both separate functions. Instead of writing the query out again,
    how can I utilise the function already written?
    My question is, how can I invoke and use the results of a
    query in one cffunction for another cffunction in the same CFC
    component?
    An example may look like the code attached...
    Many thanks for your patience and help!
    Mikey.

    quote:
    Originally posted by:
    Dan Bracuk
    Generally, to call a function from within a cfc, you do
    exactly what you do outside a cfc.
    For your specific case, if your requirements permit it, you
    might consider caching the big query for a couple of seconds. Then
    you can continously call the function and not have to wait for it
    to run and bring back the data each time.
    Do you mean to say that within a CFC function I can execute
    the same cfinvoke tags I use in normal CFM pages?
    Mikey.

  • How do i call a Function from another Function ?

    When i press a button, i want a series of functions to execute one after another (they contain tweens, but its irrelevant), each of them waiting for the previous to be completed. I want to put the series of functions inside one function, so i can call just this function to execute all the others. The animations are working fine, but i dont know how call Functions from within another function. Also it would be necessary each function to wait until the previous has completed, to execute. Here is a clear example of what i need to do:
    boton.onPress = animate ;
    Function animate () {
         animation1 (onComplete: animation2);
         animation2 (onComplete: animation3);
         animation3 ;
    Function animation1 () { Tween 1};
    Function animation2 () { Tween 2};
    Function animation3 () { Tween 3};
    any suggestions ?

    I'd do something like this:
    boton.onPress = animation1 ;
    Function animation1 () {
         var Tween1 = new Tween();
        Tween1.onComplete =  animation2;
    Function animation2 () {
         var Tween2 = new Tween();
         Tween2.onComplete = animation3;
    Function animation3 () {
         var Tween3 = new Tween();

  • Calling an OA Function from another function

    Hi,
    I need to create a link in a function that calls another function.
    I've created a new Item 'Static Styled Text' writing in the destination URL 'OA.jsp?OAFunc=FUNCTION_NAME&pPersonID=&pFromMenu=Y'.
    I am able to connect to the Function but the person_id parameter passed is not the right one.
    To be clear I'll write down an example. I am a super user and in FUNCTION A I query an employee and enter in the function. Subsequently I click on the link I've created to view this employees information in FUNCTION B. Instead it queries my information, passing my person_id.
    Can someone help?
    thanks

    You would need to get hold of the person id of the employee you queried, this may be a VO attribute
    Once you get the person Id, you would need to set the URLs parameter value to this value.
    so the URL when you are in the next pahe would look like
    http://<server:port>/../OA.jsp?OAFunc=FUNCTION_NAME&pPersonID=<the value you passed>&pFromMenu=Y
    Thanks
    Tapash

  • Problem calling a form from another form in oracle 10g

    hi,
    i have created A basic STUDENT form with all fields and the STUDENT/COURSES master/detail form .
    I am trying to place to button on the STUDENT form that when pressed, will call the STUDENT/COURSES form and automatically query the COURSES for the employee being viewed on the STUDENT form.
    here is the code i used
    DECLARE
         pl_id ParamList;
    BEGIN
         pl_id := Get_Parameter_List('tmpdata');
    IF NOT Id_Null(pl_id) then
              Destroy_Parameter_list (pl_id);
         end if;
         pl_id := create_parameter_list ('tmpdata');
         add_parameter (pl_id, 'students_id',text_parameter, :s_id);
         run_product (forms, 'C:resubmission\stucourse.fmb', synchronous, runtime,
         filesystem, pl_id, null);
    end;
    although it successfully compiled,
    when i press the button on the form it is giving me
    frm-92101 : there was a failure in the forms sever during start up...
    i have tried everything i can think off, am fairly new to this
    please any assistance will be appreciated. am using oracle 10g
    thanks in advance.

    Ammad is right, in order to pass a parameter to another Form, the Form you call must have a corresponding parameter. In other words, if you go to the Parameters node of the Object Navigator you need to add a parameter called "STUDENTID" and set the data type and precision of the parameter to match the data you will pass to this parameter.
    Once you have this parameter in your called form, you will have to write code in the called form to use the value of the parameter. This code is typically in the When-New-Form-Instance (WNFI) trigger, but that all depends on your requirements. In your example, this seems the appropriate trigger as your intent is to pass the Student ID and query any Courses the Student is enrolled in. Your WNFI trigger needs to check if there is a value in the Student_ID parameter and then set the default where clause of your COURSES datablock and execute a query on the block. For example:
    /* Sample WNFI trigger */
    /* This example "ASSUMES" your courses block is called COURSES */
    BEGIN
       IF ( :parameter.STUDENT_ID IS NOT NULL ) THEN
          Set_Block_Property('COURSES', OneTime_W.here, 'STUDENT_ID = :Parameter.Student_ID');
          Execute_Query;
       END IF;
    END;
    Note: I had to put a period into the "OneTimeW.here" statement in order to get the Editor to accept my post.  Please remove the period if you use this sample code.
    Hope this helps,
    Craig B-)
    If a response is helpful or correct, please mark it accordingly.
    Edited by: CraigB on May 24, 2010 8:23 AM
    Edited by: CraigB on May 24, 2010 8:23 AM
    Edited by: CraigB on May 24, 2010 8:26 AM

  • Re: problem calling a method from another class

    This line here:
    app.computeDiscount(ord,tentativeBill);... You are not capturing the returned amount.
    double d = app.computeDiscount(ord,tentativeBill);

    what kind of problem r u facing?
    plz highlight the code where u r facing the problem

  • Function Invoking Another Function

    Trying to invoke 1 function from another function, using same parameters for each.
    Trying to invoke 1 function from another function. MasterFunction has parameterX which is a dictionary Name. When attempting to call ChildFunction from within MasterFunction, and passing it the same parameter that MasterFunction has, got javascript error 'Invalid Object'.
    Here is basic scenario:
    MasterFunction(dictionaryName)
    ChildFunction(dictionaryName);
    Both of these functions are in the JavaScript function list.
    Any help on this would be appreciated.

    You need to pass the dictionary object, not the dictionary name.  So you would pass in a parameter of "serviceForm.DictName", which is the dictionary object.  Then, if your parameter name was "objDict", you would call methods against it, for example: "objDict.setVisible(false);" and "objDict.FieldName.getValue();"
    If, for some reason, you do need or want to pass a string of the dictionary name, you need to use the "eval" method to get the dictionary object back: eval("serviceForm." + dictString + ".FieldName.getValue()");

  • Call a function from another software

    hello,
    Iam working on a program where i have to invoke a function from another software, is there any way i can do that? someone told me that i can use RMI to invoke the function but it seems to me like RMI is mainly for networked and distributed systems. any suggestions? i have an idea in my mind, if the software is programmed using c/c++ i can use the native coding to access the functions, well this is only a blind shot, not sure about it.
    asrar

    Hey asrar,
    It is possible to call external programs from within the JVM. You need to do the following:
    Process p = java.lang.Runtime.getInstance().exec("some.exe");
    You can then do the following:
    p.waitFor();
    This will block until the process returns.
    The Process class gives you access to 3 streams.
    p.getInputStream(); returns a stream that the process sends to stdout.
    p.getErrorStream(); returns a stream that the process sends to stderr.
    p.getOutputStream(); returns a stream that allows you to send data to the process.
    That is basically all you get.
    regards,
    Dr_N35S

  • Calling one function in another function

    Hi,
    How to call one function in another function?
    regards,
    Kishore.

    example:
    SQL> ed
    Wrote file afiedt.buf
      1  declare
      2    function bob(x number) return number is
      3    begin
      4      return x*x;
      5    end;
      6    function fred(x number) return number is
      7    begin
      8      return x+bob(x);
      9    end;
    10  begin
    11    dbms_output.put_line('Value: '||to_char(fred(5),'fm9999'));
    12* end;
    SQL> /
    Value: 30
    PL/SQL procedure successfully completed.
    SQL>

  • Call .xhtml file from javascript function

    Hi,
    Is there a way to call .xhtml page from javascript function???

    BalusC wrote:
    Yes there are some ways. But this question has nothing to do with JSF and certainly not with Java at all. Javascript is an entirely different language, although it has a similar syntax as Java (and unforunately also a similar name, they should never have renamed it from ECMAScript).I think ECMAScript is a renaming from JavaScript. The originally JavaScript was called LiveScript by Netscape. I've heard that the ECMAScript name was deliberately chosen to be unsexy.

  • Calling java APIs from a function module

    Hi,
    Can someone tell me whether it is possible to call Java APIs from a function module in SAP system?
    Thanks in advance,
    Vineetha

    Hi,
    I guess you have changed the properties of screen only.
    I assume you have made a Ztransaction Code.
    When you define a transaction code, you need to specify a screen number for radio option program and screen and you need to specify a screen and not subscreen.( I think so!!)
    You changed only the code without changing the transaction code properties.
    Therefore, i think u r getting a dump.
    If you want to call your subscreen, call it in some screen and then call that screen using your transaction code properties.
    To include a subscreen screen in the subscreen area of the main screen and call its PBO flow logic, use the following statement in the PBO event of the main screen:
    PROCESS BEFORE OUTPUT.
      CALL SUBSCREEN <area> INCLUDING <prog> <dynp>.
    To call the PAI flow logic of the subscreen screen, use the following statement in the PAI flow logic of the main screen:
    PROCESS AFTER INPUT.
    CALL SUBSCREEN <area>.
    Refer:
    http://help.sap.com/saphelp_webas630/helpdata/en/9f/dbabfe35c111d1829f0000e829fbfe/content.htm
    Regards,
    Tanveer.
    Please mark helpful answers.
    Message was edited by: Tanveer Shaikh
    Message was edited by: Tanveer Shaikh

  • Problem regarding calling a program from another program

    Hi,
    I have a requirement that i need to call a program from another program and in that case the called program should be executed with a value in the selection screen coming from the first program..i.e.
    a standard report to view the user Notes for annual leave is RPTARQDBVIEW. Can we create a report to display all the users under a manager as a hyperlink and run the report(RPTARQDBVIEW), with the pernr of the employee selected
    Regards,
    saumik

    Submitting a report using ranges for select-options
    * Define range for ltak-tanum
    RANGES: r_tanum FOR ltak-tanum.                                                                               
    * Read values from database tabel into the range
    * These values are later used for select-options in the report
    SELECT * FROM ltak                                                   
      WHERE lgnum =  w_lgnum AND           "Warehouse number/complex    
            vbeln = w_screen1000-io_vbeln.       "Transfer order number
      MOVE ltak-tanum TO r_tanum-low.                                    
      MOVE 'I' TO r_tanum-sign.                                          
      MOVE 'EQ' TO r_tanum-option.                                       
      APPEND r_tanum.                                                    
    ENDSELECT.                                                                               
    * Submit report with range                  
    SUBMIT zmm00100 WITH p_tanum IN r_tanum.   
    or
    Submitting a report from ABAP with selection criterias
      TYPES: tt_selection TYPE STANDARD TABLE OF rsparams.
      DATA: l_iblnr        TYPE st_iblnr,
    *     Define internal table and work area for select-options
            l_selection    TYPE rsparams,
            li_selection   TYPE tt_selection.
    * Create selectIon table
      LOOP AT gi_iblnr INTO l_iblnr.
        CLEAR l_selection.
        l_selection-selname  = 'IM_IBLNR'.    "Option name
        l_selection-kind     = 'S'.           "S= select options P=Parameters
        l_selection-sign     = 'I'.           "Sign
        l_selection-option   = 'EQ'.          "Option
        l_selection-low      = l_iblnr-iblnr. "Value
        APPEND l_selection TO li_selection.
      ENDLOOP.
    * Submit report
      SUBMIT rm07idif WITH SELECTION-TABLE li_selection AND RETURN.
    Regards,
    Prabhudas

  • How to call a servlet from another servlet

    hi everybody,
    i have a problem, i have to call one servlet from another one.
    Everything works on my pc, but when i install the application on the customer's server i got an error about an Uknown URL followed by the name of the machine.
    Wjat i do is the folloqing :
    String urlString = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/"+servletName;
    URL url = new URL(urlString);
    HttpURLConnection conn = (HttpURLConnection) url.openConnection();
    the variable servletName is the name of the servlet i have to call.
    Is there another way to call the servlet ?
    All the servlet are installed in the same server.
    Any suggestion ?
    Cheers.
    Stefano

    Sweep is correct about requestDispatcher being another approach for inter-servlet delegation; the only issue that i recall with this approach is that it defaults the method of the destination servlet to the one it was called from...for example, calling servlet2 from within servlet1.post() resulted in the dispatcher attempting to utilize servlet2.post() - i believe that i searched for a parameterize solution to no avail :( (ended up handling the request by placing a "fake" doPost() in servlet2 that simply called servlet2.doGet())
    however, if your application is functioning correctly on your pc/webserver then the problem may be external to servlet communication (e.g. client webserver's ports not configured or blocked, missing runtime classes, etc.)
    my suggestion would be to set aside the programmatic concerns for the moment - what is the response if you open a browser on a client's machine and access the URL in question (i.e. http://clientserver:port/stefanoServlet)? If it will not respond to access in this manner then it certainly won't when your application calls for it.
    It's possible that there is a coding error but, given the info supplied, i'd start examining the environment, first. Let us know if you have any luck with the test i recommended or not (please provide abundant detail). Or, if you've found the solution then you may want to post back with a quick blub so the next person knows how to escape the trap.
    D

  • Regarding calling 1 report from another

    Hello Friends,
       Can u plz tell me how to call one report from another report.
    Regards,
    Drashana

    hi,
    Use SUBMIT program statement
    SUBMIT ZFIR001
    chk this.
    *Code used to populate 'select-options' & execute report 
    DATA: seltab type table of rsparams,
          seltab_wa like line of seltab.
      seltab_wa-selname = 'PNPPERNR'.
      seltab_wa-sign    = 'I'.
      seltab_wa-option  = 'EQ'.
    load each personnel number accessed from the structure into
    parameters to be used in the report
      loop at pnppernr.
        seltab_wa-low = pnppernr-low.
        append seltab_wa to seltab.
      endloop.
      SUBMIT zreport with selection-table seltab
                                    via selection-screen.
    *Code used to populate 'parameters' & execute report 
    SUBMIT zreport with p_param1 = 'value'
                    with p_param2 = 'value'.
    Other additions for SUBMIT
    *Submit report and return to current program afterwards
    SUBMIT zreport AND RETURN.
    *Submit report via its own selection screen
    SUBMIT zreport VIA SELECTION-SCREEN.
    *Submit report using selection screen variant
    SUBMIT zreport USING SELECTION-SET 'VARIANT1'.
    *Submit report but export resultant list to memory, rather than
    *it being displayed on screen
    SUBMIT zreport EXPORTING LIST TO MEMORY.
    Once report has finished and control has returned to calling
    program, use function modules LIST_FROM_MEMORY, WRITE_LIST and
    DISPLAY_LIST to retrieve and display report.
    \[removed by moderator\]
    rEGARDS
    Edited by: Jan Stallkamp on Jul 29, 2008 5:25 PM

  • How to you refer to a function in another function in a cfc

    HI,
    How to you refer to a function in another function in a cfc like so
    <cffunction name="getApplicationConstants" access="remote" returntype="struct">
             <cfset flash.result.users = [the result from the getUsers function]>
        <cfreturn flash.result>
    </cffunction>
    <cffunction name="getUsers" access="remote" returntype="query">
            <cfquery name="q" datasource="#datasource#">
                select     c.*
                from    USERS as c    WHERE looksLikeUserIsDeleted = 'False'
                AND userPrivileges = 1
                ORDER BY fullName
            </cfquery>
            <cfset flash.result = q>
            <cfreturn flash.result>
    </cffunction>

    Hi, Nikos,
    If the CFCs are in the same directory, you could do the following:
    CFCA
    <cfcomponent>
    <cffunction name="getApplicationConstants" access="remote" returntype="struct">
        <cfset flash.result.users = cfcB.getUsers() />
        <cfreturn flash.result>
    </cffunction>
    </cfcomponent> 
    CFCB
    <cfcomponent>
    <cffunction name="getUsers" access="remote" returntype="query">   
            <cfquery name="q" datasource="#datasource#">
                select     c.*
                from    USERS as c    WHERE looksLikeUserIsDeleted = 'False'
                AND userPrivileges = 1
                ORDER BY fullName       
            </cfquery>
            <cfset flash.result = q>
            <cfreturn flash.result>
    </cffunction>
    <cfcomponent>
    If the CFCs were in different directories, the cfset expression in CFCA would be this:
    <cfset flash.result.users = path.to.cfc.cfcB.getUsers() />
    Where I have path.to.cfc, you would use either a mapping from CF Admin or the hierarchy of folders to the CFC from the web root.
    Does that help?

Maybe you are looking for

  • Sockets problem HELP!!

    I am trying to create a peer-to-peer messager using Sockets. I have a Listener class that listens for connections and accepts them and creates a new socket for each connection and also calls a ChatHandler which is passed the new socket. Exept the Sta

  • DRDA is installed just on the Oracle side?

    After reading this I still dont get it... http://download-east.oracle.com/docs/cd/B19306_01/gateways.102/b16217/intro.htm#i3621 This documentation does not get to the point at all. It is not written at a level for people who have never installed a Tr

  • Bootcamp Drivers

    I've recently purchased a new iMac which was partitioned using Bootcamp by the seller who also installed a Chinese version of Windows. I find that the iSight camera is not showing in Skype and believe that he didn't install the drivers when he bootca

  • Would like Final Fantasy Advance for Appstore

    This game is puplished in 2003 for Gameboy Advance. This is role-play-game and much better than the PSP version. More than 10.000 peoples like this game and I would like pay more than 10 euro for this. Thank you for your attention.

  • Sending an Excel file to Window user?

    How can I send an Excel file (xlsx or xls) as an attachment to an e-mail to a recipient who uses Wondows?