i defined a global array in the first frame.
When the user clicks on a button a value is inputted into the array, and they can click on several so all the different values are stored in an array.
I want to display the last value of the array, so the last button they clicked on, on a separate frame.
so i define my array like:
_global.purchases = new Array();
and the code on my button is:
and the code on the frame with the text box is:
var arrayCount = purchases.length;
var latestValue = arrayCount-1;
imagename_txt = "A White";
However, the text doesnt display at all. If I trace my array then I get "awhite". If i trace arrayCount I get "6" and "5" for latestValue. But if i try and trace purchases then I get "undefined".
I'm very confused and would really appreciate any help...
to add a value to an array use:
and to assign your textfield's text property you should use its instance name:
imagenameTF.text = purchases[purchases.length-1]; // where imagenameTF is your textfield's instance name.