Hi all,
I am trying to advance my very limited skill in Flash. I have coding experience in javascript and thats about it... I'm trying to create a simple counting game and I know what i need to do for the script( I'm doing projects from a flash book), just unsure of actionscript syntax. This book doesn't really go over the script well...here is what I need the script to do...
upon the click of a button script does the following
Creates a variable named value and set it to a random number between 1 and 5
Creates a variable named n and sets its value to 0
creates a while loop which says that while the variable named n is less than the variable named value, duplicate the cookie movie clip symbol. name the new instance with the word cookie, an underscore, and the value of the variable n, and set the new instance at a depth of the value of the variable n.
The while loop should also use two SetProperty actions to set the location of the new movie clip instance: the X coordinate should be set to a random number between 1 and 200, with an offset of 10, and the Y coordinate should be set to a random number between 1 and 100 with an offset of 250.
Increments the value of the variable n by 1
Upon the click of a different button script does the following:
Uses the if action to check if the number in the variable named check is = to the number in the variable named value and, if so, jumps to frame 2 and populates the dynamic text box named score with the words "Good job, the number of cookies that spilled is " and the variable named value.(hint: Add a plus sign and a period in the quotation marks +"." after the value variable in the ActionScript code)
Uses the else action to perform the following actions when the condition is not true:
jump to frame 3 and populate the dynamic text box named score with the words "No, that is not right. The number of cookies spilled is "and then the variable named value.
Now I typed this word for word from the book...it is confusing as all get out to me..but maybe simple to you all...if anyone can offer some help with this that would be great!!
Thanks,
Steph


Reply With Quote

Bookmarks