Create HitTestObject

In addition hitTestObject script, there is also a script hitTestPoint used to detect the point of registration points on the object.

Following
the writing of the script:

1. Suppose that in the previous post Basics Using HitTestObject, there are two movie clip object is "mc_box" and "mc_oval".
2. Type the following script in frame 1.

addEventListener (Event.ENTER_FRAME, collision);
collision function (event: Event): void {
       if (mc_box.hitTestPoint (mc_oval.x, mc_oval.y)) {// detect any collision
             trace ("collision successfully");
       }
}
3. Running the program by pressing Ctrl + Enter.

0 komentar:

Posting Komentar

Free Flash TemplatesRiad In FezFree joomla templatesAgence Web MarocMusic Videos OnlineFree Website templateswww.seodesign.usFree Wordpress Themeswww.freethemes4all.comFree Blog TemplatesLast NewsFree CMS TemplatesFree CSS TemplatesSoccer Videos OnlineFree Wordpress ThemesFree CSS Templates Dreamweaver