Help on code as2 TD

IM building a tower defence game is one of my codes

Ive got 7 turns, how could I do so 1 tower could be placed on a movieClip called water, and not on the grass of movieClip

onClipEvent (load)
{
Active = 0;
}

onClipEvent (enterFrame)
{
If (current == 1)
{
setProperty ("", _x, int ((_root._xmouse-10) / 20) * 20 + 20 ");
setProperty ("", FLF, int ((_root._ymouse-10) / 20) * 20 + 20 ");

hitTestOnGrassMovieClip = _root.grass.hitTest (_x, FLF, 1);

If {(hitTestOnGrassMovieClip)
gotoAndStop (1);
_root.Ranger.gotoAndStop (1);
}
else {}
gotoAndStop (2);
_root.Ranger.gotoAndStop (2);
}

_root.Ranger._x = _x;
_root.Ranger._y = FLF;
_root.Ranger._width = donut _root ["tower_" + round] * 2;
_root.Ranger._height = donut _root ["tower_" + round] * 2;
}
}


(press)
{
hitTestOnGrassMovieClip = _root.grass.hitTest (_x, FLF, 1);
hitTestOnDeSelectMovieClip = _root.deselect.hitTest (_x, FLF, 1);

If (hitTestOnGrassMovieClip: hitTestOnDeSelectMovieClip) {}
If (hitTestOnGrassMovieClip & & (! _root.hasGameFinished)) {}
++ _root.towerCount;
_root ["tower_" + round] .duplicateMovieClip ("t" + _root.towerCount, 500 + _root.towerCount);
a = _root ["t" + _root.towerCount];
a ._x = _x;
a ._y = FLF;
a.active = 1;
a.cost = cost;
_root. Gold = _root.gold - cost;
_root.updateInfoBar ();

If it's the first tower being placed
start the game...
If (! _root.hasGameStarted) {}
_root.newLevel ();
_root.hasGameStarted = true;
_root.instructions._visible = false;
}

}

Active = 0;
setProperty ("", _x, 1000);
_root.selectedTower = "";
_root.Ranger._x = 1000;
_root.Ranger._width = 10;
_root.Ranger._height = 10;
}
}

for the most part, it's as1 code.

but use a hittest to ensure a tower can be placed on the water.

Tags: Adobe Animate

Similar Questions

  • Compaq cq10: need help please code error: CNU0015RN9 on compaq cq10 150ev

    Need help please code error: CNU0015RN9

    Thank you in advance!

    Hello

    No problem. Did you do a hard reset and try again?

    For the error code, check again a time-

    Try:

    e9l11f3zv7

    all lowercase letters

    first letter is a small suitcase E
    second is number Nine
    third letter is small case L
    fourth & fifth is number one
    Sixth letter is small box F
    seventh is number three
    eighth letter is small suitcase Z
    ninth letter is small case V
    the last is number seven

    Concerning

    Visruth

  • help error code: 8024200 D

    Mr President, I have format my laptop. First of all, I want to install the latest update to install sp1, and later it ends with error.please help error code: 8024200 d What should I do to remove this error? I m jst pissed by again and again! Please suggest an easy and appropriate procedure.i also run boot minimum and who does not.

    Mr President, I have format my laptop. First of all, I want to install the latest update to install sp1, and later it ends with error.please help error code: 8024200 d What should I do to remove this error? I m jst pissed by again and again! Please suggest an easy and appropriate procedure.i also run boot minimum and who does not.

    reset the Windows Update components

    http://support.Microsoft.com/kb/971058

    Already answered here...
    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-windows_update/error-code-80080005-8024200d-do-not-appear-on-the/eeb6b38a-B0E8-4d80-ad23-acfd8bbedc3c

  • Replace code as2 as3

    I used a tutorial http://www.Flash-game-design.com/Flash-tutorials/funky-Flash-website-Tutorial-5.html make a menu for my application, I tried following advice on how to change code AS2 AS3, but it simply doesn't.

    menu = ['bulls', 'about', 'alignment', 'plan'];

    current var menu = [0];

    for (var i = 0; i < menu.length; i ++) {}

    var b = menu [i];

    ce.stars._visible [b + '_btn'] = false;

    this .txt [b + '_btn'] = b;

    this [b + '_btn'] .onPress = function() {}

    _root.site [current + "_btn"].stars._visible = false;

    _root.site [this.txt + "_btn"].stars._visible = true;

    current = this.txt;

    _root.site.content.gotoAndStop (this.txt)

    };

    }

    Cette.stars._visible [current + "btn"] = true;

    this.onEnterFrame = function() {}

    this [current + '_btn']. stars.s1._rotation += 1;

    this [current + '_btn']. stars.s2._rotation & = 0.5;

    };

    Thank you

    Glenn

    Hi, I have fixed that and you sent the mail, check the Inbox.

  • Help with existing AS2 code to rotate an object

    I have an item I want to turn 3D (letter 'Y'). I have a code I put together and edited it a bit, but right now she turns at the top left because he is anchor. I try to turn it to the 'heart' of the Y (absolute Center), so it is essentially in place.

    My second problem is the speed. Ideally, it should turn very quickly and then slow down and stop. Any thoughts on how to clean either this code to make it work? I'm pretty new, so any help is appreciated. I could try with only a transformation of the form, but I'm trying to see if it can be cleaner with Actionscript. Thank you!

    Here is a link to the CS4 .fla file if that helps.

    http://Board.flashkit.com/board/showthread.php?p=4296719#post4296719

    scaleDirect = -1;

    DEC2HEX function ()dec ()

    {

    if ( dec > 15 )

    {

    POS1 = hexChars. charAt() ( Math. floor ( dec / 16 ) );

    POS2 = hexChars. charAt() ( dec - ( pos1 * 16 ) );

    } else

    {

    POS1 = 0;

    POS2 = hexChars. charAt() ( dec );

    }

    Hex = pos1 and pos2;

    return hex;

    }

    this. ( onEnterFrame = function()( )

    {

    letterMC. _xscale += scaleDirect * Math. floor (1+ ( 101-Math. ABS() letterMC. _xscale ) )/2 );

    if ( ) letterMC. _xscale < = -100 | letterMC. ( _xscale > = 100 )

    { scaleDirect * = -1;} }

    }

    don't use acceleration in your _xscale property:

    this.onEnterFrame = function()

    {

    letterMC._xscale += scaleDirect;

    If (letterMC._xscale <= -100="" ||="" lettermc._xscale="">= 100)

    {scaleDirect * = - 1 ;}}

    }

  • Charger (need help to convert AS2 AS3)

    Because I know that this code works very well and that I use it in one of my flash AS3, I need it in one of my flash AS2 and I do not know how to adapt. I searched more than 100 threads and I can not find something similar... Thank you to help me make it work in AS2! As I need in AS2, I thought it would be the right place to post.

    I posted the entire process of loading code, but I need help especially with the charger part. How to do this in AS2? Thank you!

    var img = 0;
    var image_total = 0;

    var myImages_array:Array = new Array();
    var myBitmaps_array:Array = new Array();

    function Init();

    {

    Image URLS is loaded into a table before this call
    LoadImage();

    }


    function LoadImage()
    {
    If (img, myImages_array.length) / / img is the index of the current image and myImages_array is my URL table
    {

    I need help with this framework, you can
    var loader: Loader = new Loader();

    / / Returns the full path of the image and load it
    Loader.Load (new URLRequest (my_site_url + myImages_array [img]));
    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, imageLoaded);

    }
    on the other
    {
    If (count == 0)
    {

    When everything is loaded, I'll start loading my Bitmaps in a short slide show
    Count += 1;
    init_slideshow();
    }
    }
    }

    function imageLoaded(e:Event):void
    {
    Bitmap of the image: var = e.target.content;

    Bitmap manipulation (deleted) here

    image_total = myBitmaps_array.push (image);

    If (img < myImages_array.length)
    {
    IMG += 1;

    Call the following image
    LoadImage();
    }
    }

    function init_slideshow (): void
    {

    The current index for the first Reserts
    IMG = 0;

    Start the slide show, since everything is loaded
    animate_slideshow();
    }

    Look at the MoveClipLoader class and the addListener method that supports.

  • Looking for help developing code labview [Urgent]

    Hello
    I need assistance in the development of labview code. I'm new to labview and will appreciate if someone can help me in this matter. I need to control the intensity of charge of ca (halogen with 2kW, 230V, 50 Hz) using Labview and Arduino. But my project with interruption in the Arduino, so it is not possible to use the Labview Interface for Arduino (LIFA).  I searched and it might be possible to use VISA series in this case. The circuit and the Arduino code is attached. Someone who is a subject matter expert can help me?

    The concept of my project is almost the same with https://www.youtube.com/watch?v=oeVJ5bs6E8M&feature=youtu.be

    Hello

    You will find all the information you need and examples of LabVIEW VI from LabVIEW Interface for Arduino

    Interface LabVIEW for Arduino

    Kind regards

  • HELP error code: 80072efe - cannot download or install security updates or update the definitions of viruses and spyware

    Help, please!

    I am running Vista Home Premium 32 bit on SP2.

    I just had my McAfee security expires and since I was not able to install security updates.

    I uninstalled McAfee and searched my system to make sure that it is completely gone, then I installed Microsoft Security Essentials.

    I was able to update its definitions of once and since I was not able to do so once again - instead, I get the error message "Virus and Spyware definitions update failed" and the code of error 0x80072efe

    I have since run a full scan of the system and the following were found on my system:

    -Trojan Dropper

    -Trojan notifier

    -Trojan Downloader

    -Virus: Win32/Alureon.H

    It is said that they have been removed - I'm not sure if they have something to do with my problems of system...

    Also my windows update still does not go to download security updates, and it still gives me the same error code.

    Is there a way to fix this?

    Thank you very much

    Also, the first update failed installed has been updated for Windows Vista (KB955430)

    The last successful security update was security update for Windows Vista (KB979309)

    The one who follows - update security for Windows Vista (KB978338) failed and there all security updates do not have

    I just had my McAfee security expire... I installed Microsoft Security Essentials.

    You should have uninstalled the McAfee application and download / run the tool to remove McAfee Consumer product and then installed Microsoft Security Essentials before as your McAfee subscription has expired.

    See...

    Can I install Microsoft Security Essentials [or any other anti-virus/anti-spyware application] to clean my already infected computer?
    http://social.answers.Microsoft.com/forums/en-us/msescan/thread/87058857-D181-4019-a723-efd9a49d9275

    Personal data backup (which none should be considered 100% reliable at this point) then format the HARD disk and do a clean install of Windows.  Please note that a repair installation (upgrade AKA on-site) will NOT fix it!

    HOW to do a clean install of Vista: section "If you want to reinstall Windows Vista by running a new installation...". "of http://windows.microsoft.com/en-us/windows-vista/Installing-and-reinstalling-Windows-Vista

    Once installed the clean, you will have the equivalent of a "new computer" in order to take care of everything on the next page before connecting the machine to the internet or one local network (i.e. other computers) otherwise and before using a flash drive or the SD card that is not brand new, or has not been freshly formatted:

    4 steps to help protect your new computer before going online
         http://www.Microsoft.com/security/pypc.aspx

    Tip: After getting the computer fully patched, download/install KB971029 manually: http://support.microsoft.com/kb/971029

    NB: No matter what Norton or McAfee free trial which is preinstalled on the computer when you bought will be reinstalled (but invalid) when Windows is reinstalled. You MUST uninstall the trial for free and download/run the removal tool before installing updates, Windows Service Packs, or updates IE and before installing your new anti-virus application.

    Norton Removal Tool
         FTP://ftp.Symantec.com/public/english_us_canada/removal_tools/Norton_Removal_Tool.exe

    McAfee Consumer product removal tool
         http://download.McAfee.com/Products/Licensed/cust_support_patches/MCPR.exe

    See also:

    Risks & benefits of P2P file sharing
    http://www.Microsoft.com/protect/data/downloadfileshare/filesharing.aspx
    http://blogs.technet.com/MMPC/archive/2008/10/06/the-cost-of-free-software.aspx

    Measures to help prevent spyware
    http://www.Microsoft.com/security/spyware/prevent.aspx

    Measures to help prevent computer worms
    http://www.Microsoft.com/security/worms/prevent.aspx

    Avoid fake security software!
    http://www.Microsoft.com/security/antivirus/rogue.aspx

    If these procedures look too complex - and there is no shame in admitting this isn't your cup of tea - take the machine to a local, good reputation and stand-alone computer (that is, not BigBoxStoreUSA or Geek Squad) repair facility.

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

  • Need help RE: Code 80070005 error when I try to update

    I get the error code 80070005 when I try to update. I also got "Fix a problem" then "Try again" with the same results. I tried to download the update from the window

    Hi cynthiabrickey,

    Follow the troubleshooting steps in this thread to solve the problem with Windows Update, error 80070005.

    Let us know if it helps.

  • Help with code 800401154

    I can't get my updates? all I get is error code 800401154 Please HELP

    Hi, Ray MrJoesmokeyBailey,.

    1. the updates you are trying to install?

    Step 1:

    You can read the following article and try to reset the Windows Update components and check.

    How to reset the Windows Update components?

    Step 2:

    If you're still having problems, then try to run you can also try running the system update readiness tool and check if you can install the update.

    What is system update readiness tool?

    Hope this information is useful.

  • need help error code c355

    I have this code in my history of update?

    Hello

    1. for the update that you get this error code?
    2 did you recent hardware or software changes to your computer before this problem?

    Step 1: Install the first update manually in the clean boot state.

    Put your boot system helps determine if third-party applications or startup items are causing the problem. If so, you need to maybe contact the manufacturer of the program for updates or uninstall and reinstall the program.

    See the following article in the Microsoft KB for more information on how to solve a problem by performing a clean boot in Windows Vista or Windows 7:

    http://support.Microsoft.com/kb/929135

    Note: After troubleshooting, be sure to set the computer to start as usual as mentioned in step 7 in the above article.

    Step 2: I also suggest you to run the system analysis tool and look for problems with Windows Update.

    http://support.Microsoft.com/kb/947821

    Step 3: You can try to download the update from the Microsoft Download Center and install it.

  • Please help trouble Code 43 error graphics card for XPS 8700 (as well as the disappearance of sleep/Standby Mode) (Windows 10)

    I got my XPS in 2014 and my warranty of service completed in 2015 Jan before I installed Windows 10. So since I've upgraded to Windows 10 I started having problems with by XPS 8700. Now, I have no guarantee. I thought he would go better once they have released an update of the BIOS and it did for a while unfortunately in recent months, I noticed two major issues.

    (1) upon the starting and restarting my computer, my monitor does not end up receiving the signal from the computer and remains dark.

    -Checking that it is not a problem with the monitor by testing with other computers

    -J' checked in the Device Manager and there was a next yellow alert for graphic cards / NVIDIA GeForce GT 635

    -By clicking on, he showed me this: Windows has stopped this device because it has reported problems. (Code 43)

    Unfortunately, it is not the only problem with the graphics card.

    (2) "sleep" my mode is gone (it is related to graphics and BIOS).

    -J' tried the go in power to add setting but it was not yet listed.

    -I went to the command prompt and looked powercfg.exe that's what I discovered:

    C:\Windows\System32>Powercfg - a

    The following sleep States are available on this system:

    Hibernate

    Quick start

    The following sleep States are not available on this system:

    Standby (S1)

    The system firmware does not support this standby state.

    An internal system component has disabled this standby state.

    Graphics

    Standby (S2)

    The system firmware does not support this standby state.

    An internal system component has disabled this standby state.

    Graphics

    Standby (S3) mode

    An internal system component has disabled this standby state.

    Graphics

    Eve (S0 low idle power)

    The system firmware does not support this standby state.

    Hybrid sleep

    Standby (S3) mode is not available.

    Now I really wish I could start or restart my pc without staring at a blank screen and the problem of code 43 with Nvidia GeForce GT 635. Also, I would if I could have the option to upgrade my PC to sleep. I really miss it and do not have to constantly reboot my computer to be able to see anything on the monitor.

    I hope someone can help me with these questions without having to reset the pc and reinstall, all over again, that the problem still exists in other cases (I don't have a copy of the installation of programs pre-installed dells so...). This computer is only 2 years old, it didn't need to be retired.

    NVIDIA GeForce GT 635 (PCI\VEN_10DE & DEV_1280) the card is physically wrong and needs to be replaced.

  • Need help with code signing.

    Hello

    I did an application that requires a code signature because I use the function 'Automatic Execution at startup' (this is what I was told).  I use not all restricted classes.

    So, I asked for a key to the RIM and received.

    I have received only a single file named "customer-CPR-# .csi" (the e-mail talked about three files however: RBB, CPR, RRT).  Nevertheless, I followed the instructions and managed to install this .csi without error (I received a confirmation e-mail).

    Now, I want to sign my code...

    I tried using "build - request Signatures ' in my Blackberry JDE and this displayed:

    javaw.exe - jar "C:\Program research in Motion\BlackBerry JDE 4.2.1\bin\SignatureTool.jar" f d "C:\Documents and Settings\johndoe\Local Settings\Temp\RIMSigTool65120.tmp"

    However, nothing happens (this jar file is there though).

    I looked beyond and found a 'Signature tool' under "Component of the Blackberry JDE 4.2.1 Package" in the "Programs" menu

    When I run this, I get invited to one. COD file.  I select my and then I see a window that shows six times my. File of COD that says that my COD file does not require a signature.

    Also, looking around this forum, I have seen some people saying a. CSL file is necessary... but I do not have this file in my project directory.

    So to make a long story short, I'm a bit confused on what do I do next for my application run at startup on the Blackberry.  How should I sign it?

    Thanks for your help!

    Please ensure that you have a current project, when you select apply Signatures from the Build menu.  The only assets of signs SignatureTool projects, so if no project is active, nothing will happen.

  • need help with code 43 windows7 hp all-in-one2050 j510

    Code 43 felmeddelande

    Windows 7 har stangt av printern.

    Tell me WHY "?"

    Var snall och help till att fixa felet.

    Tack

    Hello

    Please select your language from the drop-down menu above to post your question in the language of your choice. The forum in which you've posted is for English only. If you can't find your language above, support for additional international sites options are by following the link below:

    http://support.Microsoft.com/common/international.aspx

    Hope this information helps.

  • Help - no Code of Activation!

    We bought our laptop with office home & student responsible. We sent our payment / registration to Microsoft directly and received a copy of backup by return. We have no record of a Code of Activation.

    Our computer crashed and I had to re-start, in start mode.
    We were told that Microsoft should have our purchase on file. Please, help us to activate.

    Find your key product if your purchase of Microsoft Store:
    http://store.Microsoft.com/Help/FAQ?Err=T2#AT2

Maybe you are looking for

  • What type of adapter you equip cards sd?

    I am updating from a 3rd Gen with an air 2 ipad.  What type of adapter you put the SD with an air 2? With my older ipad, I used an apple sd card reader connected to the PIN 30. I bought an sd for the ipad Reader 8 pin 4th Gen that was my wife and she

  • Changed username on Mac. Wish it was a dream (nightmare)

    Yes, I've read the warning - the word "might" made me take a chance and I changed the username admin with my name, nothing else. When I rebooted, I was like a stranger. OK, so the Mac is new (for me) and I had a big thing for her and I found my stuff

  • How can I delete my messages?

    It seems that only the 'hosts' can delete messages.  Very well, but is - it not a bit exaggerated?  If I have a post I got an answer, why can't I have mark it as inactive?  It will be always available to help others, but people do not need to answer.

  • NDK Build Version problem?

    I've updated my alpha Dev unit yesterday to the latest version when I was told of my Blackberry Desktop software. I went to QNX Momentics IDE and continued development on my project that worked before on my device. Now, when I debug him I get a pop u

  • ports (vulnerability analysis)

    I ran a scan of vulnerability on a switch 2960 and certain "ports" (I don't even know if it's the right way to call them) showed an opening or which needed to be considered. I really need to know what they are and if I have to keep or have to get rid