wait for a function at the end

Hello!

I work with Flex and remote objects (Java Classes). The problem I have is: don't wait for the action for the return of a function script. I mean:


value = loginRO.Login (idField.text, passwordField.text, message);

If (value == 1) {}
connectionState.text = "CONNECTED";
messageState.text = message;
}
else {}
connectionState.text = "NOT CONNECTED";
mx.controls.Alert.show ("there was an error trying to connect","CONNECTION FAILED" ");
messageState.text = message;
}

If the connection is successful you will get a '1' of the call and '0' in other cases. But the flex code still shows the "else" because it does not wait for the function "login" at the end of its execution. What should I do?

Internet connections are always asychronous in Flex, so we can't have any other code expects a frequency.

You should have the code or function that is executed/called in the your RemoteObject result handler.

If this post answers your question or assistance, please mark it as such.

Tags: Flex

Similar Questions

  • Waiting for automatic placement at the end.

    Hello

    I have a simple script that puts a BCTI file in a textframe and then saves the document.

    The target document is set to "automatic formatting" the happy ICML, and it creates pages as needed. It works very well.

    However the save operation does not wait for the autoflow finish. If the saved document has a page with overset text.

    It must have 2 pages and any overset text.

    If I leave the page open in InDesign, after a very short time, a new page is added, and the text is autoflowed.

    How can I get InDesign to wait for the "automatic formatting" after the operation before you save the file?

    Script:

    myDocument var = app.activeDocument;
    myPage var = myDocument.pages.item (0);
    var myTextFrame = myPage.textFrames.itemByName ("mainBody");
    myTextFrame.place (File ("page1.icml"));
    myDocument.save (File ("document1.indd"));

    Thank you.

    You probably want to remove the idle task, once completed. To set the sleep on 0:

    gDocsToSave = [];// Add docs that need to be saved to this array.
    var task = app.idleTasks.add({sleep:100});
    task.addEventListener(IdleEvent.ON_IDLE,saveDocs);
    
    function saveDocs(ev){
         var doc;
         while(doc = gDocsToSave.pop()){
              doc.save();
         }     ev.target.sleep = 0;}
    

    Substances

  • What happens when "Still waiting for network when starting the computer and logon" is enabled and that the computer is not connected to the network?

    In MMC, I created the group policy and found through web search that computers with mapped network drives can connect better if "always wait for network when starting the computer and logon" is enabled...  So far, it has been very nice to have allowed.  Is no longer mapped network drives see the place as disconnected.  But what happens if the computer is not connected to a network?  Say the wireless router will turn off and your computer always 'wait... '. "turned on, should the user could still log the computer timely?

    Check these:
    Troubleshooting intermittent slow connection or slow start of http://blogs.technet.com/b/instan/archive/2008/04/17/troubleshooting-the-intermittent-slow-logon-or-slow-startup.aspx
    Priority and group policy processing
    http://TechNet.Microsoft.com/en-us/library/cc785665%28WS.10%29.aspx
  • I installed Photoshop CC2014 to CC2015 which is a single 30 day trial (?) and my CC2014 is not accessible now, why? Does this mean that I have TO pay for this upgrade at the end of 30-day track? I can't go back to CC2014?

    I installed Photoshop CC2014 to CC2015 which is a single 30 day trial (?) and my CC2014 is not accessible now (it displays an exclamation mark) why? Does this mean that I have TO pay for this upgrade at the end of 30-day track? I can't go back / stick with CC2014?

    There is a problem with your account if it does not show that your subscription is current.

    Contact adobe support by clicking on this link then "still need help" as soon as it appears, http://helpx.adobe.com/x-productkb/global/service-ccm.html

  • Waiting for a function/process ends.

    I wrote the code for a simple gallery where you click on a button and it loads an image into a UILoader component.

    Problem is I want to add fading to it without any problems.

    I want it to fade out. load the image in UILoader componet, then at the end fade in. I use a dynamic interpolation for this. I also melted back when an image occupies the UILoader, then load a new image.

    PROBLEM is that I have a separate function that creates a dynamic Tween to fade. When he fainted, I want to load new images and then melted using the fade function that creates a Tween.

    How would I get to fix this problem?

    Also, I want my next button should be disabled while it is to load the images, so the person is not a hammer on the button constantly and Pepin to discoloration and break it.

    Here's an example of how I'd do:

    import fl.transitions.Tween;
    import fl.transitions.easing.None;
    
    var path:String="l4d_published";
    var currentPage:uint;
    var insArray:Array=[tn1,tn2,tn3,tn4,tn5,tn6,tn7,tn8,tn9,tn10,tn11,tn12,tn13,tn14,tn15];
    var imgArray:Array;
    var tweenArray:Array=[];
    
    for (var i:uint = 0, len:uint = insArray.length; i < len; i++) {
        insArray[i].visible=false;
        insArray[i].addEventListener(Event.COMPLETE, imageLoadComplete);
    }
    
    pagefwd.visible=pagebwd.visible=false;
    
    pagefwd.addEventListener(MouseEvent.CLICK, fwdClick);
    pagebwd.addEventListener(MouseEvent.CLICK, bwdClick);
    
    function fwdClick(e:MouseEvent):void {
        setPage(++currentPage);
    }
    
    function bwdClick(e:MouseEvent):void {
        setPage(--currentPage);
    }
    
    var myTextLoader:URLLoader = new URLLoader();
    myTextLoader.dataFormat=URLLoaderDataFormat.VARIABLES;
    myTextLoader.addEventListener(Event.COMPLETE, textLoadComplete);
    myTextLoader.load(new URLRequest("l4d.txt"));
    
    function textLoadComplete(e:Event):void {
        imgArray=e.target.data.images.split(".jpg,");
        setPage(1);
    }
    
    function setPage(page:uint):void {
        currentPage=page;
    
        pagebwd.visible=(currentPage!=1);
        pagefwd.visible = (currentPage=imgArray.length-1) {
                insArray[i].visible=false;
            } else {
                insArray[i].visible=true;
                insArray[i].alpha=0;
                insArray[i].source=path+"/"+imgArray[imgID]+"_tn.jpg";
            }
        }
    }
    
    function imageLoadComplete(e:Event):void {
        tweenArray.push(new Tween(e.currentTarget,"alpha",None.easeOut,0,1,1,true));
    }
    
  • get the structure of the event inside the while loop to wait for event occurs before the execution

    Hello

    I have a small problem, when I raise an event using a value change button, which works very well.  The problem is that the VI does not wait for me raise an event and instead runs the same event again, even if I have not pressed the button to start again.  The mechanical action of the button switch is released is.

    I was wondering how you get the structure of the event to wait for a user event, after that he executed the first time.

    James.Morris wrote:

    There is no reason that the event should be raised twice as much that the only way that it fires in your code is by the user by clicking on 'Hall measure only'.

    Oh yes, there is, and I deserve a kudo for this one.  Mechanical action on the button is set on the switch until published, so click to generate an event, on the bottom and on the square, attached is an example.

    My boy has my students hate this question, and to be honest, I hated it.  When never would you do that intentionally?  Honestly?  Anyway to change the button back to normal (as default latch when released) and move the terminal button in the structure of the event where it is managed and it will work as usual.

  • What is the next version for 'Windows Vista' after the end of "Adobe Reader 9.5.5" support on 26/06/13?

    After the recent update "Adobe Reader 9.5.5" the end of support for this version is 23 June 2013. It is installed on an edition of "Windows Vista Home Premium Service Pack 2". System type: 32-bit operating system.

    Adobe Reader X is supported under Vista.

  • trigger a function at the end of a timeline

    Hello-

    I have a movie that is embedded in a timeline. In the last picture, I want her to play a function-

    How to do this?

    Thank you-

    Both of your solutions go to waste treatment. For the first you just use the line of the function in the last picture...

    gotoAndPlay("200")

    and for the second, you just call the function.

    MovieClip (root) .nextNav ();  or same MovieClip (root) .gotoAndPlay (3);

    You probably have a misconception of what is normally used for the ENTER_FRAME event.  Normally, it is used when you want to repeatedly have something.  It's the nature of the ENTER_FRAME event... He shoots continuously once it is activated at the rate of your file.

  • using the date of today as default for this function in the package

    Hello all;

    Please find attached the sample data and syntax
    create table tbl_one
    (
      id varchar2(200),
      place varchar2(300),
      create_date date
    );
    
    insert into tbl_one
      (id, place, create_date)
    values
      ('D', 'MN', to_date('3/3/2011', 'MM/DD/YYYY'));
    
    
    insert into tbl_one
      (id, place, create_date)
    values
      ('X', 'DC', to_date('3/4/2011', 'MM/DD/YYYY'));
      
    
    insert into tbl_one
      (id, place, create_date)
    values
      ('A', 'NY', to_date('3/31/2011', 'MM/DD/YYYY'));
    PL/SQL Developer package
     body ----------
    
    create or replace package P_test is
     
      -- Public type declarations
    type cur is ref cursor;
    function test_fn
    (
     from_period in varchar2,
     to_period in varchar2
    ) return cur;
    
    end P_test;
    
    spec ----------------------
    
    create or replace package body P_test is
    
    function test_fn
    (
     from_period in varchar2,
     to_period in varchar2
    ) return cur as
    
    my_cur cur;
    Begin
      open my_cur for 
      
      select p.id,
             p.place 
      from tbl_one p
      where trunc(p.create_date) >= to_date(from_period, 'MM-DD-YYYY')
      and trunc(p.create_date) <= to_date(to_period, 'MM-DD-YYYY');
    return my_cur;
    end test_fn;
    
    end P_test;
    now, I'm just wondering how to make the to_period to have a default value of today's date

    user13328581 wrote:
    I've tried, but it does not work it shows unfortunately no display... the only other way I can think is to use multiple if statement to check and then make a select in... but I just feel it is a better way to do.

    Published by: user13328581 on March 31, 2011 13:09

    It does not define it.

    SQL> CREATE PROCEDURE dt_test (p_start_dt IN VARCHAR2,
      2                            p_end_dt   IN VARCHAR2 DEFAULT TO_CHAR(sysdate, 'MM-DD-YYYY')) AS
      3  BEGIN
      4     DBMS_OUTPUT.Put_Line ('Start is: '||p_start_dt);
      5     DBMS_OUTPUT.Put_Line ('End is: '||p_end_dt);
      6  END;
      7  /
    
    Procedure created.
    
    SQL> exec dt_test('01-01-2011', '02-28-2011');
    Start is: 01-01-2011
    End is: 02-28-2011
    
    PL/SQL procedure successfully completed.
    
    SQL> exec dt_test('01-01-2011');
    Start is: 01-01-2011
    End is: 03-31-2011
    

    Or are you still passing two parameters with the possibly due date null like this:

    SQL> exec dt_test('01-01-2011', null);
    Start is: 01-01-2011
    End is:
    
    PL/SQL procedure successfully completed.
    

    If you is the case then you can do something like:

    SQL> CREATE OR REPLACE PROCEDURE dt_test (p_start_dt IN VARCHAR2,
      2                                       p_end_dt   IN VARCHAR2) AS
      3  BEGIN
      4     DBMS_OUTPUT.Put_Line ('Start is: '||p_start_dt);
      5     DBMS_OUTPUT.Put_Line ('End is: '||COALESCE(p_end_dt, sysdate));
      6  END;
      7  /
    
    Procedure created.
    
    SQL> exec dt_test('01-01-2011', null)
    Start is: 01-01-2011
    End is: 31-MAR-2011
    
    PL/SQL procedure successfully completed.
    

    If your predicate would become more like:

    trunc(p.create_date) <= COALESCE(to_date(to_period, 'MM-DD-YYYY'), TRUNC(sysdate);
    

    John

  • How to use the node function call library for a function in the dll with the data SUB type

    Hi all

    I would ask for your kind help

    I am facing a problem with the call library node.

    I have a C++ (stdcall) function, which has Sub as data type

    XXXX error code (hwnd, lid, getValue, * Sub data1, * Sub data2)

    data1 and data2 types are constantly changing based on the value of 'getValue '.

    Mainly I can use the call library node several times and adapt each node according to the types of data data1, data2 and extract the values and use in the code. Here is no question. Real question is:

    My question:

    How can I use a node of library time call and make a case according to the 'getvalue', who will control the data1, data2 data type. Here I really seeking solutions.

    My tests:

    I used varaints as entry to the libray call node of the data1, data2 and selected parameters in the call libraby node as "Adapt to type. Here labview just crashed.

    I appreciate your suggestions to feedbackand.

    Thank you

    Karine

    You must allocate enough space for data1 and data2, and then pass a pointer to this space. An easy way to do this is the function to initialize table. Set the U8 type and size for the number of bytes required. Pass this array to the function as a pointer of table data.

    After the function call returns, you need to extract the data in the table. You can do it manually, but a simple approach is to use the array of bytes to a string. Then, in a housing structure, use Unflatten chain to convert the string to the correct data type. This method also converts the "endianness" which will be probably necessary; Be sure to only set all entries for unflatten correctly.

  • iPad IOS 9.3.4 (with GPS) air 2: using Skydemon (used for the flight) gives "Waiting for location data", as the error

    I use my iPad 2 a air application during the flight of an aircraft (Skydemon) for flight and my flight plan.

    Most of the time it works fine. Yesterday, I received an error "pending for location data. seems dat that GPS does not work correctly. I've recently implemented in the latest IOS update.

    Don't know

  • I got a new Sport iWatch for my birthday at the end of November. I followed the start of instructions for synchronization with my iPhone. Nothing happened. The iWatch battery was completely dead. Is this normal with a new show?

    The battery on my new iWatch was dead when I opened the box. Is this normal? The watch seems to work now after that I gave her a load.

    Hello

    The battery on Apple Watch charge will reduce over time, even when it is off.

    It is possible that your watch has been stored for a while before you received it as a gift. Your communities of Apple Support profile indicates that your watch has watch OS installed 1.0.1. This version of the software was released in may 2015 and was followed in September 2015 watch OS 2.0.

    For all the latest features and best performance, update your iPhone and Apple Watch for the latest versions of software (currently 9.2 and watch OS 2.1 iOS). The software update instructions are available here:

    - Update the iOS on your iPhone, iPad or iPod touch - Apple Support software

    - Update the software on your Apple Watch - Apple Support

    More information on the workload of your watch:

    Check your battery and load your Apple Watch - Apple Support

  • Nc6 received for Christmas.  Towards the end of download and installation

    My wife received nc6 for Christmas last year.  Now, I'm trying to download it and install it.  I registered the product on the website.  The site says that there is no command.

    How can I fix it?

    Her husband

    You should be able to download the software from the page linked below.  If you have a serial number of the purchase that should be all you need to activate it.

    http://helpx.Adobe.com/x-productkb/policy-pricing/CS6-product-downloads.html

    Alternatively, you can find the trial version available for download through the page linked below.

    You can download the demo version of the software through the page linked below and then use your current serial number to activate it.

    Don't forget to follow the steps described in the Note: very important article Instructions on the pages to download to this site or the download may not work properly.

    CS6: http://prodesigntools.com/adobe-cs6-direct-download-links.html

  • Calling a function at the end of the event

    I know I've done this before, but I can't seem to remember tonight.  I want to make a function after a Tween is completed.

    What Miss me?

    buttonArea_mc.buttonMode = true;

    buttonArea_mc.useHandCursor = true;

    buttonArea_mc.alpha = 1;

    var myTween:Tween;

    buttonArea_mc.addEventListener (MouseEvent.CLICK, clickThru);

    function clickThru(e:MouseEvent) {}

    myTween = new Tween (buttonArea_mc, "alpha", None.easeNone, 1, 0,.5, true);

    startMovie(); / * What is the listener * /.

    }

    startMovie {}

    gotoAndPlay (10);

    }

    :

    buttonArea_mc.buttonMode = true;

    buttonArea_mc.useHandCursor = true;

    buttonArea_mc.alpha = 1;

    var myTween:Tween;

    buttonArea_mc.addEventListener (MouseEvent.CLICK, clickThru);

    function clickThru(e:MouseEvent) {}

    myTween = new Tween (buttonArea_mc, "alpha", None.easeNone, 1, 0,.5, true);

    myTween.addEventListener (TweenEvent.MOTION_FINISH, startMovie); / * is the listener * /.

    }

    startMovie {}

    gotoAndPlay (10);

    }

  • Windows XP starts with a black screen and hangs for two minutes before the end of the boot process.

    Original title: Windows xp slow at startup delayed to the office after you download the updated April 8,2011

    First time after updating, would start then black screen can see the cursor then took 20 minutes before Office input... now does the same thing but just a few minutes. What happens all started after the recent update April 8... something about a NET update? any IDE how to fix?

    Hi kaeli,.

    ·         Have you checked the problem in safe mode?

    Step 1: Try to start in safe mode to see if you can start fine.

    Step 2: If he is able to start fine then try try perform a clean boot to normal mode to check whether a third-party program is causing the problem.

    How to configure Windows XP to start in a "clean boot" State

    You can also read the following article to resolve the problems on the issue.

    Perform a clean boot to determine if background programs interfere with your game or program.

    Note: Make sure that you put the computer to a Normal startup once you are finished.

    See also:

    Computer stops responding with a black screen when you start Windows XP

Maybe you are looking for

  • Satellite P750 - guaranteed date wrong

    Hello world! I just got a message from Tempro saying that my warranty will expire soon. The thing is that I bought my laptop on Amazon.de on February 3, 2013. Looking at the date recorded, it is said 2012. This is completely wrong and I know that I h

  • My MG5220 printer keeps going offline

    I have a Pixma MG5220 printer and a laptop HP with Windows 8.  Continues to go the printer offline despite the fact that I have re-installed several times.  Sometimes it works for a while and sometimes it only works once or twice and then the next ti

  • I need a copy of the Fax in Windows XP (fxscfgwz). I don't have an XP disc.

    I need a copy of the Fax in Windows XP (fxscfgwz). I don't have an XP disc.

  • Settings of brightness are reversed in Windows 7

    Brightness settings under power options are inverted by setting to the left (dimmer) brightness setting lights up the screen and the gauge on the right setting that is supposed to make makes it brighter screen the screen inverter is possible in the r

  • Direct mail has recently ceased to send emails in a folder.

    I run a tennis league, and I send confrontations, etc. for about 120 players.  Before the last two weeks, I could just grab the file leagues 2013 as send it to and he would send the email.  Now, when I do that a single or two people received the mess