🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.pl.programy.flash-5
Article #33891

Re: Nienawidze F1! Jak dodac volume control?

#33891
From: Devoth
Date: Thu, 15 Feb 2007 20:14
65 lines
2981 bytes
Mr.Jack napisał(a):
> Devoth wrote:
>> Mr.Jack napisał(a):
>>
>>> I teraz dorobilem sobie 2 mc play i pause. W zwiazku z tym dodalem 1
>>> klatke (w sumie mam 2 i 3 warstwy). Stopowi dalem:
>>>
>> Po co te dodatkowe klatki itd?
>> Ogólnie co ma się dziać, tak po kolei, bo jakoś nie mogę wywnioskować
>> na szybko :)
> 
> http://www.oxygencreations.com/muzyka.fla
> 
> Chcialem dorobic mozliwosc wylaczenia i wlaczenia muzyki. Kierowalem sie tym 
> tutorialem: http://www.entheosweb.com/Flash/flash_sound_button.asp , jednak 
> czesciowo zrobilem to inaczej, nie chcac psuc tego co  bylo wczesniej.
> 
> I tak jak mowie, po kliknieciu w STOP, a nastepnie PLAY (kwadrat, strzalka), 
> kolko z suwaka przesuwa sie w prawo.

przesuwa się z prostej przyczyny - ponownie przechodzisz do 1 klatki i 
ponownie odpala się:
volume_mc._x += 40;

Jeśli chodzi o tutoriale to staraj się brać z nich tylko to co jest 
naprawdę potrzebne. Tutaj potrzebne było stopAllSounds (chociaż tak 
naprawdę to nie jest to czego szukasz, bo przecież nie chcesz wyłączyć 
_wszystkich_ dźwięków, tylko ten jeden).

Wywal wszystko z drugiej klatki, oraz wszystkie akcje z przycisku stop.
i na pierwszej klatce dorzuć:

[AS]
// inicjujemy zmienną któa mówi
// czy dzwięk jest aktualnie odgrywany
isPlaying = true;
[/AS]

a potem

[AS]
// przycisk kontrolujący odgrywanie
soundstop.onPress = function () {
   if(isPlaying){
     song_sound.stop();
   }else{
     song_sound.start();
   }
   isPlaying = !isPlaying;
}
[/AS]

lub krócej
[AS]
soundstop.onPress = function () {
   isPlaying?song_sound.stop():song_sound.start();
   isPlaying = !isPlaying;
}
[/AS]

-- 
pozdrawiam
Devoth
Questions? - Do not hesitate to ask!
www.devoth.pl || www.devoth.com (eng. version)
Technical Details
Message-ID: <er2eum$p9q$1@news.lublin.pl>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!lublin.pl!news.lublin.pl!not-for-mail
References: <er25rj$jg4$1@atlantis.news.tpi.pl> <er2674$ksg$1@atlantis.news.tpi.pl> <er27v9$gqa$1@news.lublin.pl> <er299e$1dl$1@nemesis.news.tpi.pl> <er29uo$2tf$1@nemesis.news.tpi.pl> <er2a3h$711$1@atlantis.news.tpi.pl> <er2ca3$8b5$1@nemesis.news.tpi.pl> <er2cj8$mhg$1@news.lublin.pl> <er2ddj$anq$1@nemesis.news.tpi.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.nask.pl!news.nask.org.pl!lublin.pl!news.lublin.pl!not-for-mail
From: Devoth <MojAdresJestNaMojejWWW--www.devoth.pl--asfdsf@dasd.pl>
Newsgroups: alt.pl.programy.flash-5
Subject: Re: Nienawidze F1! Jak dodac volume control?
Date: Thu, 15 Feb 2007 21:14:15 +0100
Organization: lubman
Lines: 65
Message-ID: <er2eum$p9q$1@news.lublin.pl>
References: <er25rj$jg4$1@atlantis.news.tpi.pl> <er2674$ksg$1@atlantis.news.tpi.pl> <er27v9$gqa$1@news.lublin.pl> <er299e$1dl$1@nemesis.news.tpi.pl> <er29uo$2tf$1@nemesis.news.tpi.pl> <er2a3h$711$1@atlantis.news.tpi.pl> <er2ca3$8b5$1@nemesis.news.tpi.pl> <er2cj8$mhg$1@news.lublin.pl> <er2ddj$anq$1@nemesis.news.tpi.pl>
NNTP-Posting-Host: host-86-63-144-100.pronet.lublin.pl
Mime-Version: 1.0
X-Trace: news.lublin.pl 1171570454 25914 86.63.144.100 (15 Feb 2007 20:14:14 GMT)
X-Complaints-To: abuse@news.lublin.pl
NNTP-Posting-Date: Thu, 15 Feb 2007 20:14:14 +0000 (UTC)
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
In-Reply-To: <er2ddj$anq$1@nemesis.news.tpi.pl>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit