![]() |
|
||||||||||
|
|||||||
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | Опции просмотра |
|
![]() |
![]() |
|
|||||
|
Регистрация: Feb 2008
Сообщений: 890
|
Т.е. работают по разному?!
![]()
__________________
скриптограф |
|
|||||
|
Нуб нубам
модератор форума
Регистрация: Jan 2006
Адрес: Бердск, НСО
Сообщений: 6,445
|
А где Вы нашли startDrag(mc) ? ))))
__________________
Reality.getBounds(this); |
|
|||||
|
Регистрация: Feb 2008
Сообщений: 890
|
startDrag function
startDrag(target:Object, [lock:Boolean, left:Number, top:Number, right:Number, bottom:Number]) : Void Makes the target movie clip draggable while the movie plays. Only one movie clip can be dragged at a time. After a startDrag() operation is executed, the movie clip remains draggable until it is explicitly stopped by stopDrag() or until a startDrag() action for another movie clip is called. Availability: ActionScript 1.0; Flash Player 4 Parameters target:Object - The target path of the movie clip to drag. lock:Boolean [optional] - A Boolean value specifying whether the draggable movie clip is locked to the center of the mouse position (true ) or locked to the point where the user first clicked the movie clip (false ). left,top,right,bottom:Number [optional] - Values relative to the coordinates of the movie clip's parent that specify a constraint rectangle for the movie clip. Example The following example creates a movie clip, pic_mc, at runtime that users can drag to any location by attaching the startDrag() and stopDrag() actions to the movie clip. An image is loaded into pic_mc using the MovieClipLoader class. var pic_mcl:MovieClipLoader = new MovieClipLoader();
pic_mcl.loadClip("http://www.helpexamples.com/flash/images/image1.jpg",
this.createEmptyMovieClip("pic_mc", this.getNextHighestDepth()));
var listenerObject:Object = new Object();
listenerObject.onLoadInit = function(target_mc) {
target_mc.onPress = function() {
startDrag(this);
};
target_mc.onRelease = function() {
stopDrag();
};
};
pic_mcl.addListener(listenerObject);
__________________
скриптограф |
|
|||||
|
Нуб нубам
модератор форума
Регистрация: Jan 2006
Адрес: Бердск, НСО
Сообщений: 6,445
|
Так, и в чем Вы увидели разницу? Этот вариант - с использованием глобального метода, а не метода класса MovieClip. У меня работает совершенно одинаково в этом примере что startDrag(this); что this.startDrag();
__________________
Reality.getBounds(this); |
|
|||||
|
loading 50%
|
Разница в синтаксисе - this.startDrag(); - в 4 плеере не работал. startDrag(this); - Оставлен в 5 и up для обратной совместимости. Также как и все setProperty.
Последний раз редактировалось aksios; 19.10.2008 в 13:02. |
|
|||||
|
Регистрация: Feb 2008
Сообщений: 890
|
Цитата:
т.е. при замене строчки mc.startDrag(); на строчку startDrag(mc); получается совсем не то, что ожидалось...))
__________________
скриптограф |
|
|||||
|
Нуб нубам
модератор форума
Регистрация: Jan 2006
Адрес: Бердск, НСО
Сообщений: 6,445
|
Цитата:
__________________
Reality.getBounds(this); |
|
|||||
|
Регистрация: Feb 2008
Сообщений: 890
|
могу куда-нибудь скинуть, если интересно..)) просто нет времени сейчас резать скрипты, чтобы в форум доступно выложить..))
__________________
скриптограф |
![]() |
![]() |
Часовой пояс GMT +4, время: 19:32. |
|
|
« Предыдущая тема | Следующая тема » |
|
|