Make a ball disappear when it hits a target

Hello, everyone! I would like to help with a problem I have.

I created a class named Bullet() and I create a child named bullet_mc every second. This bullet_mc moves in a direction on the stage.

I also created a class named Plane() and I create a child named myPlane_mc every two seconds. In addition, each myPlane_mc moves to a focus on the scene.

How can I make all bullet_mc disappear whenever it hits a myPlane_mc.

Because you declare the ball inside a function, he has only worn within this function, so it does not exist in the scope of the other function where your plane is created and tested against it.  It works the opposite in the plan if/when you are trying to test out the other way. So, to help you on this mound mistake what you should try is to move the ball outside the function declaration...

var bullet_mc:Bullet;

function txPulse(e:TimerEvent): void {}

bullet_mc = new Bullet();

bullet_mc.x = myAntena.x;

bullet_mc.y = myAntena.y;

bullet_mc.rotation = myAntena.rotation + 9;

addChild (bullet_mc);

}

I was not looking to follow how all the calendar fits in this, so I can't say if your test schedule is also a problem.  But I see that you are only testing the plane for a shot as soon as it is created and never... you just keep creating new ones with random values y and tests each only once against the ball.

(Edit: I don't know why, but the forum software split the code before and after the last paragraph... If all goes well, it remains fixed)

Tags: Adobe Animate

Similar Questions

  • Make a button disappear when clicked.

    Hello

    I created a button that makes a div appear. But what I want to know is that the button disappear once clicked or change its function and name to make the div disappear.

    Problem is I've already used the service, onClick, here is the code

    < script language = "JavaScript" >

    function setVisibility (id, visibility) {}

    document.getElementById (id).style.display = visibility;

    }

    < /script >

    HTML:

    < p > < a href = "#" onclick = "setVisibility ('hidden', 'inline'); This.onclick = function () {return false ;};} « ; > See more < /a > < /p >

    < div id = "hidden" > < time > 10/12/2010 < / time >

    < br / >

    < p > for No More Video Production is under way amd will be with you soon. < /p > < time > 10/12/2010 < / time >

    < br / >

    < p > for No More Video Production is under way amd will be with you soon. < /p >

    < / div >

    Any help would be appreciated.

    Tom

    Read more


    Read less


    Video No More music production is underway amd will be with you soon.

  • How to make the message disappeared when I connect Vsphere

    Hi all

    Here's my problem.

    A few days ago I installed vcenter server and ESXI has added to the cluster of the vcenter.

    Then I'll see this message as screenshot said every time when I have the connection with the vsphere client. Now my vcenter is declining and removed

    And the message is displayed each time. Now I wonder how do the message disappeared

    Thank you very much.

    Hey, this problem is solved.

    1. as your method just to restat pass, then the message went

    2 connection Esxi5 and go to the customization of the system-> troubleshooting option-> restart Managents well and then press F11 to restart the agent.

    Thank you all the answers you guys!

  • How can I make a symbol disappear when I'm done with it?

    I have a symbol as pans on the screen when you press a button, and then pans off the screen when you press another button. The problem is that after the symbol slide away, I can no longer click on the buttons in the area he was covering. I tried everything I can think of-sym $("name") () .hide; does not work, sym.getSymbol("name").deleteSymbol (); does not work either and visualize the symbol off of turn after playing also does not work. What I am doing wrong and how can I fix this?

    Ok. This works except for one small thing. The box slides out under the button. But this will give you an idea on how to solve your problem.

    I placed the code btn ready composition and left the close button in the red box.

    https://www.box.com/s/e0dv4zdzdzcoqvuabrp6

    I hope this helps.

  • Desktop shortcut icons have disappeared when I tried to boom, them. How to make a comeback?

    How can I get the shortcuts to pin to the XP desktop screen?

    All of the shortcuts that were on my xp desktop screen disappear when I was trying to make the icons smaller.  I clicked of course something (?) to make this happen, but have not figured out what that is or how to fix.  Shortcuts are currently in the Desktop file folder

    How you tried to resize them?
     
    Right click on the desktop | Rearrange icons by. East: show desktop icons checked?
  • When I hit the DELETE key on the keyboard, e-mail disappears. It does not go in my trash folder. How to fix this?

    When I hit the DELETE key on the keyboard, e-mail disappears. It does not go in my trash folder. How to fix this?

    Have a look here at the facility for the IMAP folders...

    http://support.tigertech.NET/Windows-Live-Mail-IMAP

    Section 3: The screenshot shows the part of special folders when the box is checked to leave them on the IMAP server. If this box is NOT checked, it puts the special folders on the local computer, which may explain why each entry has its own trash...

  • When I go to file and download a picture that everything is fine, but when I go to the file again and try to load a second image makes the former disappear. Why?

    When I go to file and download a picture that everything is fine, but when I go to the file again and try to load a second image makes the former disappear. Why?

    From your description, I suspect that you have selected Open Documents as tabs in the Interface preferences section.

    Your first image doesn't go away, but is in tabs at the top of the images.

    If you prefer to see the images separately, uncheck the box of Documents open as tabs, as shown below

  • How to make a menu dropdown disappear once I hit a sub menu item that is bound to an anchor?

    I have a composition of menu standard mobile widget that takes place when you click on it, but when I click on the submenu that menu parent rest play this sheath content slot - the only way to get rid of click on the menu icon.

    I need the menu to disappear once I hit the link (which is bound to an anchor more towards the bottom of the page)

    Thank you

    Please try to use the option Hide target "on the deployment of the trigger and target.

    Thank you

    Sanjit

  • When I export my file to generate a .pdf file, the text box is literally a box around it! How to make this line disappear?

    When I export my file to generate a .pdf file, the text box is literally a box around it! How to make this line disappear?

    Looks like you have a line on it. Select the image and the race set to None.

  • How to make a scroll animation constantly fixed after scrolling? I want the animation at the beginning when I scroll down, but I don't want the animated thing to disappear when I scroll to the top again.

    How to make a scroll animation constantly fixed after scrolling? I want the animation at the beginning when I scroll down, but I don't want the animated thing to disappear when I scroll to the top again.

    I know how to start the animation by scrolling down, but I just want that he stay there after him. Could you help me please, guys?

    Hi Tom,

    There is no native function to Muse to achieve this goal.

    Kind regards

    Aish

  • My menu bar disappears when I move the cursor to the top of the document.  F9 it back, but I have to hit it twice everytime I go up to the menu bar.  How can I disable this feature?

    My menu bar disappears when I move the cursor to the top of the document.  F9 it back, but I have to hit it twice everytime I go up to the menu bar.  How can I disable this feature?

    Read this:

    Bug: KIS version 15.0.0.463 patch B Acrobat Reader XI - Kaspersky Lab Forum

  • When I hit the + key for a new page, all my widgets have disappeared. All my sites are listed is no longer. How to re - install?

    I changed my search engine of Norton. Now when I click on the tab for a new page, it happens with search for Norton and I don't have my widgets with my sites. I have removed the research and tried everything to get widgets to my sites favorite on when I hit the sign '+' for a new page.

    Need help

    Check and see your current newtab setting:

    Type of topic: config< enter > in the address bar.
    If a warning screen is displayed, press the button to be careful .
    At the top of the screen is a search bar. Type browser.newtab.url
    This indicates what to show when a new tab opens Firefox.
    If you want, right click and select Edit. You can change the setting

    topic: Home (Default Firefox homepage),
    on: newtab (displays the more visited sites),
    Subject: vacuum (a blank page),

    or you can enter any web page or Subject: page you want.

    The same instructions are used to the new setting of the window, classified
    browser.startup.homepage.

    Start Firefox in Safe Mode {web link} by holding down the < shift >
    (Mac options)
    key and then from Firefox. Is always the problem?

  • Keep my message disappears when I send them offshore, and whenever I click iMessage my beginning of phone vibrates and make this sound ringtone - what that means and what I need to do so that he can stop?

    MMy messages disappear when I send only the & my message sometimes do not send. When I click iMessage he's my phone vibrate and ring sound to where I have to exit the whole application. What do this mean and what do I do to stop?

    Hey Nishya12,

    Thank you for using communities of support from Apple!

    From what I read, it seems that your iPhone on iOS 9.3.3 5s is not cling your text/iMessages. I'd like to keep track of these conversations myself I'll be happy to help you.

    Because you used the link at the bottom of the use of Messages with your iPhone, iPad or iPod touch to get more help, I'll assume you have check the Messages on your iPhone settings. If you do not, click the link and check that everything is configured correctly.

    iMessages is part of the iOS on your iPhone, in order to have this behavior as you described refers to a problem with the installation.

    Save your iOS device - install a new clean copy of iOS on your iPhone, is what we call here. Since this process will erase everything, I highly recommend making sure your personal data is safe to backup and first.

    Use iTunes on your Mac or PC to restore your iOS device - to install a new copy of iOS, your iPhone will be erased completely and that cannot be done via iTunes on a computer. In the settings of the iPhone doesn't that erase your personal information.

    Once your iPhone has rebooted, you will configure your phone as a new iPhone this time. If you wish, you can connect to dive into iTunes and App Store and iCloud. At this point, check iMessages and see if it keeps your messages after they are sent. If so, the next step.

    Restore your iOS device from a backup - now you're ready to bring your information to your iPhone. Just follow the steps described in this article.

    Take care and have a nice day!

  • Often, when you type an e-mail onYahoo it will disappear. It seems to happen when I hit the bar space or shift. Is there a way I can get back them?

    pretty much explains what is happening. It is only with e-mails, it seems to happen when I hit the space bar.

    Hello

    I suggest you press once on the button "Insert" on your keyboard and check.

    I also suggest you to contact yahoo email support center and check.

    http://answers.Yahoo.com/dir/index;_ylt=AnDwB7MnqfHNt_sdgfkk. K_kDn1G; _ylv = 3? SID = 396546168

  • do not click on the menu that appears when I right-click my taskbar, such as the right click menu disappears when I move the mouse the right click menu

    PROBLEM: CONTEXT MENU DISAPPEARS WHEN YOU TRY ON THE LEFT, CLICK AN OPTION

    Hello
    I'm using Windows 7, and I could always
    go to my taskbar and right click
    Icons and active icons, bring to the top
    the list on the right click on the standard Menu.

    PROBLEM
    As soon as I moved my mouse away from
    the background of windows 7 taskbar to go a couple
    millimetres above on the left, click an option in
    I opened with my right click context Menu
    The whole Menu disappears, and it happens in
    Firefox version 29.01, other programs in Firefox,
    and others such as Skype.
    When I was running Firefox 28
    I didn't have this problem, can you help out me.
    Thank you
    Kev Borg

    PROBLEM
    MAKE ONE CLICK RIGHT MENU DISAPPEARS WHEN YOU MOVE YOUR MOUSE TO THE LEFT, CLICK ON A MENU OPTION IN THE RIGHT CLICK MENU.

    'YOU can not because WHEN YOU MOVE YOUR MOUSE TO THE MENU YOU JUST a RIGHT CLIC ON OPEN DISAPPEARS before you HAVE a CHANCE TO CLICK LEFT of YOUR CHOICE. "

    SOLUTION
    [ 1] GO TO control PANEL AND click HERE FOR the VIEW MENU
    [ 2] GO to "EASE of ACCESS CENTER" AT the TOP.
    [ 3] LEFT CLICK ON the MENU ITEM "theEASE of ACCESS CENTER.
    [ 4] AFTER YOU are a LEFT CLICK ON 'EASE of ACCESS CENTER' seems.
    [ 5] LOOK down THE LIST UNTIL YOU FIND to "MAKE THE MOUSE EASIER to USE".
    [ 5] THE UPPER SHOWS YOU HOW to CHANGE YOUR MOUSE COLORS ETC.
    [ 6] SCROLL DOWN UNTIL YOU SEE THIS TOPIC "MAKE IT EASIER to MANAGE WINDOWS".
    [ 7] UNDER this MENU, there is check.
    "ACTIVATE a WINDOW BY HOVERING over IT WITH YOUR MOUSE"

    [8] ARE OF COURSE IS NOT A CHECK MARK IN THIS BOX TO OPTION, IS THERE A CHECK IT AND APPLY AND CLICK OK TO SAVE.

    And now, you should have no more problems with your right click Menu disappears when you move your mouse over the menu left click on a menu item on a right click menu.

    SOLUTION SOLVES THE PROBLEM.

    Thank you and I hope this answer help all the other people who have had this frustrating problem.

    was soon KiwiKev

Maybe you are looking for