HitTests Dont Work HELP????

Ive got this script. when u press a button u can create a movie clip called man. when u press another button u can create one called enemy. thay both create at different sides of the seane and thay walk past each other.
but when thay touch each other thay should go to frames inside them. ect Attack,Die. but thay dont help....
var mans = 0;
function addman() {
    if (Gold>=10) {
       var man= attachMovie("man", "man"+mans, _level0.getNextHighestDepth(), {_x:95.1, _y:479});
           man.onEnterFrame = moveman;
        mans += 1;
      Gold -= 10;
btnMan.onRelease = addman; function moveman() {
     if (this.hitTest(enemy)) { 
       this.gotoAndStop(2);//mans fighting frame
if(enemy.hitTest(MDS));
enemy.gotoAndStop(2);// enemys died frame
     } else {
this.gotoAndStop(1);  //mans walking frame     
this._x += 1.3;
var enemys = 0;
function addenemy() {
    if (Gold>=10) {
      var enemy= attachMovie("enemy", "enemy"+enemys, _level0.getNextHighestDepth(), {_x:595.1, _y:479});
            enemy.onEnterFrame = moveenemy;
        enemys += 1;
      Gold -= 10;
btnEnemy.onRelease = addenemy;
function moveenemy() {
     if (this.hitTest(man)) { 
       this.gotoAndStop(3);//enemys fighting frame
if(man.hitTest(EMDS));// a little square called EMDS inside fighting on the frame where he punches
man.gotoAndStop(3);//mans died frame
     } else {
this.gotoAndStop(1);  //enemys walking frame
       this._x -= 1.3; 
help

You are still missing things that I told you you needed to include yesterday, mainly the for loop.  The code below should take care of the hittests, I have added the loops.  The only issues I see are...
1. You shouldn't need to do hit tests on both the enemy vs man and man vs enemy.
2. It is not clear what your intentions are for the MDS and EMDS lines, so I didn't touch them... they are incomplete due to the ";"
var men:Array = new Array();
var enemies:Array = new Array();
var mans = 0;
var enemys = 0;
function addman() {
    if (Gold>=10) {
       men.push(attachMovie("man", "man"+mans, _level0.getNextHighestDepth(), {_x:95.1, _y:479}));
       men[mans].onEnterFrame = moveman;
       mans += 1;
       Gold -= 10;
btnMan.onRelease = addman;
function moveman() {
for(i=0; i<enemys; i++){
       if (this.hitTest(enemies[i])) { 
          this.gotoAndStop(2);//mans fighting frame
    if(enemies[i].hitTest(MDS));
    enemies[i].gotoAndStop(2);// enemys died frame
       } else {
     this.gotoAndStop(1);  //mans walking frame     
           this._x += 1.3;
function addenemy() {
    if (Gold>=10) {
       enemies.push(attachMovie("enemy", "enemy"+enemys, _level0.getNextHighestDepth(), {_x:595.1, _y:479}));
       enemies[enemys].onEnterFrame = moveenemy;
       enemys += 1;
       Gold -= 10;
btnEnemy.onRelease = addenemy;
function moveenemy() {
    for(i=0; i<mans; i++){
  if (this.hitTest(men[i])) { 
            this.gotoAndStop(3);//enemys fighting frame
            if(man.hitTest(EMDS));// a little square called EMDS inside fighting on the frame where he punches
            man.gotoAndStop(3);//mans died frame
        } else {
            this.gotoAndStop(1);  //enemys walking frame
            this._x -= 1.3; 
You should learn about using the trace command to help you troubleshoot your code.  If you had traced "man" in your moveenemy function you would have found that it is undefined, mainly due to it being declared within the scope of a function where nothing outside the function can see it.  The same applies for the "enemy" inside the moveman function.

Similar Messages

  • The update dont work help

    The iOS 7 dont work HELP ME

    What exactly happened? It is not unusual to get  error messages of there was problem downloading the update because the severs are very busy.

  • Installed Vista 64 however boot camp drivers dont work - Help

    I have a Macbook Aluminum with 4 gb ram.
    I just installed vista 64 bit however - i can get Boot camp drivers to run.
    Please help someone.

    Mac OS X 10.5.4 DVD BootCamp included drivers
    http://support.apple.com/kb/HT1999
    Limited list of Macs that officially support 64-bit Vista
    http://support.apple.com/kb/HT1846
    What does happen when you insert your Leopard/OEM 10.5.x DVD?

  • NEO 2 Problem SATA 3+4 dont work :( help!!

    as post title, some reason I cant run my HDD off of SATA 3 or 4 even with stock speeds on everything,
    I want to over clock the board so not being able to use these will be a real pain, any ideas!??
    Am using 1.5 bios with latest chipset drivers
    HDD is a 120gig Maxtor DM9 8meg cache

    The clue here i believe is that the sata1/2 on marvell PHY bridged to nv chipset works with driver version 0415
    while the sata3/4 with nv-chipset integrated PHY needs 0446 or newer if nvraid.rom is 4.60 or newer .
    So update through
    control panel - system - hardware - device manager
    Nvidia serial ATA controllers (2.5)  from 5.10.2600.0415 -> 5.10.2600.0446 (2.6) (nvatabus.sys , nvatabus.inf)
    and
    Scsi and Raid controller from 5.10.2600.0415 -> 5.10.2600.0446 (nvraid.sys , nvraid.inf)
    Reason:
    Xp installed on raid with diskette nvsa020 (driver versions 0415 )
    Ran chipset install package from nvidia UDP 5.10 .
    As nvatabus and nvraid is already installed it doesn't install or update from 5.10 UDP package ( i have verified this )
    And afterwards the versions on nvatabus(sata controllers)  and nvraid is still 0415 .
    So update theese controllers drivers manually through devicemanager , don't reboot before all of them is changed .
    Then move the raid to sata 3/4 ( sata1 disk -> sata3 , sata2 disk -> sata4 ).

  • T61 Notebook Hardware Control dont work help

    hello, I bought a license  Notebook Hardware Control Lenovo  t61 goes can someone help me and I look ACPI control system not yet Configured

    @GMAC-R60:
    Because the Hotkey driver is installed, bluetooth cannot be activated by pressing Fn-F5 until the BT-driver has been installed.
    Otherwise:
    Bluetooth can be enabled before the Hotkey-driver is installed.
    I've tested it on several T61/X61 and older.
    My home-forum: http://www.thinkpad-forum.de
    Wiki: Deutsches ThinkPad-Wiki English ThinkWiki
    My ThinkPad-Collection

  • My new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help

    my new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help
    my iphone4 is 10 times faster
    i have backed up on itunes and restored but still no luck
    even siri is lagging

    my new iphone is running extremley slow, internet takes ages to load, apps take ages to install and has trouble connecting to app store. and the apps dont work properly like ebay wont open or refresh items, plz help
    my iphone4 is 10 times faster
    i have backed up on itunes and restored but still no luck
    even siri is lagging

  • Whenever i try to open my after effect it just says error 15 n dont work plzz help me out

    whenever i try to open my after effect it just says error 15 n dont work plzz help me out

    We cannot know. you are not telling us anything about your system, what kind of project, what footage etc. We don't even know what version of AE!!! In any case, run the Creative Suite Cleaner Tool, reinstall the program. If the issues persist, we realyl need a lot more info to help you.
    Mylenium

  • My burned CD's dont work in my car CD player!! help plz!!

    i have a 99 honda civic with a standard one disc player, honda brand, and wen i put burned audio CD's in they dont work. any suggestions?
    12 inch iBook   Mac OS X (10.4)  

    1st thing to do is double check that iTunes is burning audio and not data CDs. Check in preferences. Secondly try changing your brand of CD. I used to have problems burning onto memorex cds. They just didn't work. Then I've experienced other brands that play in some of my players but not others. Lastly, go to iTunes preferences and tell it to burn on it's slowest setting for better reliability. nb some players will only play audio cds that are CDR, not CDRW.
    Hope this helps.

  • Help !!!!!!!!!! I upgrade my itunes to 10.5, But, my cpu start to reach 100%, and I cant connect to Itunes store! Morever , I did try something that ppl saying delete all program and reinstall again! It dont work to me!

    Help !!!!!!!!!! I upgrade my itunes to 10.5, But, my cpu start to reach 100%, and I cant connect to Itunes store! Morever , I did try something that ppl saying delete all program and reinstall again! It dont work to me! It drive me CRAZY!!!! HELP PLEASE HELP!!!!

    It took about an hour to upgrade my iphone. You're also left a couple of times with a blank screen on the iphone whilst it does things in the background which is a bit confusing. Suggest you wait - it starts doing things again (like reload your apps and then your photos etc) after you think it's finished. It's finished only when it says it is.....

  • Hi, i have lost my code to download apps, my e-mail dont work anymore. how can i reset my password so i can download from appstoe.....pleace help me

    hi, i have lost my code to download apps, my e-mail dont work anymore. how can i reset my password so i can download from appstoe.....pleace help me

    If you have a backup for your iPhone with iTunes on your computer, you can get the iPhone's serial number and IMEI number from the iPhone's backup on your computer.
    http://support.apple.com/kb/ht4061

  • HELP!!! I am getting really fed up with things that dont work.

    I am asking why a year ago i wasted money on Prem elements 8 only to have it not do the same as prem 2 did not do.
    Neither will see my cameras a canon 650i & sony hc320i which were visible on Win 98 with prem elements 2, i now have win7 loaded Pe2 on both my new laptop & my 2 year old HP desktop the HP crashes if i try to go to DVD burn the Toshiba Laptop just does not see camera or DVD burners.
    PE 8 i thought would be a solution after all its up to date but i hate it as a package oh and guess what it wont see camera or burner so great i wasted my £100+ on something thats horrid to use & wont work. Bring back PE 2 but how do i make it work on both PC,s.
    Pe2 has always been a problem but worked with a lot of messing but now i can only download onto it from DVD then edit slowly ie 15 minutes for every tag on the timeline but having done this it will not see a burner.
    Im not a techy but was told to re load Roxy or Nero missing out bits, i cant see either on my pc,s anyway & dont have the programs to load. the burner works with other programs so my guess is that Adobe just dont add the bits that do the job.
    Well as you can guess i am fed up haveing spent money on something that does not do what it said on th box it just rubbish to expect a mere mortal to play around with a pc.
    Question then is this simple, How do i get this to work properly without getting techy & download to DVD in PAL format and talk to the camera without it crashing my PC.

    Hi in reply to this both cameras are dv video cameras the sony being 3 years old & great the Caon is 5 years old having been bought for the athens olympics. Operating system as stated is win7 that does see the cameras on my lap top. i dont know what other facts you need.
    I have contacted Adobe at least 3 times since buying Adobe PE8 the last time pointing out very unhappily that customer service is about replying to emails. The customer service contact is the one with the original packing. i have to say this is getting me no where. I want it to work when loaded its on a new PC where nothing has been added as one of your colleagues has  there is no'downloaded trash' the only programs on it are those that came with it plus PE8.
    Life & PC's are supposed to be fun this is not. when i have the time to wait for elements to talk to the net 7 crash again i will ask for more help either Windows 7 is rubbish or the link to adobe. sad really
    Date: Fri, 18 Jun 2010 06:26:09 -0600
    From: [email protected]
    To: [email protected]
    Subject: HELP!!! I am getting really fed up with things that dont work.
    Your Canon 650i is a still camera. You should be able to download the photos from it using either Photoshop Elements or the Premiere Elements Media Downloader. The video, per the FAQs to the right of our forum, will likely need to be converted before you can edit it in Premiere Elements.
    I could not find any specs on a camera called the Sony HC320i, so I have no idea if this is a still camera, a tape-based or hard drive based camcorder or even an AVCHD unit.
    Beyond that, you really haven't given us nearly enough information to help you out. If you're unhappy with the software, you can certainly contact Adobe by clicking the Contact button at the top of this page.
    Meantime, does Windows recognize a connection to these cameras/camcorders when you plug them into your USB or FireWire port? If not, the issue is with your system. Not the program. Without knowing what operating system you're using, it's hard to advise you beyond that.
    Meantime, have you gone to Premiere Elements Help menu and selected Check for Updates to get the 8.01 patch?
    Have you gone to Windows Update and manually downloaded the non-critical updates to ensure your system is completely up to date?
    Again, if you're as frustrated as you are,  I'm surprised that in the past year you have not contacted Adobe. At the very least, you could have asked for a refund within the first month or so.
    >

  • Help with broken? macbook. Boot commands dont work.

    I have an old macbook that is from late 2008 and is kinda old. First time it did 3 beeps (ram error) So i exchanged the ram and now it starts. But i get stuck at greyscreen, and sometimes at a flashing folder with a Question mark.
    I did try to go through the community here but i cant use any of the commands people are recommending..
    Command + Alt + R dont work
    Alt during boot dont work.
    Command + alt wont work... No commands do anything except leaving a blank screen and a cursor.
    If i dont hold any keys during boot i eventually get the flashing questionmark folder.
    Any suggestions?
    Can i reinstall it from a USB and how do i do it if i cant use the bootup commands? :S
    (The keyboard seems to work so that cant be the issue)
    Thanks.

    i dont know what the existing OS is.
    Cannot help with troubleshooting since you do not know which OS is installed on your comp.  If you purchased your MBP from a private party, ask them.  Better yet, did the previous owner provide you w/the DVDs that originally came w/the MBP?  If not, you purchased a glorified door stop.
    If none of the suggestions in the KB Article work out, take the MBP to your local AS or an AASP.
    There is nothing more for me to suggest until you determine which OS you are working with and you have possession of the system DVDs that originally came w/the MBP.

  • HELP!, This signs dont works in Flash CS3  - {} []

    Please help..
    This signs dont work in Flash CS3.
    Has anyone experienced the same problem?
    What to do? The weird thing is that all of these signs works in other programs....
    ctrl + alt + 0 = }
    ctrl + alt + 7 = {
    ctrl + alt + 8 = [
    ctrl + alt + 9 = ]
    Iam running Flash CS3, on my MacBook Pro, Vista BootCamp...
    Soooo frustrating..
    // Dwane

    Finally I have been able to embed fonts. Basically you should remember one thing. You can only embed the font to a dynamic text box if and only if you have added it in the library. The steps are as follows.
    1) Press ctrl + l and bring the flash assets library.
    2) Add new font, give it a name and select the font to add including its size style (bold italics etc).
    3) Select the textbox. Apply your font. (All fonts from your library comes with a trailing * mark).
    4) Select the glyphs to embed. Generally it can be all upper case letters, all lower case letters, numericals and punctuation marks.
    and you are done.
    But do remember that you can only do this to a dynamic text box

  • Can any1 help i hav Iphone4 nd the volume whn i call the volume is low i can barely hear the other person, i try using the volume key bt it dont work? help plz

    Can any1 hlp i hav an IPhone4 and the volume is so low i can barely hear the person frm the other phone, i try using volume bt it dont work?

    Did you try turning up the volume button on the left side, Also go into your settings>sounds and try to change the volume. 

  • I purchase full version of this game (triple star 2000-developer Antonio Lattanzio) but dont work full.What happent,i paid the app??PLS help

    i purchase full version of this game (triple star 2000-developer Antonio Lattanzio) but dont work full.What happent,i paid the app??PLS help

    Hi Tatae55,
    I think that your purchase failed for some connectivity reason but it will be restored as soon as you try to 'Restore' the purchase or 'Re-Buy' the Non-consumable product.
    Don't worry, you will not be charged again if your purchase was successfull before.
    Kind Regards,
    Antonio Lattanzio.

Maybe you are looking for

  • Footer in all pages

    Hi all, I have 1 page in a script with 3 windows Header MAIN AND FOOTER I have some hardcoded text in header and footer and want it in every page I see my header and footer if i have very few records say if the records in my main window fits in page

  • Zshare streaming: Seek bar doesn't fully work

    When occasionally watching a zshare stream (dislike downloading, takes too long, rather wait a few minutes and then start watching the stream), the stream loads just fine, I can click on the seek bar to make it start from a different position, and it

  • Connection problem odbc socket

    I made a odbc socket connection through a dsn to a foxpro database (tables), cf made the connection. Dreamweaver sees all of the tables, but cannot read the fields or data. Received this error message: [1]java.sql.SQLException: [Macromedia][SequeLink

  • Reading UWL item list in a Remote Function (RFC)

    Hello Experts , I have a workflow scenario running on my ECC box.I would like to know all the tasks that are running on a particular user name....and I want to expose this functionality as a remote function. Do we have such RFC out of the box or do w

  • Can canvas be scrollable?

    can canvas be scrollable? i'd like to display thousands of data on the canvas,one data a row, which cannot be displayed on one page, can it be like the form,which can be scrollable?