3 questions for my game

Greetings everybody! This is my first post in this community, and unfortunately I need some help with this actionscript coding. Even if only 1 problem can be solved, I would definitely appreciate it
Challenge #1:
I have a movie clip that moves randomly around the screen. How would I make this movieclip duplicate once every 10 seconds (while user is still playing the game)? In addition to that, how would I impose a limit? For example, if the number of objects on the screen hits 20, it's game over.
Challenge #2:
I have this other movieclip that will be acting as a "bonus". After every 40 seconds, one of this movieclip should appear on the screen. How would I do this?
Challenge #3:
I would like to have a timer - a timer which counts from a number to nothing. When it hits "0", I am taken to the "Game over" frame. How would I do this?
Again, thanks for reading this post. Have a great day!

You can use the setInterval function to manage making things happen every so often.  To duplicate the movieclip every 10 seconds, use setInetrval with duplicateMovieClip.  To stop whatever at some many, keep a count of how many there are as you add them.  Similar solution for the 40 second activity.
As far as counting down goes, you can use the getTimer function to establish a starting time, then continuously call it to see how much time has passed and subtract that from whatever coutndown time you want to allow for.
If you have questions about these functions, the Flash help doicumentation explains them all.

Similar Messages

  • Coding question for quiz game

    Hi,
    I want to create a quiz where the user can narrow down the list of possible questions by choosing from several menus.  Eg: User chooses "Cities", "Northern Hemisphere" and "Europe" which narrows the list of possible questions.  The code then needs to determine which questions are valid or invalid and then randomly ask the user only the valid questions.
    Firstly, in Actionscript, how can the program narrow the valid list.  Secondly, how can it randomly choose questions only from the remaining valid list?
    Should I be using Arrays?  An external database?
    Thanks, Andrew.

    OK, I'll give it my best shot.  I'm still re-familiarising myself with Actionscript syntax so I'll just use crude pseudocode (pigeon VB).  By the way, this program is not actually a quiz, it's a guitar fretboard training program.
    Let's say I start out with about 130 button symbols that represent each note on the fretboard.  Each one is linked to a different unique boolean variable eg: var_E1, var_F1, var_F#1 etc.
    The user can select from two menus; scale and fret position which are linked to two variables var_scale and var_fret which will change certain buttons to "true" and others to "false"
    allbuttons.active = false (this disables all buttons before the quiz starts)
         if scalemenu.selection = var_Gmajor then; (this selects the appropriate scale)
              if positionmenu.selection = var_3rdposition then;  (this selects the appropriate position)
                       var_G1 = true
                       var_A1 = true
                       var_B1 = true
                       var_C1 = true
                       var_D1 = true
                       var_E1 = true
                       var_F# = true
                       var_G2 = true
              end;
    end;
    (This is the part I'm not too sure how to do)
    command;
         determine all variables that are true; (is there a function that does this?)
             create list of all true variables; (in a temporary array?)
                   select a random item from this list and store it in var_question;
                        questiondisplaybox.text = var_question  (display the question)
                   if answer = correct then
                        answerdisplaybox.text = "correct"  (This tells the user if they're right or not)
                        var_score = var_score + 1;   (This adds to the users score tally)
                   end
    end;
    I hope that's not too crude.  Like I said, the part I don't know how to do is to determine all the variables that are true, create a temporary list of these variables, then display one of them randomly.
    Andrew.

  • HT5621 I am being prompted for the questions for my apple ID. I have put what I think are the answers and it is still not letting me purchase games from my account. I try to send the answers to my e-mail and I am not getting them.

    I am being prompted for the questions for my apple ID. I have put what I think are the answers and it is still not letting me purchase games from my account. I try to send the answers to my e-mail and I am not getting them.  I had account issues about a year ago where my id was spelled wrong. Could this be associated with that?
    <Email Edited by Host>

    Hi gymdad1959,
    This article has instructions for resetting security questions:
    Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/HT5312
    Cheers!
    - Ari

  • When you create your Game Center ID, it does a Security Question, for what reason? It never asks you it!

    When you create your Game Center ID, it does a security question, for what reason? It never asks you it!

    App store frequently asked questions
    http://support.apple.com/kb/HT2001
    http://support.apple.com/kb/HE37

  • Sounds "sticking" in games and a question for Creat

    I'm not sure if this is the best place to do it but I'd like to kind of formally briing forward a bug in games that's not X-Fi dependent. I've had this happen with my Audigy 2 ZS and my Fatalty.
    I know this isn't anyone's fault but it's still quite annoying. Sometimes if a player near you starts shooting (usually it's shooting) then the server or he/she lags for a second, his/her gun will be stuck on firing. Till they die or change weapons or fire again, you have that sound looping constantly. At first I thought this was only in BF2 and a bug in the game. However, after playing FEAR online more now, I've had this happen several times. Although it's rare, it is a pain. Sometimes if you ask the player to fire their gun again they will other times they won't.
    My question for Creative is, would it be possible to have a "reset" command for the soundcards? Have it flash the RAM real quick or restart the sounds somehow? Just make it a hot key that players could push when it happens?

    I am pretty sure I have the same case.  The product description on Amazon says VTSO, but the metal tab actually says IVSO.  All of the ones I see look like they are probably the same or very similar case with a different name.  I bought the QuickShot cover, and it is OK, but it does nothing to protect the corners, which I consider very vulnerable spots.  The IVSO/VTSO provides all around coverage.  I don't think we are going to find anything much better.  If I do I will come back and post.

  • I forgot my security questions for my apple ID i wanted to buy a game but i cant without knowing it. Can you help me please?

    I forgot my security questions for my apple ID i wanted to buy a game but i cant without knowing it. Can you help me please?

    Contact Apple Support
    https://getsupport.apple.com/GetproductgroupList.action

  • I'm trying to pay for a game, and I went to pay it's asked security questions and I don't remember what I answered and I went to resend code to reset the answer and the email starts with an a and I have no email that starts with an s

    I'm trying to pay for a game, and I went to pay it's asked security questions and I don't remember what I answered and I went to resend code to reset the answer and the email starts with an a and I have no email that starts with an s

    See Kappy’s great User Tips.
    See my User Tip for some help: Some Solutions for Resetting Forgotten Security Questions: Apple Support Communities
    https://discussions.apple.com/docs/DOC-4551
    Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/HT5312
    Send Apple an email request for help at: Apple - Support - iTunes Store - Contact Us http://www.apple.com/emea/support/itunes/contact.html
    Call Apple Support in your country: Customer Service: Contacting Apple for support and service http://support.apple.com/kb/HE57
    About Apple ID security questions
    http://support.apple.com/kb/HT5665
     Cheers, Tom 

  • Question for CL Forum Ad

    I have been reading through this forum and there seems to be no shortage of upset customers. They all seems to be asking the same questions over and over again, and the only answer given is, "I'll post more information when I get it".
    Now, I'm not a real tech savvy guy, but why is it not possible, to walk over to the desk of the head developer, and say, "Hey Steve, can you tell me why the new drivers are the same as the beta ones?"
    And then walk back to your PC and type the answer here. I mean lets be honest, unless you are sending messages via snail mail, I don't understand why this is so hard to do. I suspect you HAVE the answers, but the big cheese at CL has told you to simply deflect the questions for now.
    What I am trying to say is that by you saying you'll post information when you get it, does nothing but make your company look completely rag tag. It gives the impression that everyone just works part time from home, and they only meet every other Saturday for a softball game. There is no official statements from CL, you guys don't have any answers, no one knows when anything is being released or what it'll have in it...it just seems like the company is in shambles.
    And this brings me to my second question. While you're slow to respond to questions about why things aren't working and such, but you are quicker than a fat man chasing a rolling donut down the street when someone advertises another brand, so my question is what do YOU recommend we do?
    Can you suggest some solutions for all of the people who bought CL cards and have no working drivers? I would really appreciate if you didn't simply ignore, or skirt around this question.
    I think it's time you threw us a bone here, if you're not going to give us any information, then at least give us some other alternati'ves.

    Dude, honestly, I could care less what happened 0 years ago. I have said it before and I'll say it again for you, just because this type of thing keeps happening doesn't mean it's right.
    When I buy a product from a company I don't do it thinking, "Hey, maybe if I buy this product then the $200 will help them become the best company in the world, and I don't care if it works or not, I just like the feeling of supporting companies in the hopes they'll do well!"
    I buy products, and I expect them to work.
    Regardless, if you had actually read my post, you would see that I'm not asking when the drivers will be out, or why they aren't... I am asking why this "world leader" in sound cards can't communicate effecti'vely with it's customers? I am asking why the Admins keep saying the same old mumbo jumbo, and expect us to buy that they can't actually just go talk to the people in charge.
    I am also asking if they can't tell me that information, then help me find some alternati'ves.
    So, why don't you paypal me a few hundred dollars for a new sound card. You seem to have no problem sitting there giving your sound card "high fi'ves" and talking to it in a sweet voice, "Don't worry little sound card, I know you have amazing potential, I won't give up on you!"
    "Do you remember the old days of Windows 2000?" We then cut to a montage of you running through fields of flowers hugging your sound card and a copy of Windows 2000. You shake your fingers at them and say, "Not yet little guys, soon we'll all be together in harmony, we just have to wait!!"

  • Why I can't buy things for my games from visa credit card

    Why can't I buy thing for my  games from my visa credit card

    You can ... providing your visa credit card is backing your iTunes account.   I think what is behind your question is a wish NOT to have an iTunes store account.   In that case you could buy (with your Visa card, if you like) gift cards.

  • All email opens to an ad for casual games, cannot read email.

    When I use Firefox as my browser and try to view my AOL email, every one, including old and saved mail, opens to an ad for Casual Games and I am unable to read my mail. I can access it through IE, but not Firefox. I also see the same ad whenever I click on any other site, although it does vanish quickly and allows me to open a new window.

    Hi All,
    I want to thank you very much for all your detailed replies.
    No, I am absolutely not attempting to surveil or do any email forensics.
    I simply want to have a backup copy of all our emails in case the server goes down.
    Also, I may be abandoning the Mac OS X Server for email hosting and move to a professional hosted solution. I'd like to make sure I have all the emails on one or two encrypted external drives prior to migration or to send to the hosted email provider for migration.
    That said...
    Yes, we are using IMAP and thus all email folders are identified by the GUID number in:
    /Library/Server/Mail/Data/
    So the question is:
    1. How can I tell which mailbox corresponds to which GUID?
    2. How can I use the data from the /Library/Server/Mail/Data/ folder? Lets say I want to import the emails into a desktop email client. Can I get this data in .eml or MBOX off my server? (or am I missing the point entirely)?
    Thanks!

  • TS1717 Hi I brought a item on Monday night which I got a receipt for but have not received the goods for the game hayday, can you please help me to get them. Thank you wen

    Hi on Monday night I brought a sack of diamonds for a game hayday, the amount as come of my itune account but have not received the item. That night the game was freezing a lot. Wendy

    While we all have MacBooks in this forum most of us don’t have Lion. There's a Lion Support Community where everybody has Lion.You should also post this question there.  https://discussions.apple.com/community/mac_os/mac_os_x_v10.7_lion

  • Partitioning my hard Drive for PC Games

    This would be my first time asking a question to Apple Support Communities. I have a question regarding partitioning my hard drive for PC Games. I would have to use boot camp to install windows to be able to play those pc games... but before i buy windows 7 OS i want to know if this is going to work to play the games that i want. what to look for about system requirements ext.. so that i dont waste money. I have a macbook pro. OS X 10.8.5 Intel HD 4000 , Nividia Geforce 650 m. 2.7 processor intel core i7 , 16 GB of memory DDR3  when i look at system requirements with the games what am i looking for so that i dont waste my money i am knew to the mac os so any advice i can get. should i go this route of partitioning my hard drive?

    Kingstonpro wrote:
     ...before i buy windows 7 OS i want to know if this is going to work to play the games that i want. what to look for about system requirements ext.. so that i dont waste money
    when i look at system requirements with the games what am i looking for so that i dont waste my money
    Determine your Mac's ability for 3D games
    What my user tip will allow you to do is get the performance rating of your video graphics and then you can compare that rating with the one the developer provides as the minimal amount you need to run the game you want.
    Some developers do not easily list the performance requirements because they sell so many titles to people who don't know any better. Your obviously not that type of person.
    should i go this route of partitioning my hard drive?
    To get the full hardware performance of the hardware to run Windows 3D games, you need to install Windows into Apple provided BootCamp. and boot up the computer directly into Windows.
    However it's also possible to run some Windows games (2D and simple ones) in a virtual machine program in OS X, provide they use OpenGL drivers (not only DirectX)
    You install BootCamp first, then use a commecial virtual machine software like VMFusion or Parallels Desktop to copy the BootCamped Windows to use it as a virtual machine in OS X.
    You will then have two Windows on your Mac, one in BootCamp and the other in a file on OS X to run at the same time as your using OS X.
    There is the free VirtualBox too, but it doesn't have the ability to copy the BootCamp partition, but it's free and updated longer without begging for more money all the time like the commercial versions do.
    Windows in BootCamp or Virtual Machine?
    I would Like to get more information about the question should i partition my hard drive to be able to play pc games does this really work to be able to play those games
    Yes, you will get better performance direct booting the Mac into Windows to play most 3D games.
    This means you will have to find a copy of Windows 7 to purchase online, the 64bit retail disk of Win 7 Pro or better.
    is their any thing i need to know about the techinal aspects of installing windows on my mac computer... is there anything that i need to watch out for so that this would work. I just want to make sure that it will work.
    Basically BootCamp does all the work setting up the partition for Windows install, then it hands you off with a list of printed instructions to install Windows.
    Mac's cannot format NTFS drives, so when you boot off the Windows disk, you first have to change the format of the Bootcamp parittion to NTFS (from FAT32/MSDOS that Apple formats it as)
    When you finish with BootCamp, the machine reboots and your looking at a blining line on a black screen, reboot the computer holding the option key down, this enters Startup Manager and you can select OSX to  boot and get online for assistance.
    However if you read the BootCamp material, it should explain everything, also there are video's on YouTube as well how to go about things.
    There is Mac drivers that need to be installed into Windows, so that you can get online and other things in Windows.
    I advise having another computer or Internet device so you can come here to ask in the BootCamp forum for assistance with your install as your computer will be out of operation while installing Windows.
    If you don't think you can handle it, a local PC/Mac tech can do it for you.
    you know on games that you buy they have system requirements what if it ask for a diffrent kind of Graphics gard, like radon or another Geforce type. should i pay attention to those diffrences. What is the rule of thumb on the details techinaly...
    Determine your Mac's ability for 3D games

  • Will Java 3D be a good choice for this game. Screen Shots inside.

    My company is deciding what 3D engine to use for a game we are currently designing. It needs to look as good as a game called Mech Commander 2 Here are some screenshots:
    http://www.microsoft.com/brasil/games/mechcommander2/screenshots/06.jpg
    http://aok.heavengames.com/pics/fanstock/mechc2_5.jpg
    http://www.s2.com.br/s2arquivos/361/Imagens/318Image.JPG
    Will Java3D be enough for a turn based strategy game with graphics along these lines?? We have looked into the Chrome2 engine and several others but they are very expensive, so that is why we are interested in using Java3D since its free, and our expertise is Java.

    Java 3D would be able to replicate those scenes except for the shadows. You would need to find a way to do that yourself. Another part in your decision will be if Java 3D will be able to handle your polygon count and frame rate expectations. That is a tough question to answer without giving it a try. You will also need to consider how to integrate collision detection, collision response, sound, music, user interaction, camera control and a game menu system (all not part of Java 3D). There are Java solutions for many of those.
    The buildings, mechs, fence and trees look like they are done with a 3D modeler. Java 3D has several loaders available to to that.
    The smoke, flames, etc can done with a particle system like ours (www.indietechnologies.com) or you can build it yourself.
    The fog can be done in Java 3D.
    There are terrain implementations outside of Java 3D (www.j3d.org) that could provlde variable LOD and you can create the scorch marks, etc on the terrain with multitexturing (part of Java 3D).
    There are other options to consider like the JOGL, LWGL, jMonkeyEngine, Xith3D, Agency9 and few others. Some use a scene graph approach, others are more closer to the metal. Have a look at www.javagaming.org.
    Mike

  • Which 17" iMac C2D for a Gamer, particularly WoW

    Hi Folks:
    I am trying to decide which 17" iMac to get my son. His computer is really feeling its age and it's time to get replaced. I am looking at the 17" iMac and trying to decide between the 1.83 Ghz and the 2.0 Ghz. Here's the big issue -- he's really into WoW. Here's my big issue, about $200 difference between the two.
    Is there any real benefit in getting the the 2.0 Ghz for a guy really into gaming? Yes, it has more RAM and a different video card, along with a Superdrive. But does he need it for WoW because the other than that, it's basically just homework?
    I guess the "bottom line" question for me is--Is the 1.83Ghz with the Intel GMA 950 graphics sufficient for WoW and other games? Or do I really need to go with the 2.0 Ghz?
    Any imput or advice would be grately appreciated...
    Thanks in Advance,
    Anne
    MacBook Pro   Mac OS X (10.4.8)   iMac, iBook, iPod and all things Apple

    I looked again -- both the 17" 2.0Ghz and the 20" 2.16 Ghz iMac C2D's have the same ATI Radeon X1600 with 128MB of GDDR3 SDRAM graphics card. The 20" is upgradable to 256 SDRAM but it appears to be the same card. Yes?
    So, basically at the very least I need the 17" 2.0 Ghz with the ATI Radeon X1600 card?
    Thanks In Advance...
    Anne

  • PS4 DLC for a game on another profile?

    Ok I have two questions, my brother bought and downloaded a game on the PS4 called Helldivers, and we are able to play it with eachother now but I didnt buy the game on my account, can I download DLC for a game bought on a seperate account?
    Also If I get the DLC on one account can I share it on all my accounts? I heard that you cant..  Ijust really would love to be able to download stuff on my main profile and play it with my brother like we could on the PS3 without paying for all the DLC twice.

    So long as both accounts have the PS4 set as the primary PS4 your good to go Read this also, although it's not quite the same scenario. If your not 100% sure, why not just buy the DLC on your brothers account anyway

Maybe you are looking for

  • Problem with expanding a table

    Hi everyone, I'm new arround here, and with adobe livecycle. I'm working on something that requests a table to be expanded to the end of the line, and then when it reachs the end, it would change to the next line. i have created some tests and some j

  • Why won't my itunes  open on my windows vista after upgrading it

    why won't my itunes open up on my windows vista after upgrading it?

  • Color values shift from Illustrator to Photoshop

    Hi there: Hopefully someone has an answer for me (my apologies if this has been addressed before)? When  I open up a EPS file in Illustrator CS5, the blacks read !00% for RGB. When  exported as a JPG, Photoshop CS5 reads it as 0-0-0. So far so good.

  • Screen light in Lenovo a6000

    While listening to music, pressing volume up or down button switches on the screen. Its irritating and drains battery. That doesn't happen in any other android phones so why in this? Or happening in my phone only? If its a bug, please fix it.

  • IWeb site modified by other editors

    I am having great fortune using iWeb so far for several different sites. My question may be obvious to some, but I would like other input. If I build a site for someone and 'hand it over' to them - not my domain file, but the published folder - could