Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 3.0 (http://www.flasher.ru/forum/forumdisplay.php?f=83)
-   -   Настройка громкости (http://www.flasher.ru/forum/showthread.php?t=187389)

Telv 18.11.2012 23:33

Настройка громкости
 
Не могу установить уровень громкости в приложении по прослушиванию радиостанций.
Пишет ошибку:
Код:

Монтажный кадр 1, слой "AS", кадр 1, строка 6        1061: Обращение к возможно неопределенному методу setVolume через ссылку статического типа flash.media:Sound.

Сам код:
Код AS3:

var snd:Sound = new Sound();
var channel:SoundChannel = new SoundChannel();
var req:URLRequest = new URLRequest();
var context:SoundLoaderContext = new SoundLoaderContext(3000,false);
var play_url:String;
snd.setVolume(50);
 
 
/*-------------------Слушатели-------------------*/
radio1.addEventListener(MouseEvent.CLICK, play1);
radio2.addEventListener(MouseEvent.CLICK, play2);
radio3.addEventListener(MouseEvent.CLICK, play3);
radio4.addEventListener(MouseEvent.CLICK, play4);
radioStop.addEventListener(MouseEvent.CLICK, radioSt);
radioPlay.addEventListener(MouseEvent.CLICK, radioPl);
 
 
/*-------------------Радиостанция 01-------------------*/
function play1(e:MouseEvent):void
{
        play_url = 'http://stream.epicradio.co.uk:8000/live';
    playSound(play_url);
    name_txt.text="Epic"
        radioPlay.visible=false;
        radioStop.visible=true;
}
 
 
/*-------------------Функция воспроизведения-------------------*/
function playSound(station:String)
{
        channel.stop();
        req.url = station;
        snd = new Sound();
        snd.load(req, context);
        channel = snd.play();
}
 
/*-------------------Кнопка "Стоп"-------------------*/
function radioSt(e:MouseEvent):void
{
        channel.stop();
        radioPlay.visible=true;
        radioStop.visible=false;
}
 
/*-------------------Кнопка "Плей"-------------------*/
 
function radioPl(e:MouseEvent):void
{
    playSound(play_url); // адрес будет взят из глобальной переменной play_url
        radioPlay.visible=false;
        radioStop.visible=true;
}




Кто-нибудь может сказать, что я делаю не так?

GBee 18.11.2012 23:48

http://help.adobe.com/ru_RU/as3/dev/...0204-7d1f.html

Telv 19.11.2012 01:19

спасибо, разобрался :)


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

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