[AS3] Problem of multiple levels.

Hello, well I posted a question on here before and got good reviews.

So, I have another problem, I am doing at several levels for my game, I did 1 level and want to do more, with the more difficult aspects.

In any case, I get this error:

---------------------------------------------------------------

TypeError: Error #2007: hitTestObject parameter must be null.
at flash.display::DisplayObject/_hitTest()
at flash.display::DisplayObject/hitTestObject()
at newball3_fla::MainTimeline/moveBullet()

----------------------------------------------------------------

Yes, this is the code:

----------------------------------------------------------------

Stop();
stage.addEventListener (KeyboardEvent.KEY_DOWN, right);
stage.addEventListener (KeyboardEvent.KEY_DOWN, at left);
stage.addEventListener (KeyboardEvent.KEY_UP, space);

var nextShoot:Boolean = true;
var int Points;


Startbutton var = new startButton();
addChild (startbutton);
startButton.x = 550;
startButton.y = 450;

ball5. Visible = false;
ball5.x = 600;
ball5.y = 600;

startbutton.addEventListener (MouseEvent.MOUSE_DOWN, onClick);

var bulletTimer:Timer = new Timer (800: 1);
bulletTimer.addEventListener (TimerEvent.TIMER, nextBullet);

var checkTargets:Timer = new Timer (100);
checkTargets.addEventListener (TimerEvent.TIMER, checkTarget);
checkTargets.start ();

var player: Shape = new Shape();
player.graphics.beginFill (0x0000FF);
player.graphics.drawCircle (5, 5, 5);
Player.y = 350;
addChild (player);

function nextBullet(event:TimerEvent): void {}
nextShoot = true;
}


function checkTarget(event:TimerEvent): void {}
If (ball.visible == false & & ball2.visible == false & & ball3.visible == false & & ball4.visible == false) {}
checkTargets.stop ();
startButton.Visible = true;
}

}
function onClick(event:MouseEvent):void {}
gotoAndStop (5);
checkTargets.stop ();
}

function right(bmove:KeyboardEvent):void {}
If {(bmove.keyCode is Keyboard.RIGHT)
Player.x += 20
}
};

function left(bmove:KeyboardEvent):void {}
If {(bmove.keyCode is Keyboard.LEFT)
-Player.x = 20
}
};


function space(bmove:KeyboardEvent):void {}
If {(bmove.keyCode is Keyboard.SPACE)

If (nextShoot == true) {}

var ball: ball = new bullet();
Bullet.x = player.x
Bullet.y = player.y
addChild (Bullet);
Bullet.addEventListener (Event.ENTER_FRAME, moveBullet);
nextShoot = false;
bulletTimer.start ();

}
}
};

function moveBullet(e:Event):void {}
e.Target.y-= 10;
If (e.target.y < = - 10) {}
e.target.removeEventListener (Event.ENTER_FRAME, moveBullet);
removeChild (MovieClip (e.target));
} else {}
{if (MovieClip (e.Target) .hitTestObject (ball))}
ball.x = 600;
ball.y = 600;
ball. Visible = false;
= + 100 points
}
{if (MovieClip (e.Target) .hitTestObject (ball2))}
ball2.x = 600;
ball2.y = 600;
ball2. Visible = false;
= + 100 points
}
{if (MovieClip (e.Target) .hitTestObject (ball3))}
ball3.x = 600;
ball3.y = 600;
ball3. Visible = false;
Points = + 100;
}
{if (MovieClip (e.Target) .hitTestObject (ball4))}
ball4.x = 600;
ball4.y = 600;
ball4. Visible = false;
Points = + 100;
}
{if (MovieClip (e.Target) .hitTestObject (ball5))}
ball5.x = 600;
ball5.y = 600;
ball5. Visible = false;
Points = + 100;
}

}
}

-----------------------------------------

I have essentially 1 layer, this is the first image that has the code above, then a keyframe to 5frames, I want it to be to the next level.

I would go further in detail, but I hope that's enough, thank you.

The error seems to indicate that one of the objects you are testing as a parameter of hitTestObject there is not (ball thru ball5).  So see if the names are correctly assigned and be sure that objects exist when this code is treated... something's coming up null.

This is not an error, but saves some coding. When you test the Boolean properties/variables, there is no need to specify == true/false in a conditional...

If (! ball.visible &! ball2.visible &! ball3.visible &! ball4.visible)

Tags: Adobe Animate

Similar Questions

  • Problem with multiple downloads with the router. Allows you to change the TCP MSS value?

    Original title: TCP MSS

    Hi all.

    I currently have a problem with multiple downloads with my current router.  If I have two current downloads at the same time I have no access to all web sites.  It's almost as if the downloads take my meaning of bandwidth there is more nothing for ordinary surfing.

    As a test I put an older router on my system and have a significant improvement in performance.  I have 2 downloads in progress and also surf at the same time.

    To compare two routers, I noticed that the only real difference between the two is that the TCP MSS value is set to '0' on the router of the problem, and then assign him 1392 (MTU - 40) on the router to elderly who gives better performance.

    It is my understanding that this value governs the size of transmitted packets.

    My question is this:

    What is the MSS value which is causing the problem?

    Congratulations in advance.

    Be sure to interpret the values. The '0' means no not literally because the link would not work. It is likely, that it allows the local device set limits for the link. Don't forget that there is a Maximum value and as such can be any value up to such limit as defined by all devices in the path.

    You can try capping manually but it is unlikely that any local limit will come to effect unless you set very low.

  • Problem with the levels in PSE7 adjustment layer

    Hello

    I have a problem with the levels adjustment layer in PSE 7.0. I made this photo that shows exactly as I want it in PSD format, but when I save it in JPG format all adjustment layers are lost. I tried to get the same result by using simple Enhance > > adjustments > > levels, but I cannot get the same result with the same settings as with the adjustment layer.

    How can I solve this?

    I saw in a tutorial that might help add a new layer above the layer of setting and then merge visible layers, but it does not work either.

    I hope someone can help me if I can complete the picture.

    It seems that the problem is that your image size is big enough in comparison to the size of your available screen and you make your settings at roughly 18% view.

    Photoshop elements uses interpolation to show the images on the screen, so you can't really see exactly the result unless you view an image at 100% display (actual pixels)

    If you try to do the steps from the beginning with your image at 100% view, does make a difference?

    (Double-click on the Zoom tool in the Toolbox for 100% view (actual pixels))

  • Problems with multiple worksheets XY plotting (program generates repeated data)

    Hello

    I want to make a small program that will reduce the amount of time to go forward with the measurement data. I get data into .dat format, where all the files consist of frequency measurement with an X and a Y column. The problem is that I made 4 experiments (X column is the same for each experience) with 15 measures file each and more than 500 points of measurement in each file. I would like to make a simple manipulation and this copy that information to a file with same X column and multi-column, later I could use these data with Excel or origin (do it manually, it's frustrating and time consuming).

    At the beginning my program reads the background information with X and Y (b), and after I open the worksheet to insert the X and data of Y (n). (make a simple manipulation, like dividing Y (n) /Y (b), program show a graph of the current data and another graph multiple data, which are stored and must be exported in .txt, .dat or directly to Excel (which is more preferable)). I'm OK with the opening of several files of data, but which are not okay with copy/paste file and handle all that data manually, but that's my motivation for this program.

    The attached example can do all this (except for the entry in the file). He draws multiple charts on a XY chart using cluster and travel records. It is even possible to extract data in Excel, all that graphic, but the real problems comes with data are always added because of the loop. This gives a lot of empty and repeated data later. I'm jonesing to get rid of this. I have also attached several files of measure: 1 background and 3 measures.

    P.S. I tried to save time thanks to this program, but now, I spent more time than if I did it manually

    Your program absolutely no sense. What is the purpose of the structure of sequence? It just sits there, operating both in parallel to the while loop. Probably that you read from the local variables before other parts of the program had a chance to write valid data for them.

    In the while loop, you have a case of timeout that adds the same data over and over again, every 50ms. Why?

    Your mechanical actions "switch release" are misguided. Use actions to latch and remove structures deal as part of the event.

    Try to rethink the problem once the mode, and then solve the problem with 20% of your current code. See how far you get.

  • WTVConverter problem with multiple audio streams...

    The WTVConverter MSFT includes Windows 7 does not correctly handle multiple audio streams. The WTVConverter in the conversion of the format ".wtv' to '.dvrms' instead of keep the main audio stream retains the other stream audio visually impaired. Usually, he keeps the other stream audio visually impaired. NCIS and NCIS Los Angeles, CBS programs have this problem because they include signals SAP (accessibility for blind and partially sighted options)
    How can I tell WTVConverter to include only the main audio instead of the stream audio visually impaired
    Thank you
    Chandra

    Hello, Chandra

    If you think that there should be an option to select a stream when converting, you can leave your comments on the following link:http://mymfe.microsoft.com/Windows%207/Feedback.aspx?formID=195

    In addition, you can try searching for a free replacement program convert WTV files.

    David
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Canon 5 d Mkiii problem with multiple registration.

    Hello.

    I have a CF (32 MB sandisk extreme 60 MB/s) card and an SD card (sandisk 32 GB extreme pro 95 MB/s) inserted and in the menu under the Record func + map section I the func record. Rec. multiple value. My problem is that sometimes my video files are only copied to the SD card and not the CF card although the photo files are saved at the same time.

    Any help would be greatly appreciated.

    Canon 5 d Mkiii 50 mm f/1.4. EF 16-35mm f2.8L II USM.  EF 24-105mm f / 4L IS USM.

    EF 24-70mm f/2.8 L USM. EF 100 mm f/2.8 L Macro USM.  EF 70-200MM f/2.8 L IS USM

    Speedllite 430EX II

    I asked a videographer, a friend and he said...

    You can choose which films of map will be saved to, but there is no excess capacity or ability to mirror

    for movies with the 5 d Mk III.

  • Problems printing multiple 'current page' range of documents.

    -Use of Word 2007 with a printer HP 1300 (Windows VISTA).
    -Select PRINT from the menu.
    -I am trying to print multiple copies of a page using "current page" to the print range.
    -I select the 'number of copies' and click OK, it will only print a copy.
    Which tried it:
    -J' typed in the number manually.
    -J' chose the number using the arrow.
    -J' I pressed ENTER, and I clicked OK
    Each time, just print a copy.

    Hi MaryVL,

     

    Welcome to Microsoft Answers Forums.

    We would like to get more information about you to help solve your problem. You better, please answer the following questions.

    ·         When was the last time it worked?

    ·         Remember to make changes to the computer recently?

    ·         You can print multiple copies using programs windows like Word pad or Notepad?

    First of all, I suggest that you try to print multiple copies using windows programs and check if you are facing similar problems.

    If you are facing this problem with Word 2007 suggest you try the steps in the Microsoft KB article below.

    You cannot print multiple copies of a Word 2007 document

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

    If still cannot print multiple copies using Word 2007 suggest posting your question in the community of desktop application for more support.

    Discussions in Desktop Applications

    http://www.Microsoft.com/Office/Community/en-us/FlyoutOverview.mspx

    Halima S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Problems with multiple monitors for critical update Windows 7

    Since the update critical October 1, I can no longer run multiple monitors.

    According to the record, this update made changes at the same time the driver for my AMD Radeon 7470 and Dell monitor 1.1 card, and I've updated the software.

    Devices for work and when I pass cables or remove cables. Yet they are simply not recognized as connected.

    Hello Kent,

    Thanks for posting your question on the Microsoft community.

    Thank you for details on the issue.

    This problem may occur because of corrupted or incorrect display settings.

    I suggest you run the hardware and devices Troubleshooter and check.
    Reference:
    Open the hardware and devices Troubleshooter
    http://Windows.Microsoft.com/en-us/Windows7/open-the-hardware-and-devices-Troubleshooter

    Please also read this article and check.
    Work and play better with multiple monitors
    http://Windows.Microsoft.com/en-us/Windows7/work-and-play-better-with-multiple-monitors

    I hope this information helps.

    Please let us know if you need more help.

    Thank you

  • Problem Manager multiple selection with system dialog box

    I currently have a problem with the help of system on a manager of multiple selection dialog as the code below works fine:

    multiSelectHandler {
                        status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged
                        actions: [
                            DeleteActionItem {
                                id: deleteActionItem
                                onTriggered: {
                                    var selectionList = listView1.selectionList();
                                    var selectedItem = dataModel.data(selectionList);
                                    console.log(selectedItem);
    
                                    for (var i = 0; i < selectionList.length; ++ i) {
                                        _sql.deleteClient(dataModel.data(selectionList[i]).clientID)
                                        dataSource.loadData()
                                    }
                                }
                            }
                        ]
                    }
    

    However, when it is changed to use that a dialogue system, the feature does not work and the console record results:

    selected list: undefined

    selected item: undefined

    multiSelectHandler {
                        status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged
                        actions: [
                            DeleteActionItem {
                                id: deleteActionItem
                                onTriggered: {
                                    multiSelectDeleteDialog.show()
                                }
                                attachedObjects: [
                                    SystemDialog {
                                        id: multiSelectDeleteDialog
                                        title: qsTr("Delete Clients") + Retranslate.onLocaleOrLanguageChanged
                                        body: qsTr("Are you sure you want to delete these clients?") + Retranslate.onLocaleOrLanguageChanged
                                        onFinished: {
                                            if (result == 3) {
                                                console.log("Cancelled")
                                            } else {
                                                console.log("Deleted")
                                                var selectionList = listView1.selectionList()
                                                console.log("selected list: " + selectionList)
                                                var selectedItem = dataModel.data(selectionList);
                                                console.log("selected item: " + selectedItem);
    
                                                for (var i = 0; i < selectionList.length; ++ i) {
                                                    _sql.deleteClient(dataModel.data(selectionList[i]).clientID)
                                                    dataSource.loadData()
                                                }
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    }
    

    With the help of Roger Leblanc, it works now

    multiSelectHandler {
                        status: listView1.selectionList().length + qsTr(" Clients Selected") + Retranslate.onLocaleOrLanguageChanged
                        actions: [
                            DeleteActionItem {
                                property variant selectionList
                                property variant selectedItem
                                id: deleteActionItem
                                onTriggered: {
                                    deleteActionItem.selectionList = listView1.selectionList()
                                    deleteActionItem.selectedItem = dataModel.data(selectionList);
                                    multiSelectDeleteDialog.show()
                                }
                                attachedObjects: [
                                    SystemDialog {
                                        id: multiSelectDeleteDialog
                                        title: qsTr("Delete Clients") + Retranslate.onLocaleOrLanguageChanged
                                        body: qsTr("Are you sure you want to delete these clients?") + Retranslate.onLocaleOrLanguageChanged
                                        onFinished: {
                                            if (result == 3) {
                                                console.log("Cancelled")
                                            } else {
                                                console.log("Deleted")
    
                                                for (var i = 0; i < deleteActionItem.selectionList.length; ++ i) {
                                                    _sql.deleteClient(dataModel.data(deleteActionItem.selectionList[i]).clientID)
                                                    dataSource.loadData()
                                                }
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    }
    
  • Problem with Multiple Choice Quiz

    I tried several times to insert a multiple choice quiz success in my slides. The problem is that when I try to take the quiz (for a preview), I have to click several times and wait several boxes pop up coming (correct, click anywhere; incorrect, etc.). All these boxes pop up show before he let me go to the next slide. Anyone know what I need to change?

    Are you found using the preview feature in presenter or switch to slide show view (F5) in PPT? Looks like you're watching just PPT presentation, who must play through all the animations on the slide.

    You see the same questions if you publish the presentation on site and view the published version?

  • Major problems with multiple items of page on the web viewer since the last update

    In the last days, we had problems with all our multiple page items that are newly updated or added on the web viewer.

    Scrolling of pages just to repeat content again and again and true articles page see first pages content overlaid on all subsequent pages. It seems that something important broke in the way that the dps push articles to the webviewer, as is happening through fact sheets and articles. This means that we cannot publish anything until it's resolved.

    Someone knows something similar? Any suggestions?

    Hi Lucie,.

    Please contact support for assistance with this enterprise. They can investigate and open a support issue with if necessary engineering team. Contact information is available by logging into http://digitalpublishing.acrobat.com/ and looking at the Middle bottom of the screen.

    Neil

  • Problem of multi-level numbered list

    I have this situation:

    I work in book, with a separate document chapter.

    My chapter number is using digital Roman.

    I want to make my multi-level list (2nd, 3rd level and so forth) use this chapter number, as normal.

    But the result is: IV.1

    Instead, what I want is: 4.1

    Can I convert this digital Roman (IV) normal digital (4)?

    What is alternatives to the list multilevel numbering restarts in each chapter?

    Any help would be appreciated.

    Thank you!

    Check out these 2 points:

    1 the document numbering options:

    Style (Document chapter numbering): must be set up as "1,2,3,4,...» »

    2. variable: chapter number:

    must be set up as "I, II, III, IV,...» »

    When you create your lists at several levels, simply add the chapter number symbol (^ H).

    It must be formatted as seen in point 1.

    Let us know if this solves your problem.

    Vinny

  • Problem with sound levels in the first, on export

    Hi guys.

    I have dealt with some problems in the first, which took place a couple of times in the older versions of first.

    Sound levels are apparently ok in the preview, but then, when you export, the sound levels sometimes have some "ups and downs". It seems that in the first three seconds, and then the audio comes to its normal volume.

    I assume this has something to do with the applied effects (eq, dynamics and sometimes simplistic). Is too much for first to manage?

    Even if I made of audio previews, the end result is the same.

    If I open in soundbooth with direct link, the waveform shows the "vagaries" of the final, even if file in the first levels and waveforms are very good.

    I have a PC, i7, 3, 40GHz, 8 GB of Ram

    Windows 8 Pro 64-bit

    Thank you!

    The Denoiser is infamous for to need some time to "kick" during an export, even when he plays back perfect in PP.

    I would recommend this effect to jump and do these work in Audition or Soundbooth instead.

  • Problem with multiple display devices

    Hello

    I've recently upgraded to Adobe CC and I am trying to configure Edge inspect on my iPad and iPhone.

    I added two devices defined in the instructions, but when I try and get an overview of these two devices, I get the following message:

    Use of multiple devices is a feature of the version complete edge inspect. Upgrade now to connect several devices simultaneously.

    Does this mean I have to buy another upgrade to allow multiple devices to be viewed?

    Any help appreciated.

    see you soon,

    Blue-insurance

    Inspect edge has two pricing options, a free version, which only allows one device to connect to both, and a full version that allows an unlimited number of devices to be connected simultaneously. If you are already subscribed to the full version of edge inspect try to connect log out of the application of edge inspect and then again to solve the problem.

  • Problem with multiple threads

    I have a program that interacts with an ESX 3.5 server using the VIX API, written in c#. I'm from multiple threads in c# program with each thread running an automation process which creates a connection to a virtual machine on the ESX Server, some automated process, and then disconnects. I'm having problems with this. When I call Disconnect() from one of the threads, it seems to cause problems with my other son if they have not yet disconnected. I connect to an another VM on the server in each thread. The problem is if I don't call disconnect, I get errors, but if I call disconnect in a thread it causes errors. Y at - it something similar? Any suggestions on how to make this run smoothly? Thank you!

    This sounds a lot like you are getting hurt by the host sharing of handle.  If HostConnect() is called with the same parameters, the handle of the host gets reused.  HostDisconnect() will clean this handle, even if his commune.  It's actually documented behaivior.  We have also decided that there may problems like the one you have reached, so it will be removed in a future release.

    So your application will share the handful of host among all discussions, and as soon as we call disconnection, the host handles in other countries also becomes invalid.

    Make a unique HostConnect() and share this handle inside threads is a way to avoid this.  HostConnect() is generally quite expensive, so we recommend in all cases.

Maybe you are looking for

  • Question on the percentage of meter works - M40X-119

    I have problem on the battery indicator, when I plug in AC, charge indicator power off batteries decreases too quickly to 7, but when it comes to 7, it does not change until about 2 pm. So there is no problem on my battery I think. No matter what sof

  • MacBook pro battery life

    My macbook pro is less than one year: A 7-9 hours of battery life 8 months ago now the battery life is less than 3 hours (if any). Currently, 48% autonomy translates to 50 minutes of life. EL Capitan 10.11.3 OSX Keep, 15 inch, mid-2014 In safe mode t

  • How can I determine the executable version number?

    Hello. I have a VI and a specification to build for her.  In the Version of the specification to build information section, I updated the version number auto-increment.  I want to view the version number on an indicator on the front of the executable

  • How can I get my fitbit to run on windows 7

    I got a fitbit for my birthday and I'm having a difficult time downloading the software. Can anyone help me get this thing on a windows device 7.

  • boring hard to read shadow text

    Can you help me remove the boring hard to read text behind the text shadows