2 Replies Latest reply on Mar 5, 2009 8:26 AM by

    Passing Data between Functions

      Hi,

      Is there a way to pass data between Functions? What I am trying to do is the following:

      I have a private Function called onBtnBook which will handle what page(.mxml component) of my Application the User will be sent to when a button is clicked. I need to capture the page that the User was on before they clicked the button and can do this fine by capturing the selectedIndex value into a variable of the ViewStack that I am using for Navigation and is in my main Application file.

      What I need to happen next is when the User clicks on the Back button it sends them back to the page that they were originally 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 selectedIndex value of the page the user was on) in my function onBtnBack, so as to send the User back to the correct page, I am running into problems with accessing the data in this variable.

      Is there a way of accessing the data from the variable in the 1st function onBtnBook and manipulating it in the 2nd function onBtnBack?

      Thanks