Форум Flasher.ru
Ближайшие курсы в Школе RealTime
Список интенсивных курсов: [см.]  
  
Специальные предложения: [см.]  
  
 
Блоги Правила Справка Пользователи Календарь Поиск рулит! Сообщения за день Все разделы прочитаны
 

Вернуться   Форум Flasher.ru > Flash > ActionScript 1.0/2.0

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему Закрытая тема
Старый 20.04.2012, 10:35
Гадиров Закир вне форума Посмотреть профиль Отправить личное сообщение для Гадиров Закир Найти все сообщения от Гадиров Закир
  № 1  
Гадиров Закир
 
Аватар для Гадиров Закир

Регистрация: Mar 2012
Сообщений: 8
Post hit test

Здраствуйте форумчане
Что такое hit test, как и где его использовать ?

Старый 20.04.2012, 10:54
Tails вне форума Посмотреть профиль Отправить личное сообщение для Tails Найти все сообщения от Tails
  № 2  
Tails
 
Аватар для Tails

блогер
Регистрация: Dec 2008
Адрес: г. Чебоксары
Сообщений: 2,259
Записей в блоге: 6
из хелпа:

Цитата:
hitTest (MovieClip.hitTest method)
public hitTest() : Boolean

Evaluates the movie clip to see if it overlaps or intersects with the hit area that the target or x and y coordinate parameters identify.

Usage 1: Compares the x and y coordinates to the shape or bounding box of the specified instance, according to the shapeFlag setting. If shapeFlag is set to true, only the area actually occupied by the instance on the Stage is evaluated, and if x and y overlap at any point, a value of true is returned. This evaluation is useful for determining if the movie clip is within a specified hit or hotspot area.

Usage 2: Evaluates the bounding boxes of the target and specified instance, and returns true if they overlap or intersect at any point.

Parametersx: Number The x coordinate of the hit area on the Stage. y: Number The y coordinate of the hit area on the Stage. The x and y coordinates are defined in the global coordinate space. shapeFlag: Boolean A Boolean value specifying whether to evaluate the entire shape of the specified instance (true), or just the bounding box (false). This parameter can be specified only if the hit area is identified by using x and y coordinate parameters. target: Object The target path of the hit area that may intersect or overlap with the movie clip. The target parameter usually represents a button or text-entry field.

Availability: ActionScript 1.0; Flash Player 5

Returns
Boolean - A Boolean value of true if the movie clip overlaps with the specified hit area, false otherwise.

Example
The following example uses hitTest() to determine if the circle_mc movie clip overlaps or intersects the square_mc movie clip when the user releases the mouse button:

square_mc.onPress = function() {
this.startDrag();
};
square_mc.onRelease = function() {
this.stopDrag();
if (this.hitTest(circle_mc)) {
trace("you hit the circle");
}
};
Метод муви клипа, определяющий его пересечение с другими объектами/точками
__________________
Дети не должны знать о своих родителях

Старый 20.04.2012, 11:03
mooncar вне форума Посмотреть профиль Отправить личное сообщение для mooncar Найти все сообщения от mooncar
  № 3  
mooncar
Модрон-ветеринар
 
Аватар для mooncar

администратор
Регистрация: May 2009
Адрес: г.Казань
Сообщений: 7,357
Отправить сообщение для mooncar с помощью ICQ Отправить сообщение для mooncar с помощью Skype™
Название темы не раскрывает сути вопроса. Закрыто.
__________________
Идите первым!

Создать новую тему Закрытая тема Часовой пояс GMT +4, время: 03:47.
Быстрый переход
  « Предыдущая тема | Следующая тема »  
Опции темы
Опции просмотра

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.


 


Часовой пояс GMT +4, время: 03:47.


Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2024, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.