Portal
 
 
 FAQ  •  Search  •  Preferences  •  Usergroups  •  Register  •  Profile  •  Log in to check your private messages  •  Log in
 
 
View next topic
View previous topic

Post new topicReply to topic View previous topicEmail to a Friend.List users that have viewed this topicSave this Topic as filePrintable versionLog in to check your private messagesView next topic
Author Message
kasselbiddy



Age: 41
Joined: 24 May 2012
Posts: 14

blank.gif
PostPosted: Mon Sep 03, 2012 6:47 pm  Post subject:  How to Set Volume in Flash Reply with quoteBottom of PageBack to top


Here is how you go about setting the volume of sound in Flash. There are two ways of setting volume, either on a per-channel basis or globally across all channels. Besides, here is a tutorial about how to convert SWF to MOV on Mac with a Mac SWF to MOV converter.
Image

Before we dive in it is worth taking a quick look at the four main classes used when manipulating sound in Actionscript 3.0.

* Sound
An object representing an individual sound. This may be a sound effect or music loop.
* SoundChannel
A channel which plays a single Sound object.
* SoundTransform
Class used to manipulate the volume and/or panning of a sound.
* SoundMixer
A class containing static methods for controlling the global output of sound in a SWF.

Setting the volume of an individual sound
We can set the volume of a single sound channel at two distinct occasions, when the SoundChannel is instantiated as a result of calling the play method of a Sound instance, or we can alter the volume of an already existing SoundChannel.

Volume is set via an instance of the SoundTransform class. A SoundTransform instance is simply applied to the soundTransform property of a SoundChannel. Here we apply a SoundTransform instance with a volume of 0.5 to an existing SoundChannel called myMusicSoundChannel.

myMusicSoundChannel.soundTransform = new SoundTransform(0.5);

Note the volume value is specified as a number between 0 (silent) and 1 (full volume).

Next we set the volume of a SoundChannel during it’s initialization. The Sound instance, mySound, is set to play a single time with a volume of 0.5.

var mySoundChannel:SoundChannel = mySound.play( 0, 0, new SoundTransform(0.5) );
Setting volume globally

Setting the global volume of sound in your SWF is very similar to setting the volume of a single sound. The main difference is that we aren’t manipulating a single SoundChannel instance, rather we use the SoundMixer class.

SoundMixer.soundTransform = new SoundTransform(0.5);





Last edited by kasselbiddy on Sun Dec 15, 2013 11:14 pm; edited 1 time in total
Aquarius Gender:Female Pig OfflinePersonal Gallery of kasselbiddyView user's profileSend private message
ivy00135
Currently banned




Joined: 06 Nov 2012
Posts: 49808

blank.gif
PostPosted: Wed Nov 07, 2012 5:30 pm  Post subject:  (No subject) Reply with quoteBottom of PageBack to top

牛小弟牛排
櫥窗滷味
天才老媽雙蛋蚵仔煎
爆米花
法式可樂餅
鹽水意麵
高雄酒店經紀
豬心冬粉
林家水餃
阿賢料理
光華木瓜牛奶大王
輝哥鱔魚意麵
酒店經濟
亞培湯包蒸餃
阿六鱔魚麵
孬味香菇肉羹
萬里羊肉店
屏東豬腳
劉易記牛肉刀削麵
酒店小姐
高雄酒店經紀
星座運勢2012
星座配對2012
牡羊座2012年星座運勢
金牛座2012年星座運勢
雙子座2012年星座運勢
巨蟹座2012年星座運勢
獅子座2012年星座運勢
處女座2012年星座運勢
天秤座2012年星座運勢
天蠍座2012年星座運勢
射手座2012年星座運勢
魔羯座2012年星座運勢
水瓶座2012年星座運勢
雙魚座2012年星座運勢


   OfflinePersonal Gallery of ivy00135View user's profileSend private message
Display posts from previous:      
Post new topicReply to topic View previous topicEmail to a Friend.List users that have viewed this topicSave this Topic as filePrintable versionLog in to check your private messagesView next topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum



RSS Feed


Board Security

294139 Attacks blocked
Powered by phpBB2 Plus, phpBB Styles and Kostenloses Forum based on phpBB © 2001/6 phpBB Group
FI Theme :: Mods and Credits :: All times are GMT - 8 Hours