Sound Object & LoadSound();
Ok, so I have this problem: I have a music wav file on the net, lets say, myMusicURL. I have a one framed movie website and the code on its frame is this:
ActionScript Code:
music1 = new Sound();music1.loadSound("myMusicURL", false);optionstxt = "Downloading Music..."
optionstxt is a variable that a dynamic textbox on the scene uses. Then I have a mc w/ two keyframes and on its first frame I have:
ActionScript Code:
music2 = _root.music1;if(music2.getBytesLoaded() == music2.getBytesTotal()){ _root.optionstxt = "Playing..." music2.start(); music2.setVolume(100);}
but, when test the movie, the textbox shows playing, because it thinks that the music object has loaded. well, it ain't
Help, anyone?
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 02-08-2004, 02:24 AM
View Complete Forum Thread with Replies
Sponsored Links:
Sound Object & LoadSound();
Ok, so I have this problem: I have a music wav file on the net, lets say, myMusicURL. I have a one framed movie website and the code on its frame is this:
ActionScript Code:
music1 = new Sound();music1.loadSound("myMusicURL", false);optionstxt = "Downloading Music..."
optionstxt is a variable that a dynamic textbox on the scene uses. Then I have a mc w/ two keyframes and on its first frame I have:
ActionScript Code:
music2 = _root.music1;if(music2.getBytesLoaded() == music2.getBytesTotal()){ _root.optionstxt = "Playing..." music2.start(); music2.setVolume(100);}
but, when test the movie, the textbox shows playing, because it thinks that the music object has loaded. well, it ain't
Help, anyone?
View Replies !
View Related
Sound Object Via LoadSound
Hi everybody, I searched on the forum to see if anybody has had the same problem I am having. And it seems that others have had similar bugs yet not similar solutions. I've tried everything I could think of.
I'm on the 40th frame, 25 fps. I'm using Flash MX.
at the first frame I have two buttons, you sets soundquality to true. true is high quality, and the other is for low quality which would be false. i've tried putting the s.onLoad in the onenterframe... that didnt work.
I also tried setting the isStreaming of the loadSound() to true.. and the sound started.. BUT i've never heard of this before, but the sound played at a high speed "alvin and the chipmunks" type speed!!! i know for a fact that my problem is not determining the soundquality boolean.
this code here does not work for me by the way, but i can not figure out why it wont
ActionScript Code:
s = new Sound();
s.setVolume(100);
if(songquality==true){
s.loadSound("bitterseed_hi.mp3",false);
s.onLoad = function() {
s.start(0,99);
}
View Replies !
View Related
Question On The Sound Object And LoadSound
i have a movieclip which after hitting the last frame does the following:
_root.ss = new Sound();
_root.ss.loadSound("track.mp3",false);
(makes a new sound object called 'ss' and gives it some sound.) this is all fine, now i have some sound but if i want to make a button called "change Track" that will change the '_root.ss'sound from 'track.mp3' to say 'track2.mp3' how can i do that?
i tried:
on(release){
_root.ss = new Sound();
_root.ss.loadSound("track2.mp3",false);
}
thinking that it would sort of overwrite it with this new track but it either just stops or or doesn't work at all.
View Replies !
View Related
Sound Object: LoadSound: Position
Hi there.
So I've just built a simple audio player in Flash MX for a project. I'm loading external MP3s with the loadSound() method of the Sound object.
Works fine.
I also have a progress bar that displays the percentage of the file that's been played. This works also, except...
...if I click to reload the sound while it is playing, even though it resets to the beginning of the sound, the script is still getting the position property as if the original sound had not been stopped.
Since there is no "unLoadSound()" function, I assumed that subsequent calls to loadSound() would result in the previous sounds getting destroyed.
Anyway, needless to say, this is frustrating me...how can I reset my visual progress bar so that it goes back to the beginning?
(I suppose I could create an entirely new Sound object on each click, but it seems like that would waste memory.)
View Replies !
View Related
LoadSound() And AttachSound() On Same Sound Object?
Is there a way to use attachSound() and loadSound() both on the same sound object? So far i can get both to work, but once loadSound() is called on the object, attachSound() no longer works.
ActionScript Code:
/*---- char voice behaviors ----*/
var char_sound:Sound = new Sound(charSound_mc);
// the library item that is called should be filename.mp3 in the identifier property, and exported for actionscript
// don't include ".mp3" in the function call. example: say("filename");
say = function(id:String){
char_sound.stop();
char_sound.attachSound(id+".mp3");
char_sound.start();
}
// the file that is called should be filename.mp3
// don't include ".mp3" in the function call. example: say("filename");
sayExt = function(url:String){
char_sound.stop();
char_sound.loadSound(_global.path+url,true);
}
usage examples:
ActionScript Code:
say("intro");
sayExt("soundfile.mp3");
View Replies !
View Related
[MX] Sound Object Problem - LoadSound - I Cant Hear Anything
Hello,
I am loading a loop into my sound object. I have used getBytesLoaded and getTotalBytes to ensure that it is loaded but nothing seems to play. Here's the code anyway:
Code:
Function at the start of movie:
//loading the initial music
function musicLoopLoad(){
loopno = 1;
//the sound object
musicloop = new sound();
musicloop.loadSound("loop" + loopno + ".swf", true);
onEnterFrame = function(){
totalsound = _root.musicloop.getBytesTotal();
loadedsound = _root.musicloop.getBytesLoaded();
percent = (loadedsound/totalsound) * 100;
if(percent==100){
_root.musicloop.start();
onEnterFrame = null;
}
}
};
and then inside my main part of movie I have this:
//loading the initial loop
musicLoopLoad();
Any ideas?
Thanks for any help,
G
View Replies !
View Related
Preloader For LoadSound() Object
Hey guys, I was just wondering if it's possible to create a working loadbar giving the status on a streaming mp3 file. All i want to do is, while the file is playing, for a little animation to show the percentage of the file that has actually been downloaded so far. F.Y.I. I checked out the code to Voets.' streaming xml player and that didn't help. Any ideas on how to get the percentage bar working?
For more information:
redload is a movie clip that should increase in width until reaching 100% (150 pixels wide), determined by bytes_loaded/bytes_total.
All music.php does is sends the full address of an mp3 file using the variable playsong.
Unfortunately, the percentageBar (loadbar) doesn't work and is commented out.
// CODE ---------------------------------------->
loadMySong = function () {
//this.mplayer.redload._width = 1.0;
htmlData = new LoadVars();
htmlData.load("music.php?dummy=" + Math.random());
htmlData.onLoad = function (true) {
if (true) {
playsong = this.play;
songname = this.name;
}
}
};
/*this.mplayer.percentageBar = function (true)
{
loaded = Math.round(theStream.getBytesLoaded());
total = Math.round(theStream.getBytesTotal());
getPercent = loaded/total;
this.mplayer.redload._width = getPercent * 150;
};*/
var theStream = new Sound();
mplayer.now_playing = "go ahead, make my day";
loadMySong();
mplayer.pause.onPress = function ()
{
theStream.stop();
mplayer.now_playing = "---";
};
mplayer.play.onPress = function ()
{
loadMySong();
theStream.stop();
mplayer.now_playing = songname;
theStream.loadSound("http://localhost:8000"+playsong, true);
//percentageBar();
};
View Replies !
View Related
Sound.loadSound() ... Sound.startSound()
I'm loading an mp3 from a local directory... no problem with the loading, I can trace the correct size loaded.
However, I can not get the mp3 to play properly!
If I set the sound to stream, I get a chopped up playback of it- no good.
Reading through the AS dictionary, I see that it says
"Usage
mySound.loadSound("url", isStreaming)
Parameters
url The location on a server of an MP3 sound file.
"
does the mp3 have to reside on a remote server????
I would really appreciate any help you can give on this one!
Thanks!
View Replies !
View Related
Why Does Sound.loadSound() Trigger DAP?
Yes, that's true, using sound.loadSound() method triggers my Download Accelerator Plus. Anyone knows how to avoid this?
Another problem whith the sound object... when I use the sound.onSoundComplete = function(){sound.start()};
my sound doesn't start at all... (weird)
Thanks
PS: those of u whith DAP installed can chek it here
View Replies !
View Related
Sound.loadSound Problem
Hi
I'm trying to load an mp3 file into my swf however it's simply not working. I can't figure out what I'm doing wrong. Are there any special tricks that need to be done? Here is the scripting I'm using.
====================================
my_sound.loadSound("jazzy.mp3");
my_sound.onLoad = function(success){
if(success){
music.setVolume(100);
music.start(0,99);
trace("music started!");
} else {
}
}
========================================
I've tried putting the mp3 file on a server and using a remote address but that doesn't work either. When I test the movie, the trace next never appears in the output window so apparently the mp3 file never loads properly. Any ideas? Thanks!
View Replies !
View Related
Sound.loadSound() Not Working In IE
Hey there.
I'm having an issue with Sound.loadSound() not working correctly (or at all) in IE6.
The movie is a short animation which reads data from an .xml file and progressively displays it. (The data that is read consists of two text strings, and an image filename, and there are about 60 sets of data in the file.)
I want to have an audio track playing in the background, which I've attempted to do by using the following in the first frame of the animation:
Code:
audio = new Sound();
audio.onLoad = function() {
audio.start();
};
audio.loadSound("audio.uhs", false);
(The file 'audio.uhs' is a renamed .mp3 track - but the problem still occurs when the extension is unchanged.)
This works perfectly in the stand-alone player, and when displayed in a webpage in Firefox (1.0), but when viewed in a webpage in IE (6, SP1) the sound fails to play. A couple of experiments have shown that it appears not to find the file at all, which is odd because it finds the .xml file (and the images referred to in the .xml file) without any problems.
I originally thought the cause may be the fact that the .swf file (and .uhs, and .xml) are not in the same directory as the .html document, but I'm setting the 'base' parameter in the .html, and it's finding the other files without a problem.
The html code is as follows:
Code:
<object type="application/x-shockwave-flash" data="content/achievers/achievers.swf" width="400" height="300">
<param name="movie" value="content/achievers/achievers.swf" />
<param name="base" value="content/achievers" />
<param name="menu" value="false" />
<img src="content/achievers/achievers.jpg" alt="" />
</object>
I'm mainly curious to see if anyone else has had a similar problem, or if anyone can offer a solution. I know I could get around this by embedding the audio within the .swf file itself, but I'd like to know why it's happening in the first place.
Cheers,
- JiWhirl
View Replies !
View Related
Which Sound Ist Playing, Can I Get Parameter Of LoadSound?
I tried to load some songs randomly.
I have. q., is it possible to get value of URL parameter of loadSound method?
I would like to know, which song was loaded.
Thanks
Code:
var bgSound:Sound = new Sound ();
// if the sound loads, play it; if not, trace failure loading
bgSound.onLoad = function (success:Boolean)
{
if (success)
{
bgSound.start (0, 999);
trace("Played song has duration "+ bgSound.duration);
//status_txt.text = "Sound loaded";
}
else
{
// status_txt.text = "Sound failed";
}
};
// load the random sound of 5 songs
bgSound.loadSound ("bgSound_"+Math.round( Math.random()*5) + ".mp3", false);
View Replies !
View Related
Strange Sound Error: LoadSound
targetHandlerClass.prototype.playSound = function(arrayPointer:Number, isCorrect:Boolean, component) {
if (isCorrect == true) {
var soundName:String = component._correctSoundID[arrayPointer]+".mp3";
} else if (isCorrect == false) {
var soundName:String = component._incorrectSoundID[arrayPointer]+".mp3";
}
stopAllSounds();
var mySound:Sound = new Sound(this);
mySound.loadSound(soundName, true);
};
The above function works fine when I run in Flash (CTRL-Enter), but when I run the exported .swf in a browser, a strange bug occurs - sometimes :|
The function is called by clicking in a movieclip, sometimes the first click of that movieclip does NOT play the sound file, but every subsequent click does.
NB: The bug does not occur when using a normal CTRL-Enter, in that case the sound plays first time, everytime. Also, sometimes the bug doesnt occur, even when playing the .swf in a browser.
Does anybody have any clues to what is going wrong here?? im mystified.
Cheerz,
Dwayne
View Replies !
View Related
Which Sound Ist Playing, Can I Get Parameter Of LoadSound?
I tried to load some songs randomly.
I have. q., is it possible to get value of URL parameter of loadSound method?
I would like to know, which song was loaded.
Thanks
Code:
var bgSound:Sound = new Sound ();
// if the sound loads, play it; if not, trace failure loading
bgSound.onLoad = function (success:Boolean)
{
if (success)
{
bgSound.start (0, 999);
trace("Played song has duration "+ bgSound.duration);
//status_txt.text = "Sound loaded";
}
else
{
// status_txt.text = "Sound failed";
}
};
// load the random sound of 5 songs
bgSound.loadSound ("bgSound_"+Math.round( Math.random()*5) + ".mp3", false);
View Replies !
View Related
Which Sound Ist Playing, Can I Get Parameter Of LoadSound?
I tried to load some songs randomly.
I have. q., is it possible to get value of URL parameter of loadSound method?
I would like to know, which song was loaded.
Thanks
Code:
var bgSound:Sound = new Sound ();
// if the sound loads, play it; if not, trace failure loading
bgSound.onLoad = function (success:Boolean)
{
if (success)
{
bgSound.start (0, 999);
trace("Played song has duration "+ bgSound.duration);
//status_txt.text = "Sound loaded";
}
else
{
// status_txt.text = "Sound failed";
}
};
// load the random sound of 5 songs
bgSound.loadSound ("bgSound_"+Math.round( Math.random()*5) + ".mp3", false);
View Replies !
View Related
Stop MP3 From Cache'ing Streaming Sound Using Loadsound
hello,
I created a streaming mp3 player, the Click here for player
I have used the loadsound command with the streaming option set to true, so it streams sound etc. But the problem is that it cache's the mp3 file it is streaming onto the user's internet cache folder.
Is there a way to prevent mp3 files from being cached (have I murdered the English language today using the word cache? ) Something like what the Real Player does, it streams the files but never cache's them. <gasp>
Slan,
Abhay
View Replies !
View Related
Stop MP3 From Cache'ing Streaming Sound Using Loadsound
hello,
I created a streaming mp3 player, the Click here for player
I have used the loadsound command with the streaming option set to true, so it streams sound etc. But the problem is that it cache's the mp3 file it is streaming onto the user's internet cache folder.
Is there a way to prevent mp3 files from being cached (have I murdered the English language today using the word cache? ) Something like what the Real Player does, it streams the files but never cache's them. <gasp>
Slan,
Abhay
View Replies !
View Related
Sound.loadSound("1.mp3",false) Not Working
Hi Everyone!
I have this statement:
sound.loadSound("1.mp3",false)
where 1.mp3 is residing in my current folder (as the swf). However, the sound does not get played. It is only played when I say:
sound.loadSound("1.mp3",true) //(hence a streaming sound)
I want the first one to work, in order to be able to use the onSoundComplete event. Why isn't it working???
Waiting for your replies
Ayman
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
Glitch With Sound.position And External Mp3 Sound Object
Hi,
I am in the midst of build a flash mp3 player and have chosen to load all of my mp3s externally and streaming using this method:
sndAudio.loadSound(track01, true);
The problem I am running into is that when track01 starts playing and I switch to another sound i.e.:
sndAudio.loadSound(track02, true);
the value in sndAudio.position doesn't get reset. This is causing havoc for me in my pause function and my counter as well... I am guessing I have to somehow delete the sound object and repopulate it when I stop a sound or start a different one but I am having trouble figuring this out. Has anyone had any luck with this before? Here is how I am initializing my sound object:
this.createEmptyMovieClip("mcSoundHolder", this.getNextHighestDepth());
var sndAudio:Sound = new Sound(mcSoundHolder);
I am running Flash MX 2004.
Thanks to anyone who can lend a hand,
Cheers,
T-Dawg.
View Replies !
View Related
Stop Sound File Early (using Sound Object)
I know I can use the play() method of the Sound object to offset the beginning of a sound. Ex:
mySound.play(2000) - plays the sound beginning at 2 seconds
Is there a way to get a sound to stop early? For example, if it is a 20-second sound, can I get it to stop at 18 seconds? Thanks!
View Replies !
View Related
How Do I Load External Sound Into A Movieclip Vs. A Sound Object?
I have a sound player movie clip that is designed to play the sound loaded into the parent movie clip. In particular, it uses "_parent.gotoAndPlay(targetFrame);" to start playing the sound. And it works well for statically loaded sounds.
However, how can I use this sound player movie clip with dynamically loaded sounds? The player requires a sound to be loaded into the parent movie clip, but the only way I know of loading an external sound is instantiating a new Sound() object and then using .loadSound(...). But loadSound doesn't load the sound into a movie clip.
So, how do I load an external sound into a movie clip versus a Sound object?
Thanks!
View Replies !
View Related
_global Sound Element/ Shared Object Sound
THIS IS DRIVING ME CRAZY
Im programing a childrens game that teaches music.
Needless to say there are a lot of sounds involved, so natuarrally I only want the sounds to load one time then just be referanced later to be played.
However, this game consists of about 10 different .swf files, that jump back and forth depending on user navigation.
I have tried defining the sounds as _global like so
_global.mysound = new Sound ();
_global.mysound.loadSound("noise.mp3")
playsnd = function(){
_global.mysound.start(0,0)
}
However this will only play in the clip it was defiend in, and I need it to be able to be called from any of the .swfs
I use this code to transpher between movies
unloadMovie(this)
loadMovie("new", this)
I have also tried converting the sound to a Shared:Object but it two only plays in the clip it was defiend in
user_so = SharedObject.getLocal("sndz");
_global.sndz = new Sound(this);
sndz.loadSound("soundz/parry.mp3");
user_so.data.song = _global.sndz;
_global.playsnd = function() {
trace("getting called");
user_so.data.song.start(123, 1);
};
user_so.flush();
OMFG, I have a deadline on Thursday, and I have not been making any progress
PLEAS HELP!!!!!!!!!!
View Replies !
View Related
Synchronsing Sound Using Sound Object Method
before flash 7 you were able to synch the sound to the timeline with and option in the properties window (using the "stream" or "event" setting) - this would ensure any animation would keep up with the soundtrack, and if need be would skip frames.
how can you do this with the new sound object and actionscript??? - is there a method for it? at the moment im creating a new sound object and then use the attachSound method to bring the sound in from the library, but it doesnt automatically synchronise with the graphics on the timeline
anyone any ideas?
cheers
steve
View Replies !
View Related
HELP Sound Object Stop Kills Flv Sound Too
code:
if (!firstTime) {
_root.introMusic = new Sound();
_root.introMusic.attachSound("music");
_root.introMusic.setVolume(50);
_root.introMusic.start(0, 1);
firstTime = true;
}
music_btn.onRelease = function() {
if (!rockNow) {
_root.introMusic.setVolume(0);
this.gotoAndStop(2);
rockNow = true;
} else {
_root.introMusic.setVolume(50);
this.gotoAndStop(1);
rockNow = false;
}
};
stop();
This script for my "music on/off" btn kills ALL audio and not just the sounds object audio. It also pauses FLV playback (I'm using the FLVplayback component). Any insite?
I've tried modifying the above AS not using the "_root." to target the obj and also stop() and start() on the obj instead of just volume control. HELP!!!
Thanks,
1M.
View Replies !
View Related
Load New Sound Into Existing Sound Object
I have an extremely simple AS3 mp3 player that I'm trying to create but the problem I'm running into is that I can't seem to load a new song into my sound object when I switch tracks. Here's the basic code I'm using:
Code:
var sound:Sound = new Sound();
var sControl:SoundChannel = new SoundChannel();
var isPlaying:Boolean = false;
function triggerAudio(id:Number, path:String, type:String):void {
if(isPlaying){
sControl.stop();
sound.close();
isPlaying = false;
} else {
sound.load(new URLRequest(path));
sControl = sound.play();
sControl.addEventListener(Event.SOUND_COMPLETE, completeHandler);
isPlaying = true;
}
}
Right now, playing an initial song works
Stopping a song works
But loading a new song over top of a previously loaded song doesn't.
I'm brand new to AS3, what am I missing?
View Replies !
View Related
Streaming Sound Distorted - Sound Object
I have a streaming sound that is loaded into my flash movie (will end up on CD) that is very distorted, it sounds like someone is slowing down the audio, the voice sounds deep and slow. its kinda funny, but I doubt my boss will think so.
anyone ever run into this before?
View Replies !
View Related
[F8] Recording Sound From A Sound Object To Mp3 Using AS - Brainstorm Here
Hi guys,
Im creating a number of little flash instruments, that I need to be able to record the sounds/songs they create. AFAIK, there is no official way to do this in AS, but I was hoping the more creative scripters around here might be able to help me find a solution?!
The worst case scenario is using the microphone I guess, but i would like to avoid that if at all possible.
Please brainstorm with me here!
Steve
View Replies !
View Related
Streaming Sound Distorted - Sound Object
I have a streaming sound that is loaded into my flash movie (will end up on CD) that is very distorted, it sounds like someone is slowing down the audio, the voice sounds deep and slow. its kinda funny, but I doubt my boss will think so.
anyone ever run into this before?
View Replies !
View Related
Sound Object Attach Sound Or Load
Hi
I am wanting two sounds in my FLA one for movie clip buttons and one for background music.
In the past I have created a sound object and just loaded the file from a location on the server, but I've just seen an aletrnative method thats works very much in the same way but you import the sound files into the library and then export for action script and then attach them to the sound object.
Which is the best method to use? If I bring them into the library do they contribute the FLA size? and if they do is this worse than just loading them?
What are the pros and cons of each method? and which is best to use?
Thanks
Ricky55
View Replies !
View Related
The Sound Object 'mySound=new Sound();
I had an Idea of using dialogue sound and background loops together on my demo. I wanted to do this using the Sound object using linkage to export all sounds embedded in the same .swf. I also wanted to have two volume sliders. One controlling the volume of the Dialogue, the other controlling the background loops, using the mySound.setVolume(); method.
The problem: everytime I instantiate a new Sound() object it supercedes the old one, even though I give the two objects unique identifiers (names)
Can you only have one sound object playing at a time?
View Replies !
View Related
Loading Sound With Sound Object() 'DAP'
Hello,
i was running a test in trying to preload mp3 dynamically using the loadSound function and notice that if am running DAP which is the download accelerator program the flash file doesnt work and instead DAP tried to download the mp3 file. however on diasbling the DAP it worked.
did any one ever encounter a similar problem? was there a solution
View Replies !
View Related
Sound Object To Tell You When Sound Stops?
I'm having a problem. I'm developing an intro/offline presentation in flash for a client and it has music in the background to go with it. I have imported the sound and attached it to the first frame after the preloader using the sound thing in properties panel. Now how do I know when the sound ends? If i put a frame down a couple 1000 frames i see where it says it ends, but i added a keyframe on a different frame there and put something like "music ends" in a text box, but when i play it the music ends about 30 seconds before that. And the worst part is it ends at different times depending on the computer. I want to display something right when the music ends. Is there some way (probably with sound object) i can do something like this:
[on frame 999]
if(!sound.on){
gotoAndPlay(1000)
}else{
gotoAndPlay(998);
so it keeps testing to see if the sound ends, and when it does it continues to play the rest? I took out moock's Actionscript the Definitive Guide, but all i can find on the sound object is how to control stop and play, not to test if it is playing.
Thanks
View Replies !
View Related
[F8] AS2 Sound Object - Sound Never Plays
Hi there, I'm trying to build a JS sound control class using some simple ActionScript and ExternalInterface.
Problem is that the sound never works when I try to play it. Is there a glaring omission in my code?
PHP Code:
import flash.external.*;
import System.security;
System.security.allowDomain("*");
var sounds = new Object();
function registerSound(url) {
var s:Sound = new Sound();
log('URL is: '+url);
s.loadSound(new URLRequest(url), true);
sounds[url] = s;
log(sounds[url]+' registered.');
}
function startSound(url) {
log("Starting sound: "+url);
log(sounds[url]);
s = sounds[url];
s.start();
s.onID3 = function() {
for(var i in s.id3){
log(i+':'+s.id3[i]);
}
}
}
function log(mess) {
ExternalInterface.call('console.info', 'Flash: '+mess);
}
ExternalInterface.addCallback("startSound", this, startSound);
ExternalInterface.addCallback("registerSound", this, registerSound);
Thanks for the help!
View Replies !
View Related
Looping Sound Using Sound Object...
Hi i have the following AS code:
ActionScript Code:
var song_sound:Sound = new Sound();
song_sound.attachSound("background_music");
btnSoundOn.onRelease = function() {
song_sound.start();
};
btnSoundOff.onRelease = function() {
song_sound.stop();
};
At the moment on clicking sound on, it plays the track once, is there a way i can make it loop continuously?
View Replies !
View Related
Sound Object - Specifying Only Certain Sound To Stop
Hi everyone. I'll try to make this as brief as possible. I am creating a flash project which contains video on a few pages. The project also contains background music which loops contiuously.
The goal is to have the background music stop whenever the user is on a page containing video and for the music to play again when the user leaves said page.
The script I created works to stop the music, but it also stops the audio contained within the video and causes the video player (by proxxus) to lock up.
The solution is probably a simple one, but I'm having difficulty figuring it out.
If anybody can see where I've gone wrong, your help would be greatly appreciated. Here's the setup:
Library:
music.wav - linkage = "myMusic01"
Main Timeline:
Code:
//-- create a variable to determine if the current movie contains video
var currMovie:String = "notVideo";
//-- start playing sound object
myMusicMc.myMusic.start(0, 999);
myMusicMc (residing on main timeline)
frame 1
Code:
//-- set up sound object
myMusic=new Sound();
myMusic.attachSound("myMusic01");
frame 2
Code:
//-- check the variable "currMovie"
if (_root.currMovie == "Video") {
_root.myMusicMc.myMusic.stop();
} else {
_root.myMusicMc.myMusic.play();
}
frame 3
Code:
//-- create a loop to continuously check the variable
gotoAndPlay(2);
on the actions layer of the movie clip containing my navigation controls
snippet of the callback used
Code:
videoLink_mc.onRelease = function() {
_parent.prodDetail_mc.gotoAndPlay("video");
_root.currMovie="Video";
}
on all the other buttons currMovie is set to "notVideo"
View Replies !
View Related
Sound Object
Hi everybody!
Can anybody tell me where I can learn about the sound object in Flash??
I already know how to put sound in the "classic" way in flash, but I need something much complex.
I tried with actionscript documentation but I couldn´t understand.
Thank you very much.
Best regards,
Strato
View Replies !
View Related
Sound Object
please help
mix is sound object
mix.start(0,50);
mix plays, 50 loops right?
how does flash know it's done with 50 loops ?
and doesn't play sound again.
there must be a counter in there somewhere.
what is it, how do i get to it.
please, anybody know?
how about this.
mix.start()
sound is playing
is there a boolean test?
true when sound is looping
false after looping done, sound off?
help, i've been looking for 6 hours.
thank you,
^_^
View Replies !
View Related
Sound Object
Is there a way to have sound object load an outside file then so that u can have many sounds but still keep the main movie small? if ther is how? Thx a lot!
Charles <><
View Replies !
View Related
Can Everyone Try This One Concerning Sound Object
Basically I'm bringing in a sound dynamically - I have imported a sound gone to linkage called my sound "adultTune4" clicked Export for ActionScript and Export for first frame
Right on the first frame of the main timeline I have this
function goPlay(){
moviesound = new Sound();
moviesound.attachSound("adultTune4")
moviesound.start(5,0);
}
I then have a button with this(which is simply a call to the function
on (release) {
goPlay();
}
Great this works my tune starts playing 5 seconds into it
however when I simply replace
on (release) with on (keyPress "Enter") (with the arrows around Enter dont show up in this post)
It fails to play my tune at all!!!!!
very frustrated - does anyone know why??? or how to resolve this problem
thanks in advance
View Replies !
View Related
Sound Object
It seems I've seen this posted before, but I couldn't find it. I'm using sound objects, and when I stop one sound, all sounds stop. I don't mean using stopAllSounds(). I mean:
_root.mysound.stop()
Which, I thought should only stop "mysound," but it stops all sounds. Anyone know what's up with this?
It would also be helpful to know if anyone else has sucessfully used the stop() with a sound object and NOT had the background sounds stop (like stopAllSounds). This way I would at least know that what I need to do is possible.
Thanks very much.
View Replies !
View Related
Sound Object
I want to use the sound in my library rainHeavy with the sound object. I have a movie clip called heavyRain to have the sound attached.
What I'm using now is:
RainHeavy = new Sound(heavyRain);
RainHeavy.attachSound("rainHeavy");
RainHeavy.start(1,999);
this doesnt work.
I have read through the help files exstensively and it doesn't help. If you could give me some brand new code, or maybe spot whats wrong with mine... it would be great.
View Replies !
View Related
Sound Object
I want to use the sound object that the user can control the volume of sound they here but I can't figure out how to get the sound to loop when I add it programatically.
Can anyone help?
thanks,
Jeff
View Replies !
View Related
Sound Object With Mac OS X
hi everyone,
i'm using code like this:
mySound.setVolume(0);
to mute streaming sound. ist works fine (as it should). except for mac osx obviuosly because i still can hear the sound there - using either ie or mozilla.
is this a bug and is there another possibility to mute the sound (streaming sound, not event sound)?
thx
eman
View Replies !
View Related
|