![]() |
|
||||||||||
|
|||||
|
Регистрация: Dec 2003
Сообщений: 347
|
Думаю понятно, про что я веду речь.
Draw = MovieClip.prototype;
Draw.createRect = function(x, y, w, h, _color, _fill) {
this._x = x;
this._y = y;
this.beginFill(_fill, 100);
this.lineStyle(.1, _color, 100);
this.lineTo(w, 0);
this.lineTo(w, h);
this.lineTo(0, h);
this.endFill();
};
_root.createEmptyMovieClip("thickness", 26100);
_root.thickness.createRect(279, 352, 38, 38, 0xDDEEFF, 0x445566);
_root.thickness.onPress = function() {
for (q=0; q<3; q++) {
_root.old_thick = _root._thick;
_root.createEmptyMovieClip("btn"+q, 10+q);
_root["btn"+q].createRect(279, 310-40*q, 38, 38, 0xDDEEFF, 0x445566);
_root["btn"+q]._thick = q*5;
_root["btn"+q].onRollOver = function() {
_root._thick = this._thick;
trace(this._thick);
};
_root["btn"+q].onRollOut = function() {
_root._thick = _root.old_thick;
};
}
};
_root.thickness.onRelease = function() {
for (w=0; w<3; w++) {
_root["btn"+w].removeMovieClip();
}
};
_root.thickness.onReleaseOutside = function() {
for (w=0; w<3; w++) {
_root["btn"+w].removeMovieClip();
}
};
).Проблема: Не срабатывают функции onRollOver и onRollOut при нажатой кнопке мыши. И можно ли как-нибудь последние две функции (onRelease и onReleaseOutside) объединить в одну. Помогите плз.
__________________
[GIN] |
|
|||||
|
нажал, держишь, не отпускаешь - этим перекрываеш все event'ы других ... попробуй исспользовать таймер...
__________________
file-> new-> F9 -> Ctrl+v/*code*/ ->ctrl+enter |
|
|||||
|
вариант
Draw = MovieClip.prototype;
Draw.createRect = function(x, y, w, h, _color, _fill) {
this._x = x;
this._y = y;
this.beginFill(_fill, 100);
this.lineStyle(.1, _color, 100);
this.lineTo(w, 0);
this.lineTo(w, h);
this.lineTo(0, h);
this.endFill();
};
_root.createEmptyMovieClip("thickness", 26100);
_root.thickness.createRect(279, 352, 38, 38, 0xDDEEFF, 0x445566);
_root.thickness.onPress = function() {
for (q=0; q<3; q++) {
_root.old_thick = _root._thick;
_root.createEmptyMovieClip("btn"+q, 10+q);
_root["btn"+q].createRect(279, 310-40*q, 38, 38, 0xDDEEFF, 0x445566);
_root["btn"+q]._thick = q*5;
_root["btn"+q].onMouseMove = function() {
with(this){
if(hitTest(_parent._xmouse,_parent._ymouse,1)){
_root._thick = _thick;
trace(_thick);
}else {
_root._thick = _root.old_thick;
}
}
}
}
};
_root.thickness.onRelease = _root.thickness.onReleaseOutside =function() {
for (w=0; w<3; w++) {
_root["btn"+w].removeMovieClip();
}
};
|
![]() |
Часовой пояс GMT +4, время: 15:13. |
|
|
« Предыдущая тема | Следующая тема » |
|
|