I'm trying to use my loaded variable "finalCount" from php in my flash "for loop", but it doesnt work. I have my code sitting in the root, frame 1. I have a dynamic text field on the stage, with the variable name finalCount, and it loads and display the variable perfectly. But still I cannot use the variable finalCountNum in the for loop.
My code is as follow:
My second question: How do I declare this if statement correctly? What I'm code is, if finalCount variable is not set or is empty, then finalCount = 20.Code:// Load variables from PHP script loadVariables("map3.php", this); // Turn variables from strings into numbers var finalCountNum = Number(finalCount); // Set variables for stage text-box stageFinalCount = finalCountNum; // Control variables xpos = 5; ypos = 5; yspace = 5; // Duplicate the dots and place them apart on the X & Y axis for (i=1; i<=finalCountNum; i++) { dot.duplicateMovieClip("dot"+i, i); this["dot"+i]._x = xpos; this["dot"+i]._y = ypos; ypos += yspace; } stop();
To see more on where I'm using this code, please reffer to the code above this one.
Thank you!Code:// if finalCountNum variable empty if (!finalCountNum) { finalCountNum= 20; }





Bookmarks