Creat HitTestObject Actionscript 3.0

Okay, this time on the basis of using hitTest Object. HitTestObject script is a script to detect the collision of an incident in which two objects touch each other. For more details see the following script:
1. Make two objects with a movie clip instance name "mc_box" and "mc_oval".
2. Later in the frame 1 press F9 to activate the actionscript window.
3. Then type the following script:
addEventListener (Event.ENTER_FRAME, collision);
function collision (event: Event): void {
     if (mc_box.hitTestObject (mc_oval)) {
           trace ("ouchh"); // <- Displays the message "ouchh"}
     }
}
4. Run the program (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