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

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

Версия для печати  Отправить по электронной почте    « Предыдущая тема | Следующая тема »  
Опции темы Опции просмотра
 
Создать новую тему Ответ
Старый 11.01.2007, 13:58
sweetlove вне форума Посмотреть профиль Отправить личное сообщение для sweetlove Посетить домашнюю страницу sweetlove Найти все сообщения от sweetlove
  № 1  
Ответить с цитированием
sweetlove
[+1.3 16.10.07]
[+4 12.03.08]
 
Аватар для sweetlove

Регистрация: Oct 2006
Адрес: saint-petersburg
Сообщений: 63
Отправить сообщение для sweetlove с помощью ICQ
Attention Проблема с регулятором звука.

Уважаемые Гуру.
Помогите пожалуйста блондинке.
Подскажите что нужно добавить в код, чтоб бегунок на регуляторе звука находился в положении уровня громкокости звука при загрузке , а не на нуле.
Код:
 // //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.
Старый 11.01.2007, 15:13
Kikasso вне форума Посмотреть профиль Отправить личное сообщение для Kikasso Найти все сообщения от Kikasso
  № 2  
Ответить с цитированием
Kikasso
 
Аватар для Kikasso

Регистрация: Oct 2006
Адрес: spb.ru
Сообщений: 3,221
Я не гуру но посоветую:
Код:
<ползунок>._y = _root.thisSound.getVolume()*_root.mySliderBar._height/100
И кстати тема скоро переедет.. из-за on() и onClipEvent()

исправлено: конечно thisSound, а не mySound


Последний раз редактировалось Kikasso; 11.01.2007 в 15:42.
Старый 11.01.2007, 15:32
toFlash вне форума Посмотреть профиль Отправить личное сообщение для toFlash Найти все сообщения от toFlash
  № 3  
Ответить с цитированием
toFlash
 
Аватар для toFlash

блогер
Регистрация: Oct 2003
Адрес: Калининград
Сообщений: 202
Записей в блоге: 4
Код:
//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);
_y = _root.thisSound.getVolume()*_root.mySliderBar._height/100
__________________
flash portfolio


Последний раз редактировалось toFlash; 11.01.2007 в 15:35.
Старый 11.01.2007, 19:14
sweetlove вне форума Посмотреть профиль Отправить личное сообщение для sweetlove Посетить домашнюю страницу sweetlove Найти все сообщения от sweetlove
  № 4  
Ответить с цитированием
sweetlove
[+1.3 16.10.07]
[+4 12.03.08]
 
Аватар для sweetlove

Регистрация: Oct 2006
Адрес: saint-petersburg
Сообщений: 63
Отправить сообщение для sweetlove с помощью ICQ
Огромное спасибо!!
А не подскажите, что надо использовать мимо on() и onClipEvent()?

Старый 11.01.2007, 19:30
Kikasso вне форума Посмотреть профиль Отправить личное сообщение для Kikasso Найти все сообщения от Kikasso
  № 5  
Ответить с цитированием
Kikasso
 
Аватар для Kikasso

Регистрация: Oct 2006
Адрес: spb.ru
Сообщений: 3,221
примерно так:
Код:
клип.onLoad = function(){...}
кнопка.onRelease = function(){...}
это пишется на таймлайне, в кадре.
посмотри в хелпе про события кнопок и клипов, там с примерчиками.

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

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

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


 


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


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