Creating crosshairs for a game

i am a student and very new to flash, i am creating a shooter game for my class
i made a set of crosshairs and i set my enemies to disappear when i click on them and everything works fine but i noticed that my crosshairs don't line up to where i am clicking, so i go into my crosshairs which are a movie clip and move the crosshairs so the little + sign is lined up in the middle of the crosshairs, now when i play the game nothing happens when i click on the enemies unless i put the crosshairs layer below the enemies layer
i hope i worded all of that correctly and if not i apologize for my ignorance, any help would be greatly appreciated
Adam

You probably need to set the crosshairs mouseEnabled property to false...
crosshairs.mouseEnabled = false;

Similar Messages

  • Creating HighScores for my game..

    Well, Im kinda new at java and have been working on a game... it is mulitplayer but i need help on making highscores... I know you can use CGI scirpt or something similiar? can anyone help me thanks.. here is where i wanna added it in the middle of this part of code...
    else     if (talkhandle == 192 && dd == 192159 && Questdone == 1)
              sendMsg("@yel@Thank You For Saving me "+playerName+"! ");
    Message was edited by:
    Null

    1. Yes I am trying to do it serverside
    2. Yes its in java
    3. I am stuck mostly because i dont know much about
    it... Ive looked at some code dealing with serlvets
    and I dont know if thats what i need..How much Java do you know?
    I don't think you're ready for servlets yet.
    4. Also how do I extends HttpServlet If Ive already
    extends Player at the start of my client.You can't. You can only extend one class. Java does not support multiple inheritance.
    5. I Want this to be viewed (the scores) from a
    webpage...Yes i know.
    Would this work? notice I added
    HttpServlet
    public class client extends Player &&
    HttpServlet  implements Runnable
    No that's not going to work.
    >
    Please Help Ill give you points or whatever tooPoints aren't needed it's okay.
    Can I make a suggestion here? Is your game actually done? I would work on that first. Servlets are a whole new ball of wax for you to learn. Not that you can't but it seems a little ambitious for you at the moment.

  • How create timer for game?

    I want to know how much time player spend in the game.
    For this i want create a timer.
    I thing it must be something like this:
    player come to the game (time 0:00), player plaing for example 22 minutes, gameover game (player spend 22 minutes and 0 sec).
    code:
    import flash.utils.getTimer;
    var gameStartTime:uint;
    var gameTime:uint;
    var gameTimeField:TextField;
    function mainFunction():void
         gameTimeField = new TextField();
         addChild(gameTimeField);
         gameStartTime=getTimer();
         gameTime=0;
         addEventListener(Event.ENTER_FRAME,showTime);
    function showTime(event:Event)
         gameTime=getTimer()-gameStartTime;
         gameTimeField.text="You plaing: "+clockTime(gameTime)+"min";
    function clockTime(ms:int)
         var seconds:int=Math.floor(ms/1000);
         var minutes:int=Math.floor(seconds/60);
         seconds-=minutes*60;
         var timeString:String=minutes+":"+String(seconds+100).substr(1,2);
         return timeString;
    mainFunction();
    Is this correct way?
    If you know how to make code smaller can you please share?
    Maybe exist standart component or something else for this?
    Thank you.

    Thank you guys!
    Just asking how to make timer correct:)
    I thout maybe you know existing standart coder or standart component for it?
    For example i use the same timer for 5 games.. and for every game i need create code..  Is it possible to make code just one time and create something like standart components in Flash IDE ? Or maybe adobe have place where everyone can create components and share whit other? Or its all not possible, and need create the same code again?
    By the way why i dont see my secons here?:
    var gameStartTime:uint;
    var gameTime:uint;
    function mainFunction():void
         gameStartTime=getTimer();
         gameTime=0;
         addEventListener(Event.ENTER_FRAME,showTime);
    function showTime(event:Event)
         gameTime=getTimer()-gameStartTime;
         myText.text="Time: "+clockTime(gameTime);
    function clockTime(ms:int)
         var seconds:int=Math.floor(ms/1000);
         var timeString:String=String(seconds+100).substr(1,2);
    mainFunction();

  • How do I create a "command-line-interface" for a game?

    Hey people,
    For a game I need to make a DOS-like command-line-interface where the user has at least 3 options to answer with, does anyone know how to go about this?
    Hope someone here can help me out!
    Kind regards,
    Angela

    I'm not sure what part of this you are having difficulty with. Imagine for a moment that instead of asking for your end user to type something into a text-entry field and to monitor what they type (perhaps when the ENTER key is pressed), that instead you provide 3 buttons on your stage. Responding to a button press in this scenario is much the same as responding to typed user input - your movie does something based on user interaction. Going back to the user entered text scenario, a text or field sprite can detect the ENTER key being pressed and examine the string the user has entered, something like:
    on keyDown me
      if _key.keyCode = 36 then
        stopEvent
        sText = sprite(me.spriteNum).member.text
        case sText of
          "hack": -- do whatever you need to here
          "research":
          "wait":
          otherwise:
        end case
      else
        pass
      end if
    end

  • Where can I find a good tutorial for mobile game developement with J2ME ?

    Hi All,
    I'm completely new to J2ME programming. But I have past experience on J2SE developement. Now I would like to know that where can I find a good tutorial for mobile game developement with J2ME ?
    I'll be very greatful if I can find a useful step-by-step tutorial (eg. "The Java Tutorial" for J2SE)
    Please point me ot the direction.
    Thanks
    ZuriJAckshoT

    ibook-widgets.com    have a free tutorial book in the iBooks store.  Search for "Create your first interactive book using iBooks Author"   they also  sell widgets.
    I  dont have any connection - I  found their eBook in the store long ago  and used it to learn more about iBA.
    The best advice though, is be patient,  go back over the process step by step, I cannot  access the Help files for some reason.. but i am sure its in their.

  • Using disk images for learning games?

    Hello, I've 2 g3 imacs running 9.2.2, and they are for the grandkids to use learning games on.
    The kids are very hard on the software disks. When I found out about disk images I made them up, now to install them properly. The games are installed, but where to store the disk images? The desk top icons for the games will work after the disk images have been double clicked and the mounted disk image appears on the desktop, but when the imacs are turned off the mounted disk image is lost. How or where does one put the disk images in a safe place so the kids don't get at them, and the disks are mounted every time, without actually starting, when the Mac is started? Start up menu?
    I'm planning on multiple accounts with them having a standard account with game privileges so they don't mess the whole thing up. If their accounts get too messed up for me to repair I figured on maybe deleting the account and opening up a new one? Any Ideas are very welcome.
    Thank you,
    EZ

    Hi, EZ -
    You're quite welcome.
    I had a thought with regard to the disk image files. Are they in a .smi format, or are they in a .img format?
    The .img format requires the assistance of the Disk Copy utility in order to mount the image. This is the standard format generated by the user version of Disk Copy. It requires that Disk Copy be available to Finder to act as a helper app in order to mount the image.
    The .smi format does not - .smi stands for Self-Mounting Image. The user version of Disk Copy can not make this format; but I have seen a utility to convert .img format to .smi format. The slight advantage with this format is that Disk Copy does not need to be available to Finder.
    In both cases the default is to run a checksum verification before the image is finally mounted. The delay caused by this verification can be inconvenient - verification is intended to confirm the integrity of the image after it has been copied, transported, or downloaded, but is usually not necessary when the image resides on a hard drive.
    The checksum verification for .img file types can be removed. With the image not mounted, open Disk Copy. In Disk Copy's Preferences (Edit menu), uncheck the Verify Checksum item. Save the Preferences window. Then select Convert Image from the Image menu, navigate to the disk imge file from which you want to remove the verifiaction, select it and click the Open button. A new window will appear, similar to a Save As type window. Leave everything in that window untouched (unless you want to change the base name of the file - the extension .img should be left intact) and click the Save button. The image will be mounted, the original disk image file will be deleted, and a new disk image file created. Unfortunately creating the new image file takes quite a while since it is creating a new one, not actually modifying the old one - but it does get rid of the intrusion of the checksum verification requirement.
    I verified on my G4/500 running OS 9.1 that a .img file (one I had made from a game CD years ago) dropped into the Startup Items folder will be mounted automatically at the end of the startup sequence. I also tested with an alias to the .img file, and it, too, worked fine - the disk image was mounted automatically at the conclusion of the startup sequence.
    When you make the alias to the disk image file (the .img one), be sure you are placing it into the Startup Items folder, and not the Startup Items (disabled) folder.
    If you have the machine set to use Simple Finder (which removes Finder's keyboard commands and many menu options for Finder), that may interfere with items in the Startup Items folder being run at startup. Or, it may not - I have not checked that.
    *** Edit ***
    I have verified that the alias to a .img file will mount the disk image even when the machine is booted using Simple Finder.
    Another thought, related to Multiple Users - if you do decide to set up Multiple Users, and the disk images are of type .img, be sure to authorize Disk Copy for each of the accounts for which the disk images are to be mounted. If you have the disk image files in a .smi format, since Finder views that file type as being an application, you would need to authorize each of those disk image files for each account which is to have access to them.

  • How do you create a flash in game popup on the same frame?

    How do you create a flash in game popup on the same frame?
    I need to make a popup in flash on the same frame. Basiclly like you reach the frame and randomly (I know how to do random stuff) a popup might appear saying like you got a prize; and I want the stuff in the back to stay the same.
    Please help me!
    Thankx in advance.

    Whatever frame you intend to make this movieclip appear in, you first set it to be invisible using...
    popupName._visible = false; // popupName is whatever instance name you use
    And for whatever random code you use to trigger it to appear you just set the _visible property to be true...
    popupName._visible = true;

  • Open GL Vs Quartz - Which is better for 2D game development?

    Hi,
    I am new to iphone game development. I want to create 2D game. Simple game with objects moving around.
    I never used Open GL as well as Quartz. For this game I am planing to study that.
    I want to know which is better from OpenGL or Quartz?
    And where I can learn more on that?
    Thanks,
    Ganesh Pisal

    I would recommend against OpenGL for a 2D game. Quartz does a lot of work to avoid updating parts of the screen that haven't changed, something OpenGL doesn't do. The iPhone's implementation of OpenGL has other serious performance issues.

  • We are looking for Flash-Games for our A-level exam

    Hello
    Our Project-Team creates a Game-Hompage for our A-level exam.
    We are looking for Flash-Games and Games in other Languages
    (for example: Java or VBnet), wich we will publish on our Webpage.
    The quality, category etc. doesn't matter.
    Furthermore we would be pleased if you could send us
    suggestions and ideas (for example: Projectname etc.)
    Just send us a mail:
    [email protected]
    greetz
    project-team

    http://www.gotoandplay.it

  • I have 3 i-4 phones and one app account. I paid for one game, how do I download it to the other two phone without paying again.

    I have 3 i-4 phone and one app account. I have paid for one game, how do I download this game to my other 2 i-4 phone whitout paying again?

    There is no device limit for the number of iPods, iPads, and iPhones that can be synced with the same iTunes library and iTunes account on the same computer. Each device can have its own sync preferences with iTunes along with iTunes creating and maintaining a backup for each device, which is updated by iTunes automatically as the first step during the iTunes sync process.
    Since all iTunes content on each iPhone - all music, movies, tv shows, audio and print books, and 3rd party apps should be in your iTunes library on your computer, connect the other two iPhones to iTunes and under the Apps tab for the iPhone sync preferences with iTunes, select the game to be installed on the iPhone followed by a sync. Repeat for the other iPhone.

  • Unable to create folders for apps on springboard

    I was successful at creating folders for one of my sons on his Ipod Touch, but my other son's Ipod won't allow me to do it. Is there a setting that needs to be turned on or off or what? With my sucessful situation, I simply held my finger on one of the apps on the springboard until they all got wiggly, and, therefore, moveable. I drag one app on top of another and was able to create a folder for the 2 (i.e., zombie games). I did the same thing on my other son's Ipod and the apps would not go on top of each other, would simply replace each other in the order they were on the springboard. I hope someone can help...

    Do both iPods have iOS 4 installed?

  • Score board for a game show

    Hi all, Ok here goes.
    I need to create a score board for a game show at work for staff.  The score board must keep score on the left and right parts of the screen. score must start as default on 0.  Then every time I press for example the left arrow key the left score must increase by the value of 1 and when I press the right arrow key the left score must decrease by 1.
    Same goes for the right score only with differant keys example up and down keys.  This sounds very simple and I managed to get it to work when I tested with only 1 score, but failed when adding the second score to the picture.
    Please help me out on this as I don't know how to program in flash and I'm not getting any replies from other forums.

    That is AS2 code so you should repost your problem in the AS1/2 forum if you continue to have a problem.  You should try making the other score work again and show the code you are using that is not working.
    Since you have little familiarity with coding, you will do best to not approach coding the way you are.  Putting code "on()" objects is not a good practice.  You should place all the code in the timeline and assign instance names to objects to enable the timeline code to target the objects.
    If you have a button in place merely to support having the code for keyboard interaction processing, then you should do away with that and just have code assigned to deal with the keyboard specifically.  Here's some code that might get you started... if you cannot get it working for you, then please repost your problem in the correct forum.  The code goes in the timeline. Instead of the traces, you would be changing the score values...
    var keyListener:Object = new Object();
    Key.addListener(keyListener);
    keyListener.onKeyDown = function(){
       if(Key.getCode() == 38) trace("up");
       if(Key.getCode() == 40) trace("down");
       if(Key.getCode() == 37) trace("left");
       if(Key.getCode() == 39) trace("right");

  • Why do i need payment informations for free games

    why do I need payment information for free games?

    You can create an iTunes account without payment info on file.
    Once you have a card on file, though, iTunes wants it to be current/valid. Don't think there's any way around it.

  • Help with Jsp: logic:iterate  Cannot create iterator for this collection

    Hello,
    I am developing a jsp with struts. This is the snap of the code:
            <logic:iterate id="prod" collection="productList" >
              <tr align="center">
                   <td><html:text property="prodDesc" size="50" indexed="true"/></td>
                   <td>
                        <html:select property="prodUnit" indexed="true">
                             <option selected>-</option>
                            <OPTION VALUE='NMB'>NMB
                             <OPTION VALUE='TEN'>TEN
                             <OPTION VALUE='TPR'>TPR
                             <OPTION VALUE='GWH'>GWH
                        </html:select>
                   </td>
                   <td><html:text property="prodQty" size="20" indexed="true"/></td>
                   <td><html:text property="prodVal" size="20" indexed="true"/></td>               
              </tr>
            </logic:iterate>"productList" is defined as an array of Product[], "prod" is defined as a single Product object in the form. But when i run the page, it gives me this errors:
    "javax.servlet.jsp.JspException: Cannot create iterator for this collection".
    I also tried to make "productList" an ArrayList type, but it game me this same error.
    We are using Websphere 4.0 with Struts 1.1.
    Anyone can help?
    Thanks a lot.
    All the best,
    warren

    Hi , I have similar problem. wonder anyone can help me. I have a datastructure. ArrayList contains list of Hashtable; each Hashtable has two key-value sets ; for each key-value set , value is a ValueObject.
    My jsp works ok. but when I click on the radio butten for one radio group, it sets not only the porperty on that row, but the rows belows ,which suppose to be another radio group , because I am using indexed="true". each row should be a individual group seperated by the name poDisplayVO[i] , as show in the html generated .
    <!-- JSP -->
    <logic:iterate id="poDisplayVO"
    name="testForm"
    property="poDisplayVOList"
    type="java.util.Hashtable">
    <tr>
    <td>
    <bean:write name="poDisplayVO" property="name"/>
    </td>
    <td>          
    <% String val = ((java.util.Hashtable)poDisplayVO).get("subjAreaName").toString();%>
    <html:radio indexed="true" name="poDisplayVO" property="fosVO.select" value="<%=val %>" />
    <bean:write name="poDisplayVO" property="subjAreaName"/>
    </td>
    <td>           
    <html:radio indexed="true" name="poDisplayVO" property="fosVO.select" value="no" /> NO
    </td>
    <td>           
    <html:radio indexed="true" name="poDisplayVO" property="fosVO.select" value="yes" /> YES
    </td>
    </tr>
    </logic:iterate>
    <! ------------------------ html genterated ------------------------------------------------>
    the HTML generated as folllows:
    <tr>
    <td>
              Accounting Studies
    </td>
    <td>          
         <input type="radio" name="poDisplayVO[0].fosVO.select" value="Accounting">
              Accounting
    </td>
    <td>           
         <input type="radio" name="poDisplayVO[0].fosVO.select" value="no"> NO
    </td>
    <td>           
         <input type="radio" name="poDisplayVO[0].fosVO.select" value="yes"> YES
    </td>
    </tr>
    <tr>
    <td>
              Accounting Studies
    </td>
    <td>          
         <input type="radio" name="poDisplayVO[1].fosVO.select" value="Bookkeeping">
              Bookkeeping
    </td>
    <td>           
         <input type="radio" name="poDisplayVO[1].fosVO.select" value="no"> NO
    </td>
    <td>           
         <input type="radio" name="poDisplayVO[1].fosVO.select" value="yes"> YES
    </td>
    </tr>
    <tr>
    <td>
              Accounting Studies
    </td>
    <td>          
         <input type="radio" name="poDisplayVO[2].fosVO.select" value="Computerized Accounting(Duplicate)">
              Computerized Accounting(Duplicate)
    </td>
    <td>           
    <input type="radio" name="poDisplayVO[2].fosVO.select" value="no"> NO
    </td>
    <td>           
    <input type="radio" name="poDisplayVO[2].fosVO.select" value="yes"> YES
    </td>
    </tr>
    <! ------------------------ action form-----------------------------------------------
    public ArrayList getPoDisplayVOList() {
         return poDisplayVOList;
    public void setPoDisplayVOList(ArrayList list) {
         poDisplayVOList = list;
    public Hashtable getPoDisplayVO(int i) {
         Object obj = poDisplayVOList.get(i);
         if (obj == null)
              obj = new Hashtable();
              poDisplayVOList.add(obj);
         return (Hashtable)poDisplayVOList.get(i);
    public void setPoDisplayVO(Hashtable programDisplayVO, int i) {
              poDisplayVOList.add(i, programDisplayVO);
         }

  • 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

Maybe you are looking for

  • Keyboard keys not working correctly [SOLVED]

    Relevant section from xorg.conf: Section "InputDevice" Identifier "Keyboard0" Driver "keyboard" Option "CoreKeyboard" Option "XkbRules" "xorg" Option "XkbModel" "pc105" Option "XkbLayout" "uk" # Option "XkbVariant" "" When I comment out XkbLayout all

  • Complete a GP after closing a pop up window

    Hi all, I have written a wd4j application to be a callable object.  When a user clicks to approve the request, a pop-up window appears and ask if they are sure.  Upon clicking yes, the window should be closed and the GP should be completed.  I am hav

  • Issue in production

    1)WHEN EVER I DELETE A RECORD FROM MUL_TEST TABLE IT SHOULD RAISE A TRIGGER AND CALL A PROCEDURE THAT IS GIVEN BY ME . 2 )FOR THAT DELETED RECORD IN THAT PROCEDURE FIRST IT SHOULD HAVE TO CHECK FOR ACCOUNTNO IN MUL_TEST TABLE WITH ACCOUNTNO IN REG TA

  • Control IDs

    This falls into the "there has to be a way to do this": I've got a page constructed by nesting dataTables - something along the line of this minimal example: <h:dataTable value="#{Bean.reportProxies}" var="proxy"> ..<h:dataTable value="#{proxy.fragme

  • Calling doGet() from in the doPost() method.

    What is the conditions we have to cheak to call doGet() method from doPost().