I have some problems with work in Flash cs6

I have some problem with my game when I created it using adobe flash cs6
When the duck hits the screen, like from right to left it shows
TypeError: Error #1009: Cannot access a property or method of a null object reference.
  at Duck/ducksmove()
  at flash.utils::Timer/_timerDispatch()
  at flash.utils::Timer/tick()
This is the code so please help check which is wrong
package  {
  import flash.display.MovieClip;
  import flash.utils.Timer;
  import flash.events.TimerEvent;
  import flash.events.MouseEvent;
  public class Duck extends MovieClip {
  var moveDuck:Timer = new Timer(10);
  var speedX:Number;
  public function Duck() {
  this.addEventListener(MouseEvent.CLICK,KillDuck);
  moveDuck.addEventListener(TimerEvent.TIMER,ducksmove);
  moveDuck.start();
  speedX = 10;
        function ducksmove(evt:TimerEvent):void
  this.x -= speedX;
  if (this.x <=0)
  moveDuck.stop();
  moveDuck.removeEventListener(TimerEvent.TIMER,ducksmove);
  this.parent.removeChild(this);
  function KillDuck(evt:MouseEvent):void
  var p:MovieClip = this.parent as MovieClip;
  p.setScore();
  p.updatecount();
  this.removeEventListener(MouseEvent.CLICK,KillDuck);
  this.parent.removeChild(this);
  moveDuck.addEventListener(TimerEvent.TIMER,ducksmove);

You appear to be trying to remove the same object twice, first in the KillDuck function and then in the ducksmove function.  If it is removed already you can't try to remove it again because it is no longer in the display list.

Similar Messages

  • I have some problem with my computer because when i turn it up, the screen turns in a blue colour and the sound doesn't work and in this way i can't hear anything

    i have some problem with my computer because when i turn it up, the screen turns in a blue colour and the sound doesn't work and in this way i can't hear anything

    Will u help me or not?

  • I have some problem with In-App Purchases

    Dear Customer Support,
    I have some problem with In-App Purchases
    Because my 4 year-old daughters purchased  In-App when he play
    and i can not Report a Problem  in Itune
    I inadvertently purchased all of this application below.
    Order Number:
    Receipt Date: 16/04/12
    Order Total: $99.99
    Billed To: MasterCard
    Diamond Dash,140000 wooga
    Report a Problem In App Purchase   $99.99
    Payment Card Total $99.99
    Hope I can get help from you as well.
    Best regards
    <Email Edited by Host>

    Hi, ddddda
    I've got the same problem, same rate.
    I called to Apple Support and she recommended me to report by this link.
    http://www.apple.com/asia/support/itunes/contact.html
    (Select topic .. App store)
    Within 6 hrs, Apple replied me with this.
    >>>>>>>>
    Dear Charin,
    Josh here from the iTunes Store.
    I understand your son made a purchase accidentally that you would like refunded. When it comes to your money, I can certainly appreciate how important it is to feel that you are treated fairly, and I would be more than happy to help you out with this today.
    Please read my entire email as I have included information about your refund, what was purchased and how to avoid these type of purchases in the future.
    Charin, the charges in question are for in-app purchases. An in-app purchase is a purchase that can be made within an Application on an iPhone or an iPod Touch.
    In-App purchases are items you can buy that will assist you in advancing in the game you're playing. Some examples of In App Purchases are: bonus game levels or maps, additional experience points, subscriptions, and recurring services.
    The Application "Diamond Dash" was free, and this is the Application that was used to purchase the in-app items. The in-app purchases were for "1000 Gold" to be used when playing "Diamond Dash."
    Please note that there is a 15 minute window after initially entering in your password, where the password is not requested again. Once this time has passed, you will be requested for your password, and also to confirm the purchase by tapping the Buy button.
    To prevent any further in-app purchases from being made unintentionally, please set the in-app restriction on your device(s) as soon as possible. You can set the in-app restriction on an iPod Touch, iPhone or iPad by following these steps;
    1) Click on the "Settings" Application
    2) Now from the list of options click on "General"
    3) Scroll down and click on "Restrictions"
    4) Under the heading "Allowed Content" be sure that "In-App Purchases" is "OFF."
    After reviewing the circumstances of your case, we determined that issuing you a refund for your unintentional purchase of "1000 Gold" is an appropriate exception to the App Store Terms and Conditions, which state that all sales are final. In five to seven business days, a credit of $99.99 should be posted to the credit card that appears on the receipt for that purchase.
    The iTunes Store provides a warning message that asks if you are sure that you want to buy an item. This warning can be turned off. If you would like to make sure that this warning is on, you can reset the warnings in the iTunes Store by following the instructions in this article:
    Resetting iTunes Store warnings
    http://support.apple.com/kb/HT1734
    Additionally, you can make modifications on certain devices that will prevent them from making purchases:
    iPhone, iPad, and iPod touch: Understanding Restrictions
    http://support.apple.com/kb/HT4213
    Please let me know if you require any further assistance with this issue, as if you do, I would be glad to help. Thank you very much for being part of the iTunes Store family, Charin. I hope you have a great day.
    Sincerely,
    Josh
    iTunes Store / Mac App Store Customer Support
    Please Note: I work Sunday 7 AM - 3:15 PM, Monday 4:00 PM - 11:30 PM, Tuesday 3:30 PM - 11:30 PM, and Friday 7:00 AM - 3:15 PM
    All times are EST.
    Thank you for allowing me the opportunity to assist you.
    >>>>>>>>>>>>>>>>>>>>>>>>>>
    Once i've got any development, I'll posted here.
    remark : This app "in-app purchase" no need for password confimation in buying dialogue.

  • I hav som problem with my appstore n ibook dey just dont load i thought i need 2 upi date but now in mavericks updates r connected with appstore it opens up but it doesnt load sam with my ibook app and ye my date and time is fine any solutions?

    i have some problem with my appstore and ibook they just dont load thought i need to update but now in mavericks updates are now connected with appstore so i cant do that it opens up but doesnt load just blank same with ibook store it says cannot connect and yea my date and time is fine any solutions?

    Hi, James.
    Yes, the iBook should run even with no battery installed.
    These are the four most common possibilities when the battery will not charge:
    (1) there is something wrong with your battery
    (2) there is something wrong with your power adapter
    (3) there is something wrong with your power input board (the part that contains the port where you plug in the adapter)
    (4) there is something wrong with your logic board
    Since you have eliminated all the possibilities except (4), it is likely that your logic board is having problems. The PMU (Power Management Unit) is part of the logic board, and it may be going out (hence, temporarily working again when you reset it). Since the iBook is not running reliably without the battery in place (as it should), replacing the battery most likely would be futile.
    When a computer gets to be five years old, it seems a bit short-sighted to pay very much for repairs, just to have something else go wrong sooner rather than later. Have you had a look at the hugely improved specs on the new MacBooks? Is it time for a new portable to avoid embarrassment during your presentations? It sounds like that could be your best option.

  • Hi guys. i have some problem with a link from a pdf on-line,when i click on it,the page adds a "%" at the and of the link and says "page not found" because of it

    Hi guys. i have some problem with a link from a pdf on-line,when i click on it,the page adds a "%" at the and of the link and says "page not found" because of it.
    This happens only when a load my pdf file on my server, because if i click on the link when the file is on my iPad, the page opens without problem.
    Any help please?
    thanx

    the % sign is often used when there's a space in a name. HTML doesn't like spaces so it fills them with % or %20
    try, on the end of that link, see if there's a space built into the page or the link when the page was made
    On the web address you may be able to 'backspace' at the end and erase that space to get the address, but whomever made the page possibly put a mistake in the link

  • I have some problems with element Panel Label and Message.

    I have some problems with element Panel Label and Message. When I create form from VO attributes then I have Label for input text element. If I use Panel Label and Message element then I need to copy LABEL from input text element to Panel Label and Message element LABEL PROPERTY. Can I define in View object that I don't need label and want all attributes in Panel Label and Message element?
    BEST REGARDS

    You can simply remove the label attribute for the input text on the page.
    sid

  • Hi! Everyone, I have some problems with JOIN and Sub-query; Could you help me, Please?

    Dear Sir/Madam
    I'm a student who is interested in Oracle Database and
    I have some problems with JOIN and Sub-query.
    I hope so many of you could help me.
    if i use JOIN without sub-query, may it be faster or not?
    SELECT field1, field2 FROM tableA INNER JOIN tableB
    if i use JOIN with sub-query, may it be faster or not?
    SELECT field1,field2,field3 FROM tableA INNER JOIN (SELECT field1,field2 FROM tableB)
    Thanks in advance!

    Hi,
    fac30d8e-74d3-42aa-b643-e30a3780e00f wrote:
    Dear Sir/Madam
    I'm a student who is interested in Oracle Database and
    I have some problems with JOIN and Sub-query.
    I hope so many of you could help me.
    if i use JOIN without sub-query, may it be faster or not?
    SELECT field1, field2 FROM tableA INNER JOIN tableB
    if i use JOIN with sub-query, may it be faster or not?
    SELECT field1,field2,field3 FROM tableA INNER JOIN (SELECT field1,field2 FROM tableB)
    Thanks in advance!
    As the others have said, the execution plan will give you a better idea about which is faster.
    If you're trying to see how using (or not using) a sub-query affects performance, make the rest of the queries as similar as possible.  For example, include field3 in both queries, or ignore field3 in both queries.
    In this particular case, I guess the optimizer would do the same thing either way, but that's just a guess.  I can't see your execution plans.
    In general, simpler code is faster, and better in other ways, too.  In this case
    tableB
    is simpler than
    (SELECT field1, field2  FROM tableB)
    Why do you want a sub-query in this example?

  • HT3702 Dear Customer Support... I have some problem with In-App Purchases and i can not Report a Problem  in Itune

    Dear Customer
    I has one Iphone and I have some problem with In-App Purcases Because my sister purchased In-app when she play
    and i can not report a problem in Itune,
    I inadvertently purchased all of this application in Order Number: MH*****4H5  Date: 04/09/12 ,Order Total $36.81
    So i can't use App store on my phone Because have problem Billing info and i dont want this order, I inadvertently purcased all of this application
    Hopefully I can ge help from you as well.
    Best Regards
    <Edited By Host>

    These are user-to-user forums, you are not talking to Apple here. All purchases are considered final, but you can try contacting iTunes support and see if they will refund or credit you : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • I have some problem with home sharing

    I have some problem with home sharing. I have iPad, iPhone, MacMini, MacBook and Apple Tv. Five items. I can't add other items to home sharing, like iPhones and pc of my sons, and my wife's pc. More than home (Family) sharing it becomes Single sharing. Is there any solution?

    Post in the iPhoto forums.

  • I HAVE SOME PROBLEM WITH I PHOTO HOW TO TAKE BACKUP AND REINSTALL I PHOTO

    I have some problem with IPHOTO,How to take back up and reinstall i photo. Everytime i start I PHOTO there is a message showing that 15 photos have been recovered do you want to save or not,whatever i do it creates empty folders and it asks two times before starting .
    any sollutions?

    Post in the iPhoto forums.

  • Hi, guys. I have some problems with my ipad. It has been switched off and it does nor respond on any actions

    hi, guys. I have some problems with my ipad. It has been switched off and it does not respond on any my actions

    Reset the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Please i nedd help my account do not let me put any credit card and said that I have some problem with a past charge bur wonr let me pay any way, so i cant down load anything please what can i do

    Please i nedd help my account do not let me put any credit card and said that I have some problem with a past charge bur wonr let me pay any way, so i cant down load anything please what can i do

    go to this page and cotact iTunes store and they can help you out with this
    https://expresslane.apple.com/Issues.action

  • I have some problems with my iPhone. Can i change my iphone from USA (ME495LL/A) in Germany? Warranty is ok till october 2014

    I have some problems with my iPhone. Can i change my iphone from USA (ME495LL/A) in Germany? Warranty is ok till october 2014

    No you cannot. The iPhone warranty is only good in the country of purchase. You would need to bring it back to the US, or send it to someone that could take it to an Apple store in the US. Apple will not accept international shipments.

  • Hi every body. I have some problem with my i pad mini's keyboard . After i opened the message icon , suddenly the shape of my keybord has been chenged . I don't know how to fix it? I was wondering if you'd mind helping me.thanks .

    Hi every body. I have some problem with my i pad mini's keyboard . After i opened the message icon , suddenly the shape of my keybord has been chenged . I don't know how to fix it? I was wondering if you'd mind helping me.thanks

    That's so you can text with your thumbs. If it does' tog back together  automatically  put your finger on the tiny typewriter  and you should get a pop up to reconnect keyboard. Or more easily put a finger on each one and pop them together.

  • Hello i have some problems with my macbook pro

    hello i have been having some problems with my macbook pro. for some reason it takes a very long time to turn on and once it gets to the password login it doesnt let me type the password.. but after about an hour or so it lets me log in..

    chrism15_15,
    is Mac OS X 10.6.8 what you currently have installed on your MacBook Pro? Do you still have your two grey installation DVDs which originally came in the box with your MacBook Pro?

Maybe you are looking for


HashFlare