Re: on a flash game how do you create something to let you switch vehicle

I am creating a racing game and I want the ability to switch vehicles before the race.
The main issue here is that the game auto starts. All the coding is what i got
from the internet so i don't know how to stop it from auto starting, here is the game so far:
http://thebackyardchampion.deviantart.com/#/d48zgkl
Can someone pleeeease help.
I need a simple guide, i'm not a complete noob at it but neither am i a pro.

A bit of advice, You should not be making a racing game as its very clear that you are new to actionscript. In my eye's a racing game is by far the hardest type of game to make.
But to create a button, you draw it, convert it to symbol. Makie it a movieclip Look in the properties panel where it says instance name, give it a instance.
The where ever that button is in your file, place the code in the actions panel on the same location of the button.
You should not ever copy and paste code unless you understand it, you WILL get many errors if you keep doing this as you do not understand the process. If someone offers you code, you should manually type it in. If you type it inyourself, your brain is more focussed on the code, meaning you get used to it easier.
But as for your simple tutorial,
1. Draw your button.
2. Right click, then 'Convert to symbol'
3. Make it of the Movieclip type.
4. Go to your properties panel. Give it a instance name, in this case "btnins"
4. On that same scene, go to your actions panel, and TYPE in:
btnins.addEventListener(MouseEvent.CLICK,btnfn);
function btnfn(e:MouseEvent):void{
     mc.gotoAndStop(Math.floor(Math.random() * (1+10-1)) + 1);
And yes you would need the 10 keyframes within your Car movieclip. But you WILL get even more confused in a minuite as im sure this will not achieve your goal. If i understand, you are looking for a select car, before the game starts, correct ?

Similar Messages

  • On a flash game how do you create something to let you switch vehicle

    I know how i can create a button but how do i make it activate different vehicles before the race starts.

    A bit of advice, You should not be making a racing game as its very clear that you are new to actionscript. In my eye's a racing game is by far the hardest type of game to make.
    But to create a button, you draw it, convert it to symbol. Makie it a movieclip Look in the properties panel where it says instance name, give it a instance.
    The where ever that button is in your file, place the code in the actions panel on the same location of the button.
    You should not ever copy and paste code unless you understand it, you WILL get many errors if you keep doing this as you do not understand the process. If someone offers you code, you should manually type it in. If you type it inyourself, your brain is more focussed on the code, meaning you get used to it easier.
    But as for your simple tutorial,
    1. Draw your button.
    2. Right click, then 'Convert to symbol'
    3. Make it of the Movieclip type.
    4. Go to your properties panel. Give it a instance name, in this case "btnins"
    4. On that same scene, go to your actions panel, and TYPE in:
    btnins.addEventListener(MouseEvent.CLICK,btnfn);
    function btnfn(e:MouseEvent):void{
         mc.gotoAndStop(Math.floor(Math.random() * (1+10-1)) + 1);
    And yes you would need the 10 keyframes within your Car movieclip. But you WILL get even more confused in a minuite as im sure this will not achieve your goal. If i understand, you are looking for a select car, before the game starts, correct ?

  • After downloading Flash 9, how do you get it to work with Apple iMac OS X 10.3.9 ?...

    a.
    After downloading Flash 9, how do you get it to work with Apple iMac OS X 10.3.9 ?...
    b. , c.
    What's the best browser to try?... Firefox?... Opera?...
    Why?...
    d.
    What directory/ies contain the downloaded Flash 9 files?...

    a. Your browser and the flash player should work together. You should not have to do any thing
    b. Camino is the best for 10.3.9 Why? You can access apples me.com through Camino on 10.3.9 but Safari will not work with me.com. Also all the internet plug ins work with camino
    c. hard disk - library - internet plug ins

  • After downloading Flash 9, how do you get it to work with OS X 10.3.9 ?...

    a.
    After downloading Flash 9, how do you get it to work with OS X 10.3.9 ?...
    b. , c.
    What's the best browser to try?... Firefox?... Opera?...
    Why?...
    d.
    What directory/ies contain the downloaded Flash 9 files?...

    a. Your browser and the flash player should work together. You should not have to do any thing
    b. Camino is the best for 10.3.9 Why? You can access apples me.com through Camino on 10.3.9 but Safari will not work with me.com. Also all the internet plug ins work with camino
    c. hard disk - library - internet plug ins

  • HT1461 when in windows how do you switch to mac ?

    When in windows 7 how do you switch to the Mac side?

    apaldrian wrote:
    Allen, thank you for your help. Could you let me know what Win support file and where can I down load it. Peter Aldrian Captiva FL
    The Windows Support Software is available in Boot Camp Assistant (in OSX), download it, put it on a flash drive and reboot to Windows, install the Support Software.

  • How do you switch from one iTunes account to another on your apple tv?

    How do you switch from one iTunes account to another on your apple tv?

    Welcome to the Apple community.
    I assume you do mean a different account and not simply a different iTunes library. Unfortunately, in order to switch accounts, you would need to log out and log in to the second account.

  • How do you switch output sounds   set to my external monitor that is connected via HDMI.

    How do you switch output sounds   set to my external monitor that is connected via HDMI. 

    Hello gail from Ajijic,
    If you'd like to change the audio output of your Mac, you can do so by accessing the Sound preferences in your System Preferences.
    Before you start, open the Output pane of Sound preferences (choose Apple menu > System Preferences, click Sound, then click Output).
    Choose a sound output device
    From the list of sound output devices, select the one you want to use. All sound output devices available to your Mac are listed, including the computer’s internal speakers, devices plugged into your computer’s sound port (), USB speakers, and AirPlay devices.
    For any device plugged into the computer’s sound port, choose Headphones.
    OS X Yosemite: Adjust your computer’s sound output settings
    Thanks for using the Apple Support Communities!
    Cheers,
    Alex H.

  • HT4211 How do you switch from multitasking mode back to normal display mode?

    How do you switch from multitasking mode back to normal display mode?

    You mean switch from showing the recently used apps bar or dock back to regular home screen display mode?
    If so, select the Home button.

  • How do you switch off WiFi - is there an easy way?

    Hi I am coming from SPV MS Smartphones. My mate has got a new one with WiFi in, and it has a lovely shortcut menu to switch in ll WiFi, BT etc.
    How do you switch off the WiFi on the N80, I read in the manual that "WiFi is always on" surely this cannot be true, Nokia cannot be that daft as this would kill the battery!!
    Am I right in saying that the 4 little squares shows that WiFi is on?
    cheers
    My N80 is on Orange purchased in June 2006 firmware v 3.0617.06 03-05-2006
    Cheers
    Andy

    hi there...
    yes u can turn off wifi , menu-tools-settings-connection-wireless lan , from there u can choose whether u want ur wlan to be active or inactive , active gives u options of searching for available networks for ur set time , from every min to every 10 mins ,just choose never in show availability option , tht basically stops wlan to search for available networks automatically . incase if u want to search for available networks , u can do tht easily by going to menu-connectivity-connection manager -available wlan ..
    hope this answered ur question ,
    thnx..

  • How do you switch between 64-bit and 32-bit Java configuration?

    I've downloaded the latest Java plug-in for an online service, but when I go to run the service on Safari or Firefox browsers, I get a message that 32-bit Java is needed and my machine is running 64-bit.  How do you switch back and forth?

    Similar concern here. No 64 bit version. I purchased the Photoshop CS5 downloadable upgrade. I  have installed the program but only see the 32 bit version. Image  / Mode shows 8, 16 and 32 bit versions and no 64 bit.
    Start Programs offers only a single version of Photoshop which based on the splash screen is 32 bits. Did I miss something during the install?
    Bob

  • How do you switch to a vertical template in Keynote?

    How do you switch to a vertical template in Keynote?

    i tried that unsuccessfully.  when I added the 2nd email address i got a popup that says "Unable to verify email because it is already in use."  Thats the one I would like to switch to.  So.... i would like to delete the current apple ID and replace it with the Apple ID that is "already in use".

  • How do you switch to a different apple id in iMessage?

    How do you switch to a different Apple ID in iMessage?

    i tried that unsuccessfully.  when I added the 2nd email address i got a popup that says "Unable to verify email because it is already in use."  Thats the one I would like to switch to.  So.... i would like to delete the current apple ID and replace it with the Apple ID that is "already in use".

  • How do you switch to a vertical view?

    how do you switch to a vertical view in Adobe Digital Editions 3.0

    i tried that unsuccessfully.  when I added the 2nd email address i got a popup that says "Unable to verify email because it is already in use."  Thats the one I would like to switch to.  So.... i would like to delete the current apple ID and replace it with the Apple ID that is "already in use".

  • How do you switch language for iMovie?

    After installing new version of iMovie, I noticed I chose my home country instead of USA, so that the language is not English but I want subtitles in my movies such as trailers to be English. How do you switch the language? Is there any way that I can install it again without any cost?

    the iApps come multi-lingual and should use the language your System is set to ...
    but there's a free tool, Language Switcher, which allows to set the interface language of any app to any avail language - in use here, to create English Interface screenshots on my German MacOS

  • HT2477 Just bought a Mac book and the set up is with the Voice over key commands,how do you switch this off as it is painfull to use and use the scroll pad

    Just bought a Mac book and the set up is with the Voice over key commands,how do you switch this off as it is painfull to use and use the scroll pad?

    It's the button (key) that is labelled Control.
    Each of the modifier keys and similar keys has its own symbol; this makes listing command keys easier to do. The Command key is usually the only key which has its symbol printed on the key. If you open Keyboard Viewer (in the Input menu, the one which displays the flag in the main menu bar), you can see what symbol refers to which key.

Maybe you are looking for

  • What is Time Machine on my Imac cleaning up?

    Did a full back on 1 TB Imac Hard drive.  Now Time Machine is "cleaning up"? what is it cleaning - old backups?  If so, what happens if I cancell it prematurely? Thank you.

  • Streaming live video to my website

    Hey all, I have Flash media server, flash media live encoder, and flash cs5. I'm gonna be using flash media live encoder to stream my desktop and webcam to my website. My current host (host gator) doesn't have rtmp enabled on their web hosting plan,

  • How do we write the sub routines in smart forms?

    1) How do we write the sub routines in smart forms? 2) What is the’ form interface’ in smart forms? 3) Write down the path for writing for select queries in smart forms? 4) How do we put dynamic page break in smart forms? 5) in which system field con

  • G5 Dual 1.8 with Internal Apple 80Gig issues -:(

    Hi, I've experienced intermittent issues with this internal 80Gig Apple drive almost since day one. It's a G5 1.8 Dual. I've had it for about 5 months and obviously have walk in coverage still. My issues started about 2 months ago. The drive would ta

  • Objects using dblinks become invalid

    I am using numerous functions / procedures / synonyms which point to other databases via dblinks. All was well when the dbLinks / synonyms were public. Last week I was asked to put up a test schema on the same database so I duly made all the public d