![]() |
|
||||||||||
|
|||||
|
[+1.3 16.10.07]
[+4 12.03.08] |
Уважаемые Гуру.
Помогите пожалуйста блондинке. Подскажите что нужно добавить в код, чтоб бегунок на регуляторе звука находился в положении уровня громкокости звука при загрузке , а не на нуле. // //This button is both a movie clip and a button, because it
//needs to respond as a button and it also needs to slide.
//To do this, you need to have it as a button in the symbol
// library, then assign it as a movie clip instance in the
//properties box.
onClipEvent(load){
//myY is the position of the slider button
//the button must be positioned at the bottom
//of the slider to start
myY=_y;
//the top of the slider bar is top
top=_y-_root.mySliderBar._height;
//the bottom of the slider bar is bottom, and it
//is set by the position of the button, which must
//be placed at the bottom.
bottom= _y;
//right and left are the _x position of the button
//(the middle of the button)
right=_x;
left=_x;
//set the volume to off. thisSound is created in the
//action script in frame one, and needs to be targeted
//by using the word "_root" in front of it.
_root.thisSound.setVolume(80);
}
//The following lines allow the button/movie clip to be
//dragged, but only up and down and only for the
//height of the slider. Left and right are set to the
//same value, so it cannot go left or right, only up and
//down.
on(press){
startDrag("",false,left,top,right,bottom);
}
on(release){
stopDrag();
//the volume is a number between zero and 100 and
//represents the difference between the bottom of
//the slider and the current position of the button
//times the ratio of the full volume (100) to the
//height of the slider bar. This gives a value of
//100 when the slider button is at the top of the
//slider bar, and adjusts the volume correctly for
//every position in between the top and the bottom.
_root.thisSound.setVolume((myY-_y)*100/_root.mySliderBar._height);
}
Чтоб было наглядней, Флешку можно увидеть здесь: http://kataliz.spb.ru/autonata.html Заранее спасибо ![]() Последний раз редактировалось sweetlove; 11.01.2007 в 14:01. |
|
|||||
|
Регистрация: Oct 2006
Адрес: spb.ru
Сообщений: 3,221
|
Я не гуру но посоветую:
И кстати тема скоро переедет.. из-за on() и onClipEvent() исправлено: конечно thisSound, а не mySound Последний раз редактировалось Kikasso; 11.01.2007 в 15:42. |
|
|||||
|
__________________
flash portfolio Последний раз редактировалось toFlash; 11.01.2007 в 15:35. |
|
|||||
|
[+1.3 16.10.07]
[+4 12.03.08] |
Огромное спасибо!!
А не подскажите, что надо использовать мимо on() и onClipEvent()? |
|
|||||
|
Регистрация: Oct 2006
Адрес: spb.ru
Сообщений: 3,221
|
примерно так:
это пишется на таймлайне, в кадре. посмотри в хелпе про события кнопок и клипов, там с примерчиками. |
![]() |
![]() |
Часовой пояс GMT +4, время: 16:58. |
|
|
« Предыдущая тема | Следующая тема » |
|
|