Help: call function that calls another function

public var sourceFile:File = File.applicationDirectory.resolvePath ("serverIP.txt");

public var fstream:FileStream = new FileStream();

public var svrAdd:String = ";


private void readText(e:Event):void {}

svrAdd = fstream.readUTFBytes (fstream.bytesAvailable);

FileStream ();

}


public function get vrieniHttpURL (): String

{

{}

fstream.addEventListener (Event.COMPLETE, readText); // I want the readText run before function

fstream.openAsync (sourceFile, FileMode.READ);    / / because I want to get the new value of svrAdd

} while(svrAdd == '')

var v: String = "http://'+ svrAdd +'/ Zion/php /'; "

   return v;

}

PLEASE HELP ME

Hello

First of all, please go through the Flex documentation on what is aynchronous operation is... ? I think that you are not familiar with this concept... Well, let me explain...

public function get vrieniHttpURL (): String

{

{}

fstream.addEventListener (Event.COMPLETE, readText);

fstream.openAsync (sourceFile, FileMode.READ);

delay execution

} while(svrAdd == '')

var v: String = "http://'+ svrAdd +'/ Zion/php /';"

Return to v;

}

In the function as you posted the closure is not necessary it will loop continuously and defenitely will enter an infinite loop because svrAdd remains empty string("") how long loop you... it is because fstream.openAsync (sourceFile, FileMode.READ); is that an asynchronous operation means that the function redaText is executed only when the text file is read completely until the application does not wait for the service to call at the place he will perform the following lines of code in the function vrieniHttpURL i.e;

var v: String = "http://'+ svrAdd +'/ Zion/php /';"

Return to v;

lines executed and your return value will be "http://Zion/php /" instead of http://votre_domaine/Zion/php /.

Use the code to get the solution below:

Import mx.core.Application;
  
public var sourceFile:File = File.applicationDirectory.resolvePath ("serverIP.txt");
public var fstream:FileStream = new FileStream();
public var svrAdd:String = ";

private void readText(e:Event):void {}
svrAdd = fstream.readUTFBytes (fstream.bytesAvailable);
FileStream ();
svrAdd = 'http://'+ svrAdd +'/ Zion/php /';
}
public function vrieniHttpURL (): void
{
fstream.addEventListener (Event.COMPLETE, readText); I want the readText function to run before
fstream.openAsync (sourceFile, FileMode.READ);    because I want to get the new value of the svrAdd
}

 

 

So whats that the above code is once when the 'vrieniHttpURL' function is called you open the file in read mode, and you cannot get the value of the svrAdd within this service because the contents of the file have not yet read... the content in the file is read-only once the readText function is executed... so once your readText function performed you will have your svrAdd filled with the correct value... That is to say; It contains your exact address. If after this you can use the value of svrAdd... you can not return the value of svrAdd with in the function 'vrieniHttpURL' as you did in your code.

 

Give it a try...

 

In fact I am unable to understand why you are so much unnecessary things... you can simply save your domain address in a variable and access in your application as below.

 

public var svrAdd:String = http://yourdomainname.com/;

 

If your domain name will change dynamically...?

 

Please mark as answer if it helped you...

 

Thank you

Jean Claude Chari.S

 

 

 

 

 

 

Tags: Flex

Similar Questions

  • In Captivate 7, how can I call another action in action?

    I have a conditional action called FakeSuccessRewind. Now I need to call another function, called ShowGrayBalloons02 of in the Else statement, but I couldn't find something like "Execute Action Advanced." Can someone share some advice here? Thank you!

    Here are the screenshots of my two actions:

    (1) FakeSuccessRewind (if/else). Here, I need to call the action 2 of the Else statement, under instruction to go to the next slide.

    if01.PNG

    if02.PNG

    (2) ShowGrayBalloons02. Note that this feature has five separate tracks when the variable is decrement of 5-1.

    show balloon.PNG

    Thank you very much!

    Melissa

    You can not, you add another action first.

  • When calling another country gives the time in this country?

    When calling another country, Skype tell you the time in the country you call?

    Hello and welcome to the Skype community.

    N ° as currently configured the system does not support this facility.

    TIME ZONE - US EAST. LOCATION - PHILADELPHIA, PA, USA.

    I recommend that you always run the latest version of Skype: Windows & Mac

    If my advice helped to solve your problem, please mark it as a solution to help others.
    Please note that I usually do not respond to unsolicited private Messages. Thank you.

  • Call another project

    I call another project in a project. It works very well, but what I want to do is call the second project, launch it and then when he finally continue with the original project, to the point where I called the other. I.e. play screens 1-5, gives the opportunity to execute the second project, if the user is running, then come back to the original starting screen 6.

    I don't see an option for what to do at the end of the second project to do (stop project, project of loop etc.). Or can it be done? Thank you.

    Hi bobelmore

    One thing you might be able to do is to launch the second project in a new instance of the browser. Your username would then close the browser, how they would return to the film, they were all first. The original film would not continue until they are back and clicked a button. To do this, insert a click box or a button that would call the second project. Notice that to the right of where you specify the project is an arrow down. Click and you can select 'New' to open it in a new window. Click a second time and you can deselect "Continue to play the project" (or "continue reading film' If you use Captivate 1)

    Hope this helps a bit... Rick

  • call another proc and passing the values in the exception block

    Hello
    I'm trying to call the procedure another passing values in the exception block... but I couldn't m figure out how would the values in the exception block
    create or replace procedure test_proc 
    is 
       cursor test_cur is 
         select update_dt from test_tbl;   
         
         test_rec test_cur%rowtype;
    
        begin
            for test_rec in test_cur
            loop
                begin 
                    insert into test_tbl values (test_rec.update_dt);
                    commit;
                    exception 
                       when others then
                         rollback;
                    --      test_proc2(update_dt)       --     want to call another procedure and want to pass that update_dt here ; this process will insert the update_dt into the message table    
                       commit; 
                     
            end loop;  
            
        end;
         
     
    
    My question is how do i pass value(update_dt) into the exception block or do i need to create any varaible ?? any idea 
    Thank you very much!!

    BTW, you can still use SQL % BULK_EXCEPTIONS even if you don't use EXCEPTION to LOG. You just can't use ORA-24381, since it will not be raised. Using SO many OTHER instead. And of course, there will be only one element in SQL % BULK_EXCEPTIONS:

    SQL> CREATE TABLE emp_temp AS SELECT * FROM emp;
    
    Table created.
    
    SQL> DECLARE
      2     TYPE empno_tab IS TABLE OF emp.empno%TYPE;
      3     emp_sr empno_tab;
      4     errors NUMBER;
      5     dml_errors EXCEPTION;
      6     PRAGMA EXCEPTION_INIT(dml_errors, -24381);
      7  BEGIN
      8     SELECT empno BULK COLLECT INTO emp_sr FROM emp_temp;
      9       FORALL i IN emp_sr.FIRST..emp_sr.LAST --SAVE EXCEPTIONS
     10         UPDATE emp_temp SET job = job || '_SR'
     11            WHERE emp_sr(i) = emp_temp.empno;
     12  EXCEPTION
     13    WHEN OTHERS THEN -- Now we figure out what failed and why.
     14     errors := SQL%BULK_EXCEPTIONS.COUNT;
     15     DBMS_OUTPUT.PUT_LINE('Number of statements that failed: ' || errors);
     16     FOR i IN 1..errors LOOP
     17        DBMS_OUTPUT.PUT_LINE('Error #' || i || ' occurred during '||
     18           'iteration #' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX);
     19            DBMS_OUTPUT.PUT_LINE('Error message is ' ||
     20            SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE));
     21     END LOOP;
     22  END;
     23  /
    Number of statements that failed: 1
    Error #1 occurred during iteration #2
    Error message is ORA-12899: value too large for column "SCOTT"."EMP_TEMP"."JOB"
    (actual: 11, maximum: 9)
    
    PL/SQL procedure successfully completed.
    
    SQL> DROP TABLE emp_temp;
    
    Table dropped.
    
    SQL> 
    

    SY.

  • IPhone flattened my mother fell and broke her screen and I bought a new Yvonne, but I want to know the iPhone ID forget him, I can send the IMEI or help me so that I change the iPhone to my mother and I thank you

    IPhone flattened my mother fell and broke her screen and I bought her a new iPhone, but I want to know the iPhone ID forget him, I can send the IMEI or help me so that I change the iPhone to my mother and I thank you

    Yvonne > > iphone

    Sorry

  • Can someone help me with that? Thanking you in advance...

    I used to have a bar at the bottom of my Thunderbird email page which showed incoming emails and the total number of them. I don't have that and tried to recover. Something has happened recently with the last update. I would appreciate your help to get that back. Can you help this marine vet out?

    Mark View / Toolbars / status bar

  • That means "another device on the network use the IP address of your computer"?, that means "another device on the network is using the IP address of your computer?

    That means "another device on the network use the IP address of your computer"?, that means "another device on the network is using the IP address of your computer?

    A

    Most likely, the computer becomes a network address of a router. The assignment of an address ("lease") expires and must be renewed after a certain period of time, which could be an hour or a day. The lease expired without being renewed because the device has been disconnected at the time. Meanwhile, the address has been leased to another device on the network, or maybe the router has not updated its list of addresses the leases. When the device offline comes back online, a conflict results. Depending on the type of router you have, the conflict can resolve itself automatically. If not, then in the menu bar, select please

    ▹ System Preferences network ▹ 

    If the preferences window is locked, click the lock icon in the lower left corner and enter your password to unlock it. Click the Advanced button, and then select the TCP/IP tab in the sheet that drops down. Look at the menu option

    Configure IPv4

    If the selection in this menu is

    Using DHCP

    Click on the button

    Renew the DHCP lease

    Test.

    Make sure that you have more than one DHCP server on the network. That could happen if you have more than one access point Wi - Fi, or if you have a router and broadband a wide device distinct in connection mode sharing.

    B

    Less likely, you have a network address that you assigned yourself and another device is itself by assigning the same address. In this case, the selection to configure IPv4 menu will be either manually or using DHCP with manual address. This kind of conflict will not be resolved automatically. You have the following options to solve:

    1. Change the selection in menu using DHCP.
    2. Change the address assigned manually to one that is not used by another device.
    3. Change the address of the other device.

    Which of these options you choose depends on the details of why you use a static IP address. Any changes you make to the network settings is necessary before taking effect. To do this, click OK, and then click apply.

    If the router is also your device at wide band, then he may be operating in bridged mode. In this case, only one customer at a time will be able to connect to the Internet. Consult the manufacturer or ISP documentation for how to reconfigure the device in the connection mode sharing.

    C

    According to a report a "DirectTV" receiver can cause the problem. If necessary, disconnect the device from the network, or power off and test. Consult the support services provider.

  • I posted a question about the FBI virus. How to get rid of him. I ' v was only one answer. Someone to give here can help me with that. I am 62 and although I use my high tower dyly I'm not a COMPUTER technician.

    I posted a question about the FBI virus. How to get rid of him. I ' v was only one answer. Someone to give here can help me with that. I'm 62, and I'm not a computer genius. I have some [eratly helpgetting need to get rid of the virus of the FBI. MS antivirus and scan not work or identify it.  Help, please! 1

    Emisoft is a desperately slow download, as I just discovered.

    You can simply run Malwarebytes and it...

    http://www.Microsoft.com/security/scanner/en-us/default.aspx

  • Tips for Lightroom 6 help indicates again that if "using a graphics card AMD/ATI under Windows 64-bit with the AMD Catalyst driver 15.7 and Lightroom CC/Lightroom 6 hangs or crashes during launch or when you edit an image in the develop module.»  This

    Oops... .the everything in the title... My apologies!

    Tips for Lightroom 6 help indicates again that if "using a graphics card AMD/ATI under Windows 64-bit with the AMD Catalyst driver 15.7 and Lightroom CC/Lightroom 6 hangs or crashes during launch or when you edit an image in the develop module.»  This problem may occur when you use AMD Radeon HD 5xxx card graphics series 8xxx running versions of pilot 14.501.1003, 14.502.1014 and 15.200.1062.1004. For the Solution of the page install the AMD Catalyst 15.8 Beta Driver for Windows (posted August 31, 2015).  However, there are now a 16.1 driver... would this work with Lightroom 6buttons Photpshop CC without problem or should I stay with 15.8 beta for Windows driver (Windows 8.1.

    Thank you very much

    Paul Winstone

    Hi Paul,.

    This article was created when users have faced problem with old drivers for AMD graphics card.

    Yes, you can upgrade to the last 16.1 pilots and who should work well however, you should have 1 GB VRAM or more to take advantage of the GPU processors.

    Kind regards

    Claes

  • I am a user of Photoshop CS5.  I have a whole new camera Panasonic DMC-ZS50.  Help Photoshop says that this camera RAW images are supported.  But my Photoshop CS5 can not open these RAW files.  What should I do?

    I am a user of Photoshop CS5.  I have a whole new camera Panasonic DMC-ZS50.  Help Photoshop says that this camera RAW images are taken in charge by Photoshop.  But I can't open these RAW images in CS5.  What should I do?

    This device requires Camera Raw 8.8/9.0, which only CS6 or PS CC can handle. With CS5, you need to use the free DNG Converter.

    Adobe - Adobe Camera Raw and DNG Converter: for Windows

    Adobe - Adobe Camera Raw and DNG Converter: for Macintosh

  • Procedure that injects another procedure

    Hello everyone,

    I need to create a procedure that removes another procedure as follows:

    create or replace procedure drop_any_proc (proc_name varchar2) is
    drop procedure proc_name;
    end;

    Please let me know.

    Noor ul Huda

    In essence:

    create or replace procedure drop_any_proc (proc_name varchar2) is
    begin
      execute immediate 'drop procedure ' || proc_name;
    end;
    

    But I would add even more around it... of error management and safety nets and wonder why I want such a procedure :)

  • How to change a text element to have a link that opens another page?

    Hello

    How to change a text element to have a link that opens another page?

    Thank you
    Guy

    Hi guy,

    It is quit simple
    in your P5_TASK_NAME
    in the first text section text element:

    [] 
    

    Replace ' # ' f? p = & APP_ID.: 2: & SESSION.

    in the post text element:

    
    

    and this is

    Published by: Martijnke on March 11, 2009 12:21

    Published by: Martijnke on March 11, 2009 12:22

  • AS2 call another Web page javascript function. Help :)

    Hello

    I have a swf in as2 and when I click on a button, I want to open a new html page, and on this page, I have a function that depends on the value, show or hide a table

    the question is, how do I open this page and send this value and in this page, show or hide this table?

    I made the file swf and html

    I use getURL('.. / test.html?viewHide='2, «_self»); It is worth sending, but I can´t the function works.

    in the html code, I have this

    function viewHide (id)

    {

    var targetId, srcElement, targetElement;

    var targetElement = document.getElementById (id);

    If (targetElement.style.display == 'none') {}

    targetElement.style.display = "";

    } else {}

    targetElement.style.display = 'none ';

    }

    }

    Thank you very much

    This isn't the code that I have proposed.

  • [HELP] Call library function node...

    I have a DLL that has a function as follows:

    int GetMessageNameNumber (char * messageName [], const int MessageNumber);

     

    The function is used thus:

    char * MessageName = NULL;
    int MessageNumber = 0;
    ...

    error = HL1553API_GetMessageNumberName (& MessageName, MessageNumber);

    MessageName will contain the name of the message as a string.

    I saw the Devils own job trying to wrap this in a Labview module.  I have a knot of library function to call the above function, but I'm not sure what to set the parameter "MessageName" also!  I tried array of integers 8 signed bits, adapted to the Type of pointer to data in the table and then passed in an array of strings.  Whatever I do translates into LabView crash.  I know HL1553API_GetMessageNumberName works, because if I call it directly in TestStand it works fine.  I need LabView well!

    Any ideas?

    C a pointer to a string or an array of strings are completely ambiguous.

    char * something = char * something [].

    You can't tell the two apart from the syntax, but only from the documentation or an example of how the function is called. A C compiler treats the equal in terms of access (but a C++ compiler will do a syntactic differentiation when code syntax checking, with the possible result compile warnings when you are prompted to use a sufficiently high level of warning).

    The example shows that it is not a string array gets allocated by the caller and passed to the function, but a string pointer that is passed by reference. So the function will allocate a pointer and return it (a very atypical C practice at least for strings). This automatically raises the question when and how this pointer will be released? The documentation for this function should document the call from Manager memory allows to allocate this pointer and also point to the function to call to release. Ideally the library (DLL) provides an exported function for this purpose.

    Assume that everything I spoke so far is clear and available you need to cheat a bit LabVIEW. You need to configer a pointer size whole that is passed by reference. Now this whole in the diagram IS actually your channel. If you only need to pass this pointer to other library functions call that you're already doing. Otherwise if you need access to the contents of this string from the diagram LabVIEW, you will need to copy the information from this string to a real string of LabVIEW pointer.

    One way to do that is to use the export of the MoveBlock() C function that LabVIEW exports itself. I have explained this several times here on this forum and the MoveBlock research will no doubt find out these positions.

    Another slightly better way is to use the LStrPrintf() function which also exports of LabVIEW. To do this, you configure a library function call as follows:

    Library name: LabVIEW

    Function name: LStrPrintf

    Calling Convention: C

    Thread: both are possible, but the function is thread safe, so just use environment

    return parameter: int32 (there is a possible LabVIEW Manager error code)

    1st parameter: handle string of LabVIEW, passed by value

    parameter 2: C string pointer

    3rd parameter: integer pointer size, passed by valu

    Wire an empty string in the first parameter constant.

    Wire a constant containing the text '%s' without the quotes on the 2nd.

    The pointer to your thread on the 3rd string

    The function will return 0 as a return value and the content of the string on the side of the exit of the 1st parameter or a zero value indicating that a mistake to return back.

Maybe you are looking for