Passage of data between functions

Hello

Is it possible to pass data between functions? What I try to do is the following:

I have a private function called onBtnBook which will do what (component .mxml) page of my application will be sent to the user when the user clicks a button. I need to capture the page that the user performed before they have clicked on the button and you can do this by capturing the selectedIndex value in a variable of the ViewStack I use for Navigation and is in my main Application file.

What I have to do then is when the user clicks the back button, it sends back to the page they were on. I have a second private function called onBtnBack to handle this. However, as I need to use the variable created in the onBtnBook (which contains the value of the selectedIndex of the page that the user did) in my onBtnBack function, to return the user to the correct page, I am short of problems with access to the data in this variable.

Is there a way to access the data of the variable in the 1st onBtnBook of function and handling in the 2nd onBtnBack of function?

Thank you

You must make a public variable and it may be related.

[Bindable]
public var myLastIndex:int;

private function onBtnBook (): void {}
myLastIndex = viewstack.selectedIndex;

}

private function onBtnBack (): void {}
viewstack.selectedIndex = myLastIndex;
}

or something in that sense

Tags: Flex

Similar Questions

  • Help on the passage of data between vi when built in exe

    Hello

    I have this problem and grateful if someone can give me a heads up the right direction.

    I'm trying to write a program for acquisition of data and control of two instruments simultaneously.

    An instruments is a rotating stage that I control the movement and data read using activex controls. I do this in a vi that I have two distinct time of lines, one for updating the Rotary floor continuous data and other while loop for the handles of event structure.

    The second instrument is a detector that follows the rotation of scene. For this, I have an another vi with two loops for example, for data acquisition hollow rs232 and another while the loop is to the structure of the event.

    I use globals to pass data between the vi and it works very well in a labview project environment. However when I Isaiah to compile these exe files. I can no longer spend data.

    Is there a programming method when you communicate with more than one instrument. What I want to ask is, say I have a function, oscilloscope etc engine generator How can I control them in windows separated (for example, separate programs) and pass data to the other?

    I would be grateful for any help.

    Hello

    Global variables are not accessible to separate executables because their areas of memory are not shared. This can be found in the following document: If I can use a Global Variable to share data between two executable LabVIEW? The only way to have it working would be to use a main VI that launches your two separate applications like subVIs. This would allow you to share a global variable between the two. Your other option would be to use the method described in the article, or to use shared Variables: How to communicate between several executable LabVIEW using shared Variables?

    -Zach

  • Transmission of data between functions

    The Fodé below aims to get information from a database and returns the value stored in the peopleColumn property. How can I find the return value to the class constructor?

    Quote:
    Posted by: SiHoop
    Below, I tried to simplify my problem. I have a mxml file and a class.

    The mxml file creates an instance of GetNames and traces GetNames. peopleColumn. However, peopleColumn has the value twice in the GetNames class. First of all, it is given the value ["11", "22", "33", "44", "55"], but then, when a php file has loaded, it is replaced by ['00', '00', '00', '00', '00"]. I don't understand why the changed value does not appear in the statement trace. Instead of tracing the changed value, it displays the original value.

    It works however you just see the result before the end of service.send () request.

    Try this see MXML, I mean:

  • How to transmit DATA between several state machines.

    Hi I'm doing a project that needs to acquire data from a simulated data file and display it on a graphical interface. Two of them are manufactured in a state machine. I wonder if it is a good way of communication of data between two state machines? It would be very appreciated if you can provide a few examples. Thank you very much.

    OK, there are plenty of ways to communicate, but who are these state machines in the same project? Same VI? All LabVIEW?

    I like functional global variables due to the functionality that can be included in the. If they are used wrongly, as most of the things with the coding, you will create the races and break your code.

    Work of local variable, but I try to clear them tsar when possible. If they are used wrongly, as most of the things with the coding, you will create the races and break your code.

    Queues are pretty popular to connect, but try to stay with fixed size data, if you think that the limits of memory could be a problem.

    If you speak through the eyes of network to published static Variables (do not use these unless you have a stable network) network, TCP/IP, UDP, or Web Services flow (you need experience in this field. It is not just together.

    LabVIEW is a good way to program, but this kind of key options.

  • Pass data between panels

    I have a digital slide on a Panel. When I move the cursor, I need the value update on another Panel.

    How can I do this?

    The two panels are loaded as a senior-level windows.

    It seems that I read something on the use of queues to pass data between the panels, but I can't seem to find where I read that.

    A basic concept that differentiate the CVI to other languages, it's that there is no relationship between a sign and a specific source file. I mean, you do not need to put a sign functions in a specific source file: they can be spread over multiple sources; Conversely, you might have a source only that collects reminders for all panels of files in your application. What readers recall execution are Panel handles and control ID. (One effect of this paradigm is, you might have a reminder installed on controls on different panels).

    For this reason, there is no problem by putting the cursor callback in panel1.c. In addition, you can call the file source in a different way.

    Arriving at the base of your problem, a DAQ multithreaded application is really different from a UI single-threaded application.

    Put the functions of data acquisition in a separate thread can be beneficial for your application, because they are not likely to suffer user interface events.

    CVI provides also the different methods of transmission of data between threads. the most powerful in data acquisition applications is probably a Thread Safe queue.

    I suggest you look at Programmer's Reference > chapter of the creating multithreaded Applications to aid, where the basic principles of programming are explained multithreaded and information are provided on all instruments CVI includes.

    If you want to discuss on this scenario, I suggest yu to start a new thread, as it has nothing to do with the original question with which you started this discussion.

  • Find dates between 2 dates given

    Hello

    I want to write pl/sql block that will give me the dates between 2 dates that I entered. Are there any oracle in built function that does. I use version oracle 11g rel2.

    We know not what you want, but it looks like:

    SQL> select  &start_date + level  - 1 dt
      2    from  dual
      3    connect by &start_date + level  - 1 <= &end_date
      4  /
    Enter value for start_date: date '2012-08-01'
    old   1: select  &start_date + level  - 1 dt
    new   1: select  date '2012-08-01' + level  - 1 dt
    Enter value for start_date: date '2012-08-01'
    Enter value for end_date: date '2012-08-31'
    old   3:   connect by &start_date + level  - 1 <= &end_date
    new   3:   connect by date '2012-08-01' + level  - 1 <= date '2012-08-31'
    
    DT
    ---------
    01-AUG-12
    02-AUG-12
    03-AUG-12
    04-AUG-12
    05-AUG-12
    06-AUG-12
    07-AUG-12
    08-AUG-12
    09-AUG-12
    10-AUG-12
    11-AUG-12
    
    DT
    ---------
    12-AUG-12
    13-AUG-12
    14-AUG-12
    15-AUG-12
    16-AUG-12
    17-AUG-12
    18-AUG-12
    19-AUG-12
    20-AUG-12
    21-AUG-12
    22-AUG-12
    
    DT
    ---------
    23-AUG-12
    24-AUG-12
    25-AUG-12
    26-AUG-12
    27-AUG-12
    28-AUG-12
    29-AUG-12
    30-AUG-12
    31-AUG-12
    
    31 rows selected.
    
    SQL> 
    

    SY.

  • Copy data between the custom dimension members or scenario

    Dear Experts,

    I'm back with my silly question.
    Is there anyone know how to copy all the data (not only entity currency) between members in the custom dimension? Our HFM application has a different type of data because the type declaration (legal and audit). Whenever we arrived with our legal data, we copy our legal consolidated data for verification. We tried to create a formula (using hs.exp) to move data from legal to check, but apparently, this formula should be write inside Sub calculate (). Is not supposed, we do not want to run the copy data every time that the user click on calculate.

    We also perform copy data between the scenario, as actual to Budget. This activity also needs all the data consolidated and final.

    So the condition for the copy of data are:
    -data must be consolidated
    -Copy all the data, including the adjustment

    Is there a formula or a way to copy the data that can be triggered individually (click 1 rules that run only copy data) by the user?

    Thank you very much for your kind response,
    -Anna

    Hi Anna,.
    As you say, you cannot trigger different parts of rules to run in HFM. Instead, you use a condition. In your case this condition might be guided by the management of the process. You can use a combination of GetSubmissionPhase, review status , and ReviewStatusUsingPhaseID functions that returns the current process management level and presentation details: phase. To me, it seems that as soon as you have finished legal, you complete a part of your process cycle and enter another stage of verification. Here are the parts of your publishing process, if you have defined a process in HFM management or not, which means that you should consider using it.

    -Kostas

  • Problem with counting function, passing VARs between functions.

    Hi guys, I have a problem with this section of code...

    Could anyone suggest how to fix the function at the bottom so that when the button forward_btn with label "go to next Point training" when you click on recalculate the fields created in the function fileLoaded

    var xmlData:XML = new XML ();
    var theURL_ur:URLRequest = new URLRequest ("xml.xml");
    var loader_ul:URLLoader = new URLLoader (theURL_ur);
    var more: RegExp = / \ + / g;
    var t:Number = 0;
    var tmax:Number = 0;

    loader_ul.addEventListener ("complete", fileLoaded);

    function fileLoaded(e:Event):void {}
    xmlData = XML (loader_ul.data);
    Tmax = xmlData.Record.length ();
    trace (tmax);

    trace (unescape (xmlData));
    trace (xmlData.Record.length ());


    var title_tp:String = unescape(xmlData.Record.TP.Title[t]).replace (, "");
    Title_TP_txt. Text = title_tp;

    var intro_tp:String = unescape(xmlData.Record.TP.Introduction[t]).replace (, "");
    Intro_TP_txt. Text = intro_tp;

    static_tp_intro.y = Title_TP_txt.y + Title_TP_txt.textHeight + 10;
    Intro_TP_txt.y = sta_tp_intro.y + sta_tp_intro.textHeight + 5;

    Title_TP_txt. AutoSize = TextFieldAutoSize.LEFT;
    Intro_TP_txt. AutoSize = TextFieldAutoSize.LEFT;
    }

    forward_btn.label = "go to the next Point training";
    forward_btn.addEventListener (MouseEvent.CLICK, next_if);

    function next_if (me: MouseEvent): void {}


    If (t == tmax) {play();  }


    else {t = t + 1;
    fileLoaded () ;}
    }

    I don't see where you have a question from vars between functions because you do not pass everything.  Maybe that's your problem.  The function fileLoaded expects an argument, but you are not providing one.  To get around that you should provide any argument being sent in the first function...

    function fileLoaded(e:Event=null):void {}

    Another option would be to separate features and put a quick end to the function fileLoaded and create another function that holds the rest of the code...

    function fileLoaded(e:Event):void {}
    xmlData = XML (loader_ul.data);
    Tmax = xmlData.Record.length ();

    processXMLData();

    }

    function processXMLData (): void {}
    trace (tmax);

    trace (unescape (xmlData));
    trace (xmlData.Record.length ());

    var title_tp:String = unescape(xmlData.Record.TP.Title[t]).replace (, "");
    Title_TP_txt. Text = title_tp;

    var intro_tp:String = unescape(xmlData.Record.TP.Introduction[t]).replace (, "");
    Intro_TP_txt. Text = intro_tp;
      
    static_tp_intro.y = Title_TP_txt.y + Title_TP_txt.textHeight + 10;
    Intro_TP_txt.y = sta_tp_intro.y + sta_tp_intro.textHeight + 5;
      
    Title_TP_txt. AutoSize = TextFieldAutoSize.LEFT;
    Intro_TP_txt. AutoSize = TextFieldAutoSize.LEFT;
    }

    forward_btn.label = "go to the next Point training";
    forward_btn.addEventListener (MouseEvent.CLICK, next_if);

    function next_if (me: MouseEvent): void {}

    If (t == tmax) {}

    Play();

    } else {}

    t = t + 1;
    processXMLData();

    }
    }

  • Identify the best way to transfer data between applications in Essbase

    Hello Experts,


    One of my clients uses Hyperion System 9.3.1 and they try to understand if the partitioning might be a way to automate the transfer of data between applications Essbase (using the partitioning of replication).

    The challenge, they say, is that they may need to send the budget a source application (SLVQ) data to an application (consolidated) target. Data can be changed in Conso and returned to the SLVQ for review.

    They get warnings when they define partitions in both directions because the partitions are overlapping, but it works.

    Are there concepts or reasons why they should not use this function (transfer in both directions)? Is this something that is used by other companies?

    Their alternative is to export data in text file, then reload with rule files. It seems more difficult to define (MaxL scripts-> text files-> rules of files) with more chances of getting errors. Is there some other effective solutions which we do not understand?

    Please suggest.

    Thanks in advance

    Kind regards
    Jingle

    Hi Lisa,
    other than the scores, text file
    There are two more, according to my knowledge

    1 XREF
    2 HAL (Hyperion Application Link) using adapters essbase

    We use the XREF and HAL to our company to transfer data between applications according to the needs.
    I hope this helps.

    Dornakal.
    www.dornakal.blogspot.com

  • How to make the exchange of data between 2 whole loop real-time

    Hello
    I have 2 while loop
    the 1st loop includes data acquisition program
    the 2nd loop includes control program
    --------------------------------------------------------------------------------------------------------------
    My question is how do the exchange of data between 2 whole loop real-time

    --------------------------------------------------------------------------------------------------------------
    I tried with the variable and direct wiring between the 2 local while loop
    It does not work (there is a delay)


  • Share data between a PC host and NEITHER sbRIO-9626 connected by Ethernet


    Hi Sophiec,

    In fact, shared Variables are a good way to share data between a host and a target. However, this is not the only way for data sharing.

    On the follow-up document, you will find different ways to do it: http://digital.ni.com/public.nsf/allkb/48D244EC86971D3986256BD4005CCC28 as:

    Shared variables
    TCP
    UDP
    DataSocket
    Other methods of Communication

     

     

    I hope this will help!

     

     

  • What is the best way and to share data between a server and a Client app?

    Hello

    I'm trying to communicate a Client-Server application.

    In fact, I already have a simple data transfer via TCP/IP. However, I don't know yet, if TCP/IP is the best (and by that I mean, better, faster, safer, etc.)

    How to do.

    What are the cons and Pros between TCP/IP, STM and shared Variable?

    Do you recommend another type of communication in addition to these 3?

    Thank you

    Matt.

    In my view, that a general question cannot have a response says.

    Then, there is no way 'the best' for sharing data between a client and a server app.

    I like to use TCP/IP, but sometimes (when data loss is not critical) I use UPD (quick and dirty).

    I generally avoid shared variables, especially on embedded devices.

    Some other times I have I like to Exchange data in a database...

    A few other times I Exchange data using file...

    Marco

  • Core 1 page 9-4: "...". pass data between parallel patterns... »

    «.. . If allows you to pass data between parallel block diagrams... son"this can be done?

    They mean transfers data between parallel loops/structures?

    The question is a Hue. It is not parallel, using wires. Two loops are not connected is perhaps parallel. We read your table of contents it a game of guessing on the sentence of your thread. Maybe if you get into the details.

  • Sharing data between multiple while loops, competitor rates

    Hello

    I am trying to Exchange data between competitor while loops running at different speeds.  What is the recommended way to do this?    In practice, I have 12 indicators and 3 cards I would update (on screen) in the slower loop, although the data acquired and stored on disk in the fastest loop.  The image below is a simplified version of what really works my candidacy.

    I currently use local variables and shared to achieve this.  I heard however that local variables are evil because of their use of memory (data are copied instead of who passed by reference).

    Thanks for your suggestions,

    Adam

    Hi Adam,.

    Yes, here you go.

    Mike

  • How to make a table with all dates between two dates

    Basically, I need a vi that returns an array with elements containing all individual dates between the two dates. I am trying to build one myself... but obviously if there is already a few vi do that I would use it instead. Anyway, any help is appreciated... I'll just be over here write it too hard to pass the time.

    Just an idea

    Output is the table of dates (like timestamps) between the timestamps 'Start' and 'end '.

    Marco

Maybe you are looking for

  • I can't go to iOS 9 on my older ipod model

    I can't go to iOS 9 on my older ipod model, he always says: everything is up-to-date, but my version is iOS4

  • How do I stop or cancel an update being el capitan? I don't want that he

    can someone help me how to stop an update being el capitan? so many bad reviews that I've read so far and I decided to not continue with the updates... Please someone help me. Thank you very much.

  • Mp3 ringtones

    I have the motorola cliq, and I'm not able to put my mp3 ringtones for notifications by sms or email. I changed the memory card. If this folder ringtones should be in?

  • Cannot reset the home page

    I tried to reset my home page with Internet Options, but the area that is shaded and a message at the bottom of the dialog box shows some settings are managed by your administrator. Problem is my computer is a stand-alone system, not in any network c

  • [EC] SOSTITUZIONE HD MD3000

    Buongiorno, Con richiedo present a request by 1 HDD by lo MD3000 STORAGE Serial number: 5WSJ04J