Форум 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=144655)

Vetal123 17.09.2010 16:38

помогите пожалуйста со скриптом
 
Доброго времени суток!
Вот я здесь по какому поводу,есть скрипт на плеер интернет радио.И основная проблема вот в чем,я хочу сделать так,что б радио воспроизводилось сразу же после того как человек зайдет на его страницу ненажымая на кнопочку плей.Если кто то поможет с ним,то буду очень признателен.
Код AS3:

volume_mc.gotoAndStop("5"); 
play_mc.id=0;
 
play_mc.onRollOver = function(){ //
        if(this.id==0){
                this.gotoAndStop("2");
        }
        if(this.id==1){
                this.gotoAndStop("4");
        }
}
play_mc.onRollOut = function(){
        if(this.id==0){
                this.gotoAndStop("1");
        }
        if(this.id==1){
                this.gotoAndStop("3");
        }
}
 
play_mc.onRelease = function(){
        if(this.id==0){
                _root.time_mc.alltime = 0;
                _root.mySound = new Sound();
                _root.mySound.loadSound("http://sevenskies.ru:9000/sevenskies128", true);
                _root.mySound.start();
                _root.procent_mc.myInt = setInterval(_root.procent, 500);
                _root.time_mc.myInt = setInterval(_root.timer, 1000);
                this.gotoAndStop("3");
                _root.polosa_mc.gotoAndPlay("2");
                this.id=1;
                return;
        }
        if(this.id==1){
                _root.procent_mc.procent_txt = "00%";
                _root.time_mc.time_txt = "0.00";
                clearInterval(_root.procent_mc.myInt);
                delete _root.mySound;
                clearInterval(_root.time_mc.myInt);//
                this.id=0;
                this.gotoAndStop("1");
                _root.polosa_mc.gotoAndStop("1");
                return;
        }
}
 
volume_mc.onRelease = function(){
        _root.volume_s(this._xmouse);
        this.gotoAndStop(Math.ceil(this._xmouse/5));
}
 
function procent(){
        if(mySound.duration){
                procent_mc.procent_txt = ""+Math.ceil((mySound.position/mySound.duration)*100)+"%";
        }
}
function timer(){
        if(play_mc._currentframe == 3){
                time_mc.alltime++;
                time_mc.minuty=Math.floor(time_mc.alltime/60);
                time_mc.sekundy=time_mc.alltime-(Math.floor(time_mc.alltime/60)*60);
                if(time_mc.sekundy<10){
                        time_mc.time_txt=""+time_mc.minuty+"."+"0"+time_mc.sekundy;
                }
                if(time_mc.sekundy>=10){
                        time_mc.time_txt=""+time_mc.minuty+"."+time_mc.sekundy;
                }
        }
}
 
function volume_s(xclick){
        if(xclick<5){
                mySound.setVolume(0);
        }
        else{
                mySound.setVolume(xclick*5);
        }
}


easy.proger 17.09.2010 16:46

а причем тут раздел AS3 ?

по делу
Код AS1/AS2:

// после 
volume_mc.gotoAndStop("5");
play_mc.id=0;
// вставить это
_root.time_mc.alltime = 0;
_root.mySound = new Sound();
_root.mySound.loadSound("http://sevenskies.ru:9000/sevenskies128", true);
_root.mySound.start();
_root.procent_mc.myInt = setInterval(_root.procent, 500);
_root.time_mc.myInt = setInterval(_root.timer, 1000);
play_mc.gotoAndStop("3");
_root.polosa_mc.gotoAndPlay("2");
play_mc.id=1;


etc 17.09.2010 16:51

Название темы не отражает сути вопроса.
Раздел выбран неверно.


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

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