Some Sound Not Playing?
I have a flash file that someone else created. It has music and narration.
When previewing movie on local machine, everything thing works fine. On a web server, the narration does not play (or at least we can't hear it).
I am wondering if the problem is this little bit of code in the html page that plays the movie? Our servers are LAMP, and as far as I know, do not run vb script. Is that the problem?
Thanks in advance!
Here is the code I am wondering about:
Code:
<script language="VBScript" type="text/vbscript">
<!-- // Visual basic helper required to detect Flash Player ActiveX control version information
Function VBGetSwfVer(i)
on error resume next
Dim swControl, swVersion
swVersion = 0
set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i))
if (IsObject(swControl)) then
swVersion = swControl.GetVariable("$version")
end if
VBGetSwfVer = swVersion
End Function
// -->
</script>
as code:
Code:
stop();
// [ XML HANDLING ] \
var x:XML = new XML();
x.ignoreWhite = true;
var urls:Array = new Array();
var captions:Array = new Array();
var whichSlide:Number;
x.onLoad = function(success) {
var swfSlides:Array = this.firstChild.childNodes;
for(i=0;i<swfSlides.length;i++) {
urls.push(swfSlides[i].attributes.url);
captions.push(swfSlides[i].attributes.caption);
}
holder.loadMovie(urls[0]);
whichSlide = 0;
}
x.load("module1.xml");
// ================================================[ /XML HANDLING ] ======================================== \
// ================================================[ AUDIO CONTROLS ] ======================================== \
var myNumber:Number = 1;
var musicFolderName:String = "voiceover/";
var soundDLDuration:Number;
var curPlaybackPos:Number;
var curTrackNum:Number = 0;
var mySound:Sound;
var curTrackVolume:Number = 85;
this.volumePercentText.autoSize = "left";
this.volumePercentText._visible = true;
function playMusicFunc() {
mySound = new Sound();
mySound.onSoundComplete = function() {
if (curTrackNum == (myLV.totalTracks - 1)) {
curTrackNum = 0;
playMusicFunc();
mySound.loadSound((musicFolderName + "slide-" + curTrackNum + ".mp3"), true);
} else {
curTrackNum++;
playMusicFunc();
mySound.loadSound((musicFolderName + "slide-" + curTrackNum + ".mp3"), true);
}
curPlaybackPos = 0;
if(whichSlide < urls.length-1) {
whichSlide++;
holder.loadMovie(urls[whichSlide]);
}
}
mySound.setVolume(curTrackVolume);
volumeControl.volumeMask._width = curTrackVolume/2;
if (curTrackNum < (myLV.totalTracks - 1)) {
nextTrack.enabled = true;
nextTrack._alpha = 100;
} else if (curTrackNum == (myLV.totalTracks - 1)){
nextTrack.enabled = false;
nextTrack._alpha = 50;
nextTrack.gotoAndStop(1);
}
if (curTrackNum == 0) {
prevTrack.enabled = false;
prevTrack._alpha = 50;
prevTrack.gotoAndStop(1);
} else if (curTrackNum > 0){
prevTrack.enabled = true;
prevTrack._alpha = 100;
}
disablePlay();
mySound.loadSound((musicFolderName + "slide-" + curTrackNum + ".mp3"), true);
}
var myLV:LoadVars = new LoadVars();
myLV.load("total_tracks.txt");
myLV.onLoad = function(success) {
if (success) {
playMusicFunc();
}
}
_root.onEnterFrame = function() {
var soundLoaded:Number = mySound.getBytesLoaded();
var soundTotal:Number = mySound.getBytesTotal();
var soundDLPercent:Number = Math.round((soundLoaded / soundTotal) * 100);
progressBar.barTOP._width = Math.round((soundLoaded / soundTotal) * 100);
soundDLDuration = Math.round((mySound.duration / soundDLPercent) * 100);
progressBar.playbackProgSlider._x = (Math.round((mySound.position/soundDLDuration) * 100)) - 5;
progressBar.playbackBarMask._width = (Math.round((mySound.position/soundDLDuration) * 100));
var7.text = "soundDLDuration : " + (soundDLDuration/1000);
if ((mySound.position + 10) > soundDLDuration && (mySound.position - 10) < soundDLDuration) {
delete _root.onEnterFrame;
}
}
this.progressBar.barTOP.onPress = function() {
progressBar.barTOP.onEnterFrame = function() {
if (_root._xmouse >= progressBar._x && _root._xmouse <= (progressBar._x + progressBar.barTOP._width)) {
var soundGoTo:Number = Math.round(_root._xmouse - progressBar._x);
mySound.start(((soundDLDuration/1000)*(soundGoTo/100)));
disablePause();
}
}
}
this.progressBar.barTOP.onRelease = function() {
delete progressBar.barTOP.onEnterFrame;
disablePlay();
}
this.progressBar.barTOP.onReleaseOutside = function() {
delete progressBar.barTOP.onEnterFrame;
disablePlay();
}
// --------------[play/pause]--------------- \
function disablePlay() {
playMusic.enabled = false;
playMusic._alpha = 50;
playMusic.gotoAndStop(1);
pauseMusic.enabled = true;
pauseMusic._alpha = 100;
}
function disablePause() {
playMusic.enabled = true;
playMusic._alpha = 100;
pauseMusic.enabled = false;
pauseMusic._alpha = 50;
pauseMusic.gotoAndStop(1);
}
this.playMusic.onRollOver = function() {
this.nextFrame();
}
this.playMusic.onRollOut = function() {
this.prevFrame();
}
this.playMusic.onRelease = function() {
mySound.start((curPlaybackPos/1000), 9999);
disablePlay();
bgMusic.start();
}
this.pauseMusic.onRollOver = function() {
this.nextFrame();
}
this.pauseMusic.onRollOut = function() {
this.prevFrame();
}
this.pauseMusic.onRelease = function() {
curPlaybackPos = mySound.position;
mySound.stop();
disablePause();
bgMusic.stop();
}
// --------------[/play/pause]--------------- \
this.nextTrack.onRollOver = function() {
this.nextFrame();
}
this.nextTrack.onRollOut = function() {
this.prevFrame();
}
this.nextTrack.onRelease = function() {
if (curTrackNum < (myLV.totalTracks - 1)) {
curTrackNum++;
playMusicFunc();
}
if(whichSlide < urls.length-1) {
whichSlide++;
holder.loadMovie(urls[whichSlide]);
}
}
this.prevTrack.onRollOver = function() {
this.nextFrame();
}
this.prevTrack.onRollOut = function() {
this.prevFrame();
}
this.prevTrack.onRelease = function() {
if (curTrackNum >= 1) {
curTrackNum--;
playMusicFunc();
}
if(whichSlide > 0) {
whichSlide--;
holder.loadMovie(urls[whichSlide]);
}
}
// --------------[volume control]--------------- \
this.volumeControl.onPress = function() {
this.onEnterFrame = function() {
if (_root._xmouse >= volumeControl._x && _root._xmouse <= (volumeControl._x + volumeControl._width)) {
curTrackVolume = (Math.round(_root._xmouse - volumeControl._x)) * 2;
volumeControl.volumeMask._width = (curTrackVolume / 2);
mySound.setVolume(curTrackVolume);
volumePercentText.text = (curTrackVolume + "%");
volumePercentText._visible = true;
}
}
}
this.volumeControl.onRelease = function() {
delete volumeControl.onEnterFrame;
volumePercentText._visible = true;
}
this.volumeControl.onReleaseOutside = function() {
delete volumeControl.onEnterFrame;
volumePercentText._visible = true;
}
// --------------[/volume control]--------------- \
// ================================================[ AUDIO CONTROLS ] ======================================== \
// ================================================[ UI CONTROLS ] ======================================== \
var tipInt;
tooltip._visible = false;
var count = 0;
function showTip(tiptext) {
if(count == 5) {
clearInterval(tipInt);
count = 0;
tooltip.tiptext.text = tiptext;
tooltip._x = _root._xmouse-20;
tooltip._y = _root._ymouse;
tooltip._visible = true;
_root.onMouseMove = function() {
tooltip._x = _root._xmouse-20;
tooltip._y = _root._ymouse;
updateAfterEvent();
}
}
else {
count++;
}
}
function hideTip() {
clearInterval(tipInt);
tooltip._visible = false;
delete _root.onMouseMove;
}
link_mc.onRelease = function():Void {
this.getURL("http://www.libraries.uc.edu", "_blank");
curPlaybackPos = mySound.position;
mySound.stop();
bgMusic.stop();
disablePause();
}
link_mc.onRollOver = function():Void {
this.gotoAndPlay(2);
tipInt = setInterval(showTip,100,"www.libraries.uc.edu");
}
link_mc.onRollOut = function():Void {
this.gotoAndPlay(5);
hideTip();
}
mailLink_mc.onRelease = function():Void {
this.getURL("http://www.libraries.uc.edu/information/contact/index.html", "_blank");
curPlaybackPos = mySound.position;
mySound.stop();
bgMusic.stop();
disablePause();
}
mailLink_mc.onRollOver = function():Void {
this.gotoAndPlay(2);
tipInt = setInterval(showTip,100,"Find answers here");
}
mailLink_mc.onRollOut = function():Void {
this.gotoAndPlay(5);
hideTip();
}
credLink_mc.onRelease = function():Void {
_root.opaqueBackground = true;
attachMovie("credits_mc", "credits_mcee", 1);
credits_mcee._x = 0;
credits_mcee._y = 0;
credits_mcee.closeButton_mc.onRelease = function():Void {
this._parent.removeMovieClip();
curPlaybackPos = mySound.position;
mySound.stop();
disablePause();
};
curPlaybackPos = mySound.position = bgMusic.position;
mySound.stop();
bgMusic.stop();
disablePause();
creditWindow.mcCloseSquare.onRelease = function():Void {
this._parent.removeMovieClip();
}
}
credLink_mc.onRollOver = function():Void {
this.gotoAndPlay(2);
tipInt = setInterval(showTip,100,"Meet the contributors");
}
credLink_mc.onRollOut = function():Void {
this.gotoAndPlay(5);
hideTip();
}
// ============ bg SOUND ============= \
var bgMusic:Sound = new Sound();
bgMusic.loadSound("BGMUSICnew.mp3", true);
bgMusic.start(0, 9999);
var mySoundVolume:Number = 15;
bgMusic.setVolume(mySoundVolume);
musicOff.onRelease = function():Void {
bgMusic.stop();
}
musicOn.onRelease = function():Void {
bgMusic.start();
}
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 08-07-2006, 07:10 PM
View Complete Forum Thread with Replies
Sponsored Links:
When A Sound Stops Playing So It Can Start Playing Another Sound :Monitoring Playback
I'm attempting to do a very simple thing and I'm very perplexed. My girlfriend is an opera singer and all I'm trying to do is advance the audio track when the song finishes playing to go to the next frame. On the surface it seems easy, however I can't seem to figure it out. Perhaps you can help?
Check out the movie here: http://www.earthgrid.com/earthgrid/valentina.html
Here's my code its on frame 2 in the movie
Code:
stopallsounds();
s2.close();
s3.close();
var s1:Sound = new Sound();
s1.loadSound("Agnus_Dei.mp3", true);
s1.start();
stop();
Explanation:: the flash movie has buttons that allow you to navigate between the 3 different music tracks.
when you click on a button, first I close the loading of the previous track, ie. s2 and s3, if they are still loading.
What I'd like to do is insert a command that advances to the next track (which happens to be on the following frame, 3) ONLY when the first audio track is finished PLAYING, not finished 'loading'
something like:
s.addEventListener(Event.SOUND_COMPLETE, gotoandplay (3);
);
so that when Agnus Dei finishes playing it goes to the next frame which starts the next track.
but that' doesn't seem to work.
I found this URL in Adobe's support site:
http://livedocs.adobe.com/flash/9.0/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00000283.ht ml
it says this:
Your application might want to know when a sound stops playing so it can start playing another sound, or clean up some resources used during the previous playback. The SoundChannel class dispatches an Event.SOUND_COMPLETE event when its sound finishes playing. Your application can listen for this event and take appropriate action, as shown below:
Code:
import flash.events.Event;
import flash.media.Sound;
import flash.net.URLRequest;
var snd:Sound = new Sound("smallSound.mp3");
var channel:SoundChannel = snd.play();
s.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);
public function onPlaybackComplete(event:Event)
{
trace("The sound has finished playing.");
}
>> However, when I try to paste in this code into a frame in Flash CS3 it gives an error saying I have to put it in a 'package'
I tried that, putting this code into a file and saving it as a .as file
I really don't get how to do this Package thing in CS3, so I couldnt get the example to work.
If so please contact me Please help!
View Replies !
View Related
Flash Player Not Playing Not Playing Properly Low Bitrate Sound
Hi,
I have created a flash audio player which can play streaming audio (mp3) files and it takes data from external xml file. Everthing is working fine. But when i used a low bitrate mp3 file (size 600 kb, time 3min approx) , it plays the audio with max speed and get ended in 30 seconds. The same audio file is playing normally in windows media player, or winamp,etc.
Plese give me some idea what is happening ........
Thanks,
Gunjan
View Replies !
View Related
How Do I Check To See If A Sound Is Already Playing Before Playing When Pressing Play
Okay, i really need some help on this. I have a play button where if clicked will play the sound over the top of it when its already playing, if that makes any sense. the sound is already called on the first frame. if the user clicks the play button again, it will play over it.
heres my play button code. i need to know what to add to add to make it check to see if the audio is already playing. My audio sound is named myMusc.
ActionScript Code:
on (press) {
if (playing != true) {
if (paused != true) {
playing = true;
paused = false;
stopped = false;
myMusic.start(0, 999);
}
if (paused == true) {
playing = true;
paused = false;
stopped = false;
myMusic.start(myMusicPosition, 0);
_root.myMusic.onSoundComplete = function() {
myMusic.start();
};
}
}
}
Thanks
View Replies !
View Related
How To Know If My Sound Is Playing Or Finished Playing?
I`m loading and playing sound like below.
Code:
//SOUND LOAD
var snd:Sound = new Sound();
snd.load(new URLRequest("sound.mp3"));
snd.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
snd.addEventListener(Event.COMPLETE, onSoundLoadComplete, false, 0, true);
function onIOError(evt:IOErrorEvent):void{
trace("sound loading error: ",evt.text);
}
function onSoundLoadComplete(evt:Event):void{
trace("sound loaded");
}
//SOUND PLAY
snd_btn1.addEventListener(MouseEvent.MOUSE_OVER,sndPlay);
function sndPlay(evt:Event):void{
var channel:SoundChannel
channel = snd.play();
}
i would like to have my sound to play only when it`s not already playing.
how can I achieve this?
thank you
View Replies !
View Related
How To Know If My Sound Is Playing Or Finished Playing?
I`m loading and playing sound like below.
Code:
//SOUND LOAD
var snd:Sound = new Sound();
snd.load(new URLRequest("sound.mp3"));
snd.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
snd.addEventListener(Event.COMPLETE, onSoundLoadComplete, false, 0, true);
function onIOError(evt:IOErrorEvent):void{
trace("sound loading error: ",evt.text);
}
function onSoundLoadComplete(evt:Event):void{
trace("sound loaded");
}
//SOUND PLAY
snd_btn1.addEventListener(MouseEvent.MOUSE_OVER,sndPlay);
function sndPlay(evt:Event):void{
var channel:SoundChannel
channel = snd.play();
}
i would like to have my sound to play only when it`s not already playing.
how can I achieve this?
thank you
View Replies !
View Related
How To Know If My Sound Is Playing Or Finished Playing?
I`m loading and playing sound like below.
Code:
//SOUND LOAD
var snd:Sound = new Sound();
snd.load(new URLRequest("sound.mp3"));
snd.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
snd.addEventListener(Event.COMPLETE, onSoundLoadComplete, false, 0, true);
function onIOError(evt:IOErrorEvent):void{
trace("sound loading error: ",evt.text);
}
function onSoundLoadComplete(evt:Event):void{
trace("sound loaded");
}
//SOUND PLAY
snd_btn1.addEventListener(MouseEvent.MOUSE_OVER,sndPlay);
function sndPlay(evt:Event):void{
var channel:SoundChannel
channel = snd.play();
}
i would like to have my sound to play only when it`s not already playing.
how can I achieve this?
thank you
View Replies !
View Related
Stoping And Playing Sound At A Particular Point (using Sound Object)
Hi,
I have a movie in which i have a voice over and some animations which is in sync with the VO. I have a play button and stop button.
I am using the sound object method to play the sound and the animations are in timeline.
I have to stop the movie at any point in time and when i click on play the sound should start from the point where it stopped..But it is not happening.
Please help me..
am having a deadline today..
lamus
View Replies !
View Related
°°°keep The Sound From Playing If It Is Already Playing
Hi FlasherZ,
I add this code to my buttons but it didn't work - can you fix it. Do I have to define a variable "playing" in the first frame???
I read this tutorial, chapter "How to Start, Stop and Loop a Sound Object" and everything works fine but if I hit the on button I hear 2 sounds playing, if I hit the button again, I hear 3 sounds playing at the same time - U know what I mean, so I wanted to use the code in the tutorial with the variable "playing".
Here is the link to the tutorial:
http://www.kennybellew.com
I would appreciate some advices.
Omitofo-
Attila
View Replies !
View Related
Playing Out QT With Sound
Does anybody know if there is a way to play a QT with sound direct from Flash. I have a video that needs to sync exactly.
The playout is via hard drive/CD-ROM not the web. I was wondering if you can make a pop-up window that will execute the file?.
I'm Stumped!
View Replies !
View Related
Playing With Sound
I have 4 faders on a screen. each fader has a start and stop button. using the normal action script I can get 4 different files to play. PROBLEM the stop button on each fader will stop the music for any song even thought it is assigned to another, and any fader will change the music for any song. how do I get the fader to only control the song it is assigned to and to get the stop button to stop on the song it is assigned to? Thanks in advance
View Replies !
View Related
Playing A Sound?
hello,
im really stuck here, i'm designing a "phone/keypad" style navigation and i have used actionscript to make the user dial a certain extension, which is displayed in a box, to get to a certain page, and if they type in a wrong code, the box resets itself. BUT, i want to have a sound to play if the user enters a wrong code. the code i have used is below, PLEASE HELP.
on (release) {
switch (password) {
case "121" :
gotoAndPlay("contact", 1);
break;
case "122" :
gotoAndPlay("about", 1);
break;
default :
password = "";
I look foward to all your replies! i got a feeling this is gonna be easy, but i just cant see the wood for the trees!
Thanks
Yoda
View Replies !
View Related
Sound Not Playing
Hi-
I have a movie with three sounds: wind, rain and thunder. The rain is a movie clip with the sound embedded. The wind is just a sound on the main timeline. The lightning is a graphic with a keyframed thunder sound on the main timeline so they are both in sync. All sounds begin with "Event".
For whatever reason, the thunder does not play, even with a preloader. How would you best handle this?
I moved the thunder sound into the lightning movei clip and it seems to work fine. Why wouldn't it in the main timeline? Too many sounds?
Also, with the lightning clip, should the thunder sound be "stream" or "event". Help!! How would you best handle these sounds?
Thanks!!
-Rob
View Replies !
View Related
Sound Not Playing.
I created a sound movie with an mp3 file. The movie has a volume slider included in it. The file is named "bgsound.swf". I created this movie with this script:
s = new Sound();
s.attachSound("backsound");
s.start("0", 3);
When I test this movie, everything works fine.
My problem is when I load it into another movie, I can see "bgsound.swf" graphics, but I no longer have any sound. I loaded "bgsound.swf" onto the other movie trying each of these scripts:
loadMovieNum ("bgsound.swf", 1, "POST");
loadMovieNum ("bgmusic.swf", 1, "GET");
loadMovieNum ("bgmusic.swf", 1);
None of them worked. HELP!
I am using Flash MX.
View Replies !
View Related
Sound Not Playing HELP
i'm working on a flash site where i call an mp3 file using this script:
mySound = new Sound(this);
mySound.loadSound("http://..sample2.mp3", true);
mySound.start(0, 999);
this file works it is 256k i then change it to the song file which is 3.2mb and it won't play at all ... is it because of the size ?? anyway i can play this 3.2mb mp3 dynamically ???
View Replies !
View Related
Playing Sound
Still new with actionscript...
I'm having trouble with this script:
song = new Sound();
song.attachSound("main_music");
_root.song.start(0, 99999);
if (_root.song.start(0, 99999) == true) {
a = 1;
} else if (_root.song.stop == true) {
a = 2;
}
song.setVolume(50);
if (a=2) {
_root.playButton.onRelease = function() {
song.start(0, 99999);
};
}
_root.stopButton.onRelease = function() {
song.stop();
a = 2;
};
I want the play button to be inactive when the music runs, preventing the music to start over and over again with every push of playButton.
One more thing, can I use some actionscript efect for the song, something like fadein in the begining of the song.
Please help!!!
View Replies !
View Related
Playing Sound
Hi,
I am searching for solution in one to you experienced flashers probably simple thing. But I must admit that I have not yet found answer to this and I have hope to got one in this forum, at least some guidelines
I am designing web page that must play mp3 sound. It is a sound file: for example called default.mp3 . I have stop/play button, and when the page is loaded, default.mp3 starts. I can click button and then sound stops, and button changes to "play" and pressing it again will play that mp3 again. I done this with some JavaScripting and EMBED tag, whic is calling default mp3 player to play this file.
But problem is, not all people have mp3 player. Those on win98 do not have it preinstalled.
So i thought about possibility to get done this action that I described in flash. I already have some flash animation on that page
so another one would not be a problem but, I do not know if flash
can play some default.mp3 file without bundling, importing etc.
Is there some way to create such small application in flash that will somehow import default.mp3 on the fly. I know, I can complie this file into flash first and play it, but I would like to make it so, that with only by changing the default.mp3 file (I just need to overwrite it with new sound) new music is played.
Is there any chance that this can be done!
Please help if you understand this little desperate posting of mine :<
Regards,
Nenad
View Replies !
View Related
Sound Is Not Playing ?
peepz why is my sound not playing ?
if i play it in the loop1.swf it plays (if i remove the stop out of the first frame) but if i load the loop1.swf in my main.swf it wont play !?!
code main.swf:
frame1//////
Code:
_root.mcBG.mcRadio.mcRadioLoader.mcSoundContainer.loadMovie("sounds/loop1.swf")
frame2//////
stop();
+
a perloader with a good script (placed in a MC)
frame3//////
Code:
stop();
trace("frame 3");
_root.mcBG.mcRadio.mcRadioLoader.mcSoundContainer.gotoAndPlay(2);
the loop1.swf code:
frame1///////
Code:
stop();
frame2///////
Code:
loop1 = new Sound();
loop1.attachSound("loop1");
loop1.start(0, 99999);
loop1.setVolume(20);
frame3///////
Code:
loop1.setVolume(loop1.getVolume()+1);
frame4////////
Code:
if (loop1.getVolume()>100) {
stop();
} else {
gotoAndPlay(3);
}
maybe it have something to do with export in first frame ?
the weirdness is that it plays if its tested in loop1.swf and it doesn't play in de main.swf
who can help?
thnx for everything!!!!!
View Replies !
View Related
Playing Sound MC's At Once
I think I posted this is the wrong section. This is probably more of an actionscript question.
We are building a musical flash site for a group project. We have many different sound clips that we want a user to be able to mix and match. Each sound clip is associated with a MC. When they click a sound, I want it to load into an empty MC. I can get the first sound to play just fine. When I try to load in the second sound into the second empty MC, it automatically stops the sound of the first MC and then will play the sound of the second MC. I want the sound of MC1 and MC2 to play simultaneously. Is this possible? I'm not even sure where to begin after that. Is there anybody with some ideas? Thanks
View Replies !
View Related
Playing A Sound Mc
I want to start playing a sound mc.. or a sound whatever when i press a button.. and i want to be able to stop the sound with by pressing the same button.. how can i do that.. okay so i can't attack the.fla file cause its bigger than 2 MB.. so if someone could just easily explain me.. where to put the sound file.. and how to play it and stop it with the touch of a button.. that would be awesome... any help is appreciated.. thanks!
View Replies !
View Related
Sound Not Playing
I downloaded a nice christmas flash program from flash kit, everything works fine but the sound isn't working.
I am using flash MX2004
any ideas what i need to do to get the sound to play?
Thanks
View Replies !
View Related
Sound Not Playing
Pretty simple problem here....though I don't know what's wrong.
All I need to do is play a simple sound effect. For testing purposes I had it play at the press of a button:
Code:
var in_alert3:Sound = new Sound(new URLRequest("sounds/alert3.wav"));
snd_btn.addEventListener(MouseEvent.CLICK, snd_btnFunction);
function snd_btnFunction(event: MouseEvent) {
if(chat_in.text == "time")
{
in_alert3.play();
}
}
Nothing happens...no sound effect is played. I know the button event works just fine as well.
Any ideas? Thanks in advance.
View Replies !
View Related
Playing More Than One Sound?
Is there a way to play more than one sound at the same time? I have, for example, a thunderstorm scene that has a wind wav and also a thunder wav that's triggered each time the lightening flashes. Also, each of my nav buttons plays a different sound onRollOver. Right now, I'm doing all of my sounds programmatically. I can get the wind and the thunder to play at the same time, but then if my mouse happens to roll over a nav button, the storm noises stop. Is there a way to fix this?
View Replies !
View Related
If Sound Playing()....?
how can I tell if a sound if playing or stopped?
I have a simple music player that just plays the client jingle when the movie loads. It has a play and a stop button, and a piece of dynamic text that changes to "Music Off" if the user hits the stop button, and it changes back to "Music On" if they hit the play button.
However, if the user just lets the jingle play in it's entirety, the dynamic text still says "Music On" when the jingle is done.
How can I make that change when the music stops?
Here's what i've tried, but it does nothing (it doesn't give me an error, but it doesn't do anything either...)
ActionScript Code:
if (jingle.playing = true)
{
this.musicPlayer_mc.musicTxt.text = "Music On";
}
else
{
this.musicPlayer_mc.musicTxt.text = "Music Off";
}
Again, that doesn't seem to do anything...the code validates and I get no errors when the movie runs, but nothing happens when the jingle stops playing....
View Replies !
View Related
Is This Possible? About Playing Sound.
I have millions of small mp3 files. And I'd like to import every 100 files into a flash file, and then play one of it per the request from javascript. The swf will be used in a webpage.
Since there are millions of mp3 files, I can't use mouse to click and select them then export the symbol of these files.
I need a batch mode, or a script mode. Which actionscript APIs can I use to import mp3 and export them to actionscript from library? And at last, I need compile the .fla files to .swf files.
Any suggestions? Help me please.
View Replies !
View Related
Sound Is Not Playing ?
peepz why is my sound not playing ?
if i play it in the loop1.swf it plays (if i remove the stop out of the first frame) but if i load the loop1.swf in my main.swf it wont play !?!
code main.swf:
frame1//////
Code:
_root.mcBG.mcRadio.mcRadioLoader.mcSoundContainer.loadMovie("sounds/loop1.swf")
frame2//////
stop();
+
a perloader with a good script (placed in a MC)
frame3//////
Code:
stop();
trace("frame 3");
_root.mcBG.mcRadio.mcRadioLoader.mcSoundContainer.gotoAndPlay(2);
the loop1.swf code:
frame1///////
Code:
stop();
frame2///////
Code:
loop1 = new Sound();
loop1.attachSound("loop1");
loop1.start(0, 99999);
loop1.setVolume(20);
frame3///////
Code:
loop1.setVolume(loop1.getVolume()+1);
frame4////////
Code:
if (loop1.getVolume()>100) {
stop();
} else {
gotoAndPlay(3);
}
maybe it have something to do with export in first frame ?
the weirdness is that it plays if its tested in loop1.swf and it doesn't play in de main.swf
who can help?
thnx for everything!!!!!
View Replies !
View Related
Playing A Sound
I have a short 3 second mp3 that I want to play as soon as my navbar swf loads. Right now I have a typical 2 frame preloader that loads everything then begins the nav animation on frame 3. I want the mp3 to begin playing on frame 3 as well. How exactly do I go about doing this?
On a side note, the mp3 I made is compressed at 128 kbps, and the file size is 60 kb. Is this too big? Should I have condensed it down to 80 or 56 kbps? The total file size of my Flash nav animation is 86 kb, and it's also about 3 seconds long. I want it to load pretty fast considering it's a nav bar, if anyone has any experience with this and wants to chime in, let me know, thanks!
View Replies !
View Related
Sound Keep Playing
I have a movie clip for the intro that has two movie clips inside and plays a sound for the intro. Then the movie clips react to the mouse like buttons and have sound but the intro part does not repeat.
Here's the problem: The sounds play as if the movie clip is playing and the sounds repeat regularly, but the action that the sound is attached to doesn't change.
I have Adobe CS3 Flash 9, actionscript 3 and have tried syncs of event, stream, start - repeat 1 and 0.
Thanks
View Replies !
View Related
Sound Not Playing
Hi.
Now, I made a music player for a website. When I tested (previewed) it in flash it did not play with sound. However, through the exterior swf player it played with sound as designed. So I uploaded it onto the server, and as you might guess it didn't work. It isn't part of the main .swf, the music player is loaded on a level above it. The weird thing is when I type in the .swf name into the browser, loading it by itself, the sound works. Can anyone help?
View Replies !
View Related
Sound Not Playing
Can someone offer some help on why the following code isn't playing the sound? The wav file is in the same folder as the swf file and the speakers are on. The trace statement works. Thanks.
Attach Code
var soundWaveReq:URLRequest = new URLRequest("wavebig.wav");
var soundWave:Sound = new Sound();
soundWave.load(soundWaveReq);
soundWave.addEventListener(Event.COMPLETE, onWaveComplete);
function onWaveComplete(evt:Event):void
{
soundWave.play();
//trace("It's working to here");
}
View Replies !
View Related
Sound Playing Twice
Okay, I have some music (a short loop) that begins playing when my movie is loaded. The movie is 4 frames. Frame 1 & 2 consist of the preloader. Frame 3 has only my music on it. Frame 4 has the script to attachSound.
attachSound.track = new Sound();
track.attachSound("soundtrack");
track.start(0,99);
I also have a stop and play button on the stage to control the music.
They work fine, but if I press play while the music is going through its first loop only, it starts up again and i get overlapping.Anytime after that its fine. Weird.
Heres whats on the play button;
on(press) {
if (playing != true) {
_root.track.start(0,99);
playing = true;
}
}
Any takers?
View Replies !
View Related
Playing A Sound
Hi,
I'm having problems using dynamically-defined wav files using XML. What I do is that I put the sound path ("cow.wav") as an attribute in my XML file, and then try to play it as mentionned in http://www.kennybellew.com/tutorial/ under the section entitled "How to Load an External MP3 Dynamically as a Sound Object".
I trace my sound variable, and it gives cow.wav as a result. The problem is, when we want to play sounds, we use my_sound.loadSound("url", isStreaming). As you can see in here, url is between quotes. I think this is why I cannot play the sound, because it looks for cow.wav and not "cow.wav"...
So what do I do to "add quotes to the sound"? Is it done in AS? Is it done as every value of the XML file? Any help or link is appreciated!
View Replies !
View Related
Sound Not Playing In IE
I have a flash movie with a streaming external MP3 loaded:
backgroundMusic = new Sound(feelGood);
backgroundMusic.loadSound("MP3s/feelGoodInc.mp3", true);
I have put the swf in a dreamweaver file.
The music plays in Flash, it plays in Mozilla, but it doesn't play in Internet Explorer. Can anyone help!
View Replies !
View Related
What AS For Playing A Sound...
What is the Actionscript to make a sound play in your library?
Also, how can I make it play the sound every 14 seconds by using a movie clip in AS? I don't want it to stream on the movie clip for personal reasons. I just really need to know how to have it play a sound every 14 seconds with actionscript.
Thanks in advance.
View Replies !
View Related
How To Know If Sound Is Playing?
So I have this sound object, and want to stop it.
ActionScript Code:
channel.stop(); //which does nothing at all....sound.close(); //which throws an error "no soundstream etc etc"
My code
ActionScript Code:
var sound:Sound = new Sound();var channel:SoundChannel = new SoundChannel();public function listen_mp3(url){ stop_all(); sound.load(new URLRequest(url)); channel = sound.play();}public function stop_all(){ channel.stop(); sound.close();}
Regards
View Replies !
View Related
Sound Playing Twice
Okay, I have some music (a short loop) that begins playing when my movie is loaded. The movie is 4 frames. Frame 1 & 2 consist of the preloader. Frame 3 has only my music on it. Frame 4 has the script to attachSound.
attachSound.track = new Sound();
track.attachSound("soundtrack");
track.start(0,99);
I also have a stop and play button on the stage to control the music.
They work fine, but if I press play while the music is going through its first loop only, it starts up again and i get overlapping.Anytime after that its fine. Weird.
Heres whats on the play button;
on(press) {
if (playing != true) {
_root.track.start(0,99);
playing = true;
}
}
Any takers?
View Replies !
View Related
Playing Sound
Ok, i got a main movie which loads other movies into it. Only the main movie has sound. I added a button to "play" and "stop" sound the code to stop sound is:
on (release) {stopAllSounds();
}
now the silly question...what would the code be for the "play" button to get all sounds playing again?
i did try:
on (release) {playAllSounds();
}
and
on (release) {sartAllSounds();
}
obviously thats not right!
View Replies !
View Related
FLV Sound Not Playing
Hey,
I exported a couple flv's, when I play them in the standalone vflplayer the audio is audible, but when I load them into an swf with flvplayback I can't hear zip ****. The video is visible, though.
Any thoughts?
.soma
View Replies !
View Related
Sound Is Not Playing ?
peepz why is my sound not playing ?
if i play it in the loop1.swf it plays (if i remove the stop out of the first frame) but if i load the loop1.swf in my main.swf it wont play !?!
code main.swf:
frame1//////
Code:
_root.mcBG.mcRadio.mcRadioLoader.mcSoundContainer.loadMovie("sounds/loop1.swf")
frame2//////
stop();
+
a perloader with a good script (placed in a MC)
frame3//////
Code:
stop();
trace("frame 3");
_root.mcBG.mcRadio.mcRadioLoader.mcSoundContainer.gotoAndPlay(2);
the loop1.swf code:
frame1///////
Code:
stop();
frame2///////
Code:
loop1 = new Sound();
loop1.attachSound("loop1");
loop1.start(0, 99999);
loop1.setVolume(20);
frame3///////
Code:
loop1.setVolume(loop1.getVolume()+1);
frame4////////
Code:
if (loop1.getVolume()>100) {
stop();
} else {
gotoAndPlay(3);
}
maybe it have something to do with export in first frame ?
the weirdness is that it plays if its tested in loop1.swf and it doesn't play in de main.swf
who can help?
thnx for everything!!!!!
View Replies !
View Related
Sound Playing
Hi!
I have some problem whit sound. If a sound already is playing, and whene i press the play button the sound start again, it's play in the same time like the first one.
How do i do to stop that?
Thanks for the help
View Replies !
View Related
Sound Playing And Mute
hi
After disabling or muting the sound donno how to play ie I want to know ActionScript for playing sound.
I have created a MC and an invisible button
1.In MC I placed button.
2. frame 1 _root.sound=1;
sounda = new Sound();
3. In MC
onClipEvent (enterFrame) {
if (_root.sound==0){
stopAllSounds ();
}
else{
_root.sounda.setVolume(100);
}
}
4.In Button
on (release) {
if (_root.sound==0){
_root.sound=1;
}
else if (_root.sound==1){
_root.sound=0;
}
}
View Replies !
View Related
How Can I Stop Sound From Playing
I got a simple question - I bet you have a simpler answer
What I want..
-------------------
Make an animated gif of a flag move when u have the mouse over the button(gif)and at the same time play the national anthem until you remove the mouse away from the button - then the music and animation should stop.
What I have done..
-------------------
a)Made a MC (flag_move) and imported the animated flag.gif to the MC. Also imported the anthem.mp3 file. Added a new layer and at the first frame on that layer I put the mp3 with sync:start
b)Created a button (flag_butt). At the "UP"-state I hade a gif of the flag not moving. On the "OVER"-state I placed my MC (flag_move). "DOWN"- and "HIT"-state I left alone.
c)Placed an Instance of the button on the stage
What happens..
-------------------
When I move the cursor over the flag it starts to animate it and the anthem plays just like I want - BUT - when I remove the cursor from the button-instance the music continues until the mp3 is done. NOW What/How should I do to get the music to stop at the same time my marker leaves the buttonarea ????? ??
View Replies !
View Related
Playing A Sound Thru New Window?
hi
its my first post here.
i need the user of my site to be able to click a button which will allow them to begin streaming a real audio file.
i want the button to open a new window where the link to the file will be stored.
is this possible??
any links to tutorials or the like would be so appreciated!
cheers
james
View Replies !
View Related
Playing Sound From An External Swf
i have got a problem with playing sounds from an external .swf
the situation is as following:
the main movie (on level0) has this code on frame 1:
_____________
stop();
loadMovieNum("soundtest.swf", 1)
_____________
and in soundtest.swf:
_____________
stop();
s = new Sound;
s.attachSound("s");
s.start(0,100);
_____________
the soundtest.swf played alone works properly, but not when it is loaded from the movie. what can i do?`
thanks in advance everyone!
ariza
note: i wanted make an external .swf for the sounds because of smart loading in background
View Replies !
View Related
Playing Sound Actionscripting
Hello, I'm trying to have a button play a short mp3 on my .swf after I click on it. I want it to work like the flashtrak console on the soundloops section of Flash Kit. Can anyone tell me how to actionscript the button? Thanks for the help!
View Replies !
View Related
Sound Playing To Fast
Hi,
I use loadSound to play an small (9kb) and short (less then one second) mp3 file. But the sound plays too fast. This is spoken text and you can't hear what's being said. The file itself plays fine. Does anyone know why this happens?
Thanks very much, Danielle.
View Replies !
View Related
Playing Sound Loop Over Several SWF's
Hey Flashers
My website consists of several different SWF's all up around 10.
I want to load a sound loop, that constantly plays throughout my website, regardless what swf file i am on.
At the moment my sound loop works fine but when i click a button to load another SWF my sound loop stops.
Anyone advice would be great.
Cheers
Shaun
View Replies !
View Related
|