I am using Actionscript and the problem I am having is the I am running a for loop to execute a function which loads the variables from XML and then another function to load an external SWF which will load the variables from the first function. Here is the code snippet
Currently, createproduct will create a series of arrays with the new data. The displayproduct() function pushes the data out into a image loader. However, my guess is that the loop is executed so quickly, that the data becomes the last instance in the for loop and therefore displays the same(last instance) data for both displayproduct function. Is there any way to have a function wait till the previous function completes? That way when I fun the script, it will show up 2 instances of the image loader with the appropriate data. Thank you in advance!
Hello, Thanks for the help, however, it still doesn’t show the first data for the loop. The displayproduct function basically calls an external swf file which will pull out the data associated with the createproduct function (which creates an array of data). Is there a way to have the createproduct function to wait until the displayproduct function completes? Thanks again!