Flash Advisor logo
:: Desktop Shortcut
:: Flash Help
Advice from Experts

+ Reply to Thread
Results 1 to 3 of 3
  1. #1

    Question actionScript newbie help

    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

  2. # ADS
    Join Date
    Always
    Posts
    Many
     
  3. #2
    Join Date
    Jun 2009
    Location
    Houston, Tx
    Posts
    485

    Default

    Quick answer: Read the online help docs Adobe makes available to you. If you need help with syntax, that is the place to go.

    Also. I'm not sure if your aware of this, but there isn't a single question in your post. It looks like your just demanding people do stuff for you. Not saying that it's bad thing, just saying.

    Btw, I may sound really rude. But, I believe that harsh criticism is much more helpful than just hinting that what you did could have been done better. Don't take anything personally. I do it to everyone who posts here.
    Last edited by Vlykarye; 10-04-2011 at 03:58 AM.

  4. #3
    Join Date
    Jun 2009
    Location
    Houston, Tx
    Posts
    485

    Default

    Longer reply on code logic:

    Alright, I'm a bit at a loss for words here. I don't know if I can accept that what you typed came word for word from an actual, published book. If what you say is true, someone needs to get slapped and their license to write taken away.
    I'll type a response as if to correct someone who just typed it up. Hopefully, it will help show you what not to do when writing directions for code.

    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
    ...
    Increments the value of the variable n by 1
    If the button creates a variable named 'value' and 'n' each time, then why increment the variable at the end? The value of 'n' would just be erased.

    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.
    While loops are statements. They aren't 'created,' just used. Dunno what the cookie movie clip symbol is.

    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.
    Please don't ever say "SetProperty actions," like he/she did. Say, "the while loop should also set the x and y coordinates to blah and blah, respectively," if you ever do say it.


    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
    What is 'check,' exactly? We never created that variable. Don't call statements "actions." For this example, one should say, "the if statement."

    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)
    "Populates?" lol, funny word selection after all that has been said so far.

    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.
    Please don't let me catch you ever calling statements actions; actually, don't let anyone catch you doing this. The author should be thankful you didn't post his name on here.
    I really don't understand what he/she is looking for. Are there more pages to this? If so, could you semi type them up (summary style) or take a picture and email me, maybe.
    If not, I dunno what to say man.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Sponsors
Create Speaking Characters for your website and Flash movies. 15 Day Free Trial