Sound Object And Preloader
How do you use the Sound Object without having to wait for the sound to load before the preloader of the movie is visible ?
FlashKit > Flash Help > Flash ActionScript
Posted on: 03-07-2003, 07:08 AM
View Complete Forum Thread with Replies
Sponsored Links:
Preloader / Sound Object
I got some problems with my preloader:
I've insert a preloader-scene before my main scene. In this preloader-scene I have following code:
if (_framesloaded<_totalframes) {
gotoAndPlay(_currentframe-1);
}
now this worked perfectly until I stopped dragging soundfiles into frames but making sound objects instead:
frame1 of main scene:
loopSound = new Sound();
loopSound.attachSound("loopAcid");
loopSound.setVolume(70);
loopsound.start(0,999);
Since the code for the preloader isnt in frame 1, but the sound objects are loaded in frame 1 though, the preloader starts after all sound is loaded instead of before.
Can anyone tell me how I could make the soundobjects load after my preloader starts - on command ie?
(using Flash MX)
View Replies !
View Related
[FMX] MP3 Preloader And Sound Object
Hi all,
Houston? I have a problem... (no, really? hmmm... yes!)
Excuse my broken English (I will try to be clear).
I'm creating a MP3 jukebox for my website, a Movie Clip (MC) named "miniJuke". A function "preloadSound" is called, and should preload my sound object. But it doesn't work : I get a NaN until the movie is fully loaded and then I get 100.
Here is my code :
Quote:
// the sound preloader function, where "pieceOfCake"
// is the path to find my MP3
function preloadSound(pieceOfCake){
this.createEmptyMovieClip ("tempLoader",this);
tempLoader.onEnterFrame = function() {
var bl = mySound.getBytesLoaded();
var bt = mySound.getBytesTotal();
var p = isNaN(bt)?0 : Math.floor(bl*100/bt);
if (p < 100){
_root.miniJuke.percent.text = p;
trace ("that works ?");
}else{
mySound.start (0,99);
mySound.isPlaying = true;
tempLoader.removeMovieClip();
}
};
mySound.loadSound(pieceOfCake,false);
};
"percent" is a textfield, "mySound" is the sound object.
The "trace" instruction (that works?) is never displayed, so, i think than "p" is never lower than "100".
How to preload "mySound" correctly ?
I really need help.
Thx.
View Replies !
View Related
Sound Object On Preloader
Hello all,
I have a sound object issue that has me stumped. I have a simple bar preloader that loads an flv. That works fine. I want to have a sound play while the flv preloads. So I used the Sound class. On the 1st frame I have
mySound = new Sound ();
mySound.attachSound ("bcl");
mySound.start (0, 1);
This works, the sound plays and everything, but it plays as long as the preloader is playing. I only want the sound to play once. I thought the 2nd argument for the start() method was a value to set how many times it plays.
I think it has something to do with my preloader code:
Frame 1:
var percent = (Math.floor (_root.getBytesLoaded() / _root.getBytesTotal() *100));
if(percent == 100){
gotoAndPlay(3);
}else{
gotoAndPlay(1);
}
Frame 2:
gotoAndPlay(1);
Since the preloader code is telling Flash to go back to frame one, which is where the Sound object code is, so it repeats until the movie is loaded. How do I get the sound to only play once while preloading?
What am I missing? Any help is greatly appreciated.
Greg
View Replies !
View Related
Preloader And Sound Object
My Flash site has a media player which uses the attachSound method to play and skip through 3 mp3s. As a result the preloader shows up after the movie has loaded 60%. To rectify this, i changed the Publish Settings under the Flash Tab so that the classes for AS 2.0 load in the 2nd frame of the Preloader Scene(I have separated the preloader and the main movie to diffrerent scenes..)
I read it somewhere that to correct a similar problem with MCs, you need to place them somewhere in the timeline (say,Off Stage), But how can same be done for Sound Objects.???
View Replies !
View Related
[AS] MP3 Preloader And Sound Object
Hi all,
First time I post on this great website.
And... I have a problem... (no, really? hmmm... yes!)
Excuse my broken English (I will try to be clear).
I'm creating a MP3 jukebox for my website, a Movie Clip (MC) named "miniJuke". A function "preloadSound" is called, and should preload my sound object. But it doesn't work : I get a NaN until the movie is fully loaded and then I get 100.
Here is my code :
Quote:
// the sound preloader function, where "pieceOfCake"
// is the path to find my MP3
function preloadSound(pieceOfCake){
this.createEmptyMovieClip ("tempLoader",this);
tempLoader.onEnterFrame = function() {
var bl = mySound.getBytesLoaded();
var bt = mySound.getBytesTotal();
var p = isNaN(bt)?0 : Math.floor(bl*100/bt);
if (p < 100){
_root.miniJuke.percent.text = p;
trace ("that works ?");
}else{
mySound.start (0,99);
mySound.isPlaying = true;
tempLoader.removeMovieClip();
}
};
mySound.loadSound(pieceOfCake,false);
};
"percent" is a textfield, "mySound" is the sound object.
The "trace" instruction (that works?) is never displayed, so, i think than "p" is never lower than "100".
How to preload "mySound" correctly ?
I really need help.
Thx.
View Replies !
View Related
Preloader For Sound Object
I have a movie with three songs using the following code in frame 2:
Code:
song1 = new Sound();
song1.attachSound("song01", "song001", 1);
song2 = new Sound();
song2.attachSound("song02", "song002", 1);
song3 = new Sound();
song3.attachSound("song03", "song003", 1);
sound1_btn.onRelease = function() {
_root.mc_menu.soundRelease.gotoAndStop(2);
song1.start();
};
sound2_btn.onRelease = function() {
_root.mc_menu.soundRelease.gotoAndStop(3);
song2.start();
};
sound3_btn.onRelease = function() {
_root.mc_menu.soundRelease.gotoAndStop(4);
song3.start();
};
stop_btn.onRelease = function() {
_root.mc_menu.soundRelease.gotoAndStop(1);
stopAllSounds();
};
In frame 1 i have the following preloader script:
Code:
this.onEnterFrame = function(){
tb = this.getBytesTotal();
lb = this.getBytesLoaded();
if(lb >= tb){
delete this.onEnterFrame;
gotoAndStop(2);
}
}
and a text saying that the sound is loading. But when I play the movie i doesn't show the text. What am i doing wrong?
View Replies !
View Related
Sound Object On A Preloader
Hello all,
I have a sound object issue that has me stumped. I have a simple bar preloader that loads an flv. That works fine. I want to have a sound play while the flv preloads. So I used the Sound class. On the 1st frame I have
mySound = new Sound ();
mySound.attachSound ("bcl");
mySound.start (0, 1);
This works, the sound plays and everything, but it plays as long as the preloader is playing. I only want the sound to play once. I thought the 2nd argument for the start() method was a value to set how many times it plays.
I think it has something to do with my preloader code:
Frame 1:
var percent = (Math.floor (_root.getBytesLoaded() / _root.getBytesTotal() *100));
if(percent == 100){
gotoAndPlay(3);
}else{
gotoAndPlay(1);
}
Frame 2:
gotoAndPlay(1);
Since the preloader code is telling Flash to go back to frame one, which is where the Sound object code is, so it repeats until the movie is loaded. How do I get the sound to only play once while preloading?
What am I missing? Any help is greatly appreciated.
Greg
View Replies !
View Related
Sound Object / Scene / Preloader Help
My knowledge of Flash MX is limited - especially ActionScript and I was trying to play around with sound objects because I can code but I seem to have a problem with launching them. My basic problem is this - I have 2 sound files that I want to put into a 'loader' the first one will play with the very start of the loader and set pictures to a set amount of time and then the second will loop continuously whilst 6 loading pages load.
So I thought put an Action Script command on my time line within my 'Loader Scene' to start the 2nd looping sound which I have definied at about frame 700 but for some reason the 2nd one doesn't play?!
My question is this - if you use the 'Linkage' method with sound objects what actually starts it off - because nothing happens - fair enough I understand exactly what 'Kenny SomethingOrOther' is saying on his tutorial but that's with buttons setting off the start and only works with an 'On ..' command because i get debug errors if i take it out. I just want to do it with Action Script related to a point in time within my 'Scene' and not user intervention ;
Do I need to put it in a 'Movie Clip' (I've tried that), do I need to put the sound somewhere special or is there a command i can put at the start of my scene which says start this loop at this frame?
Cheers in advance for any help - and if you live in East London I'll buy you a pint - because this is driving me nuts!
www.quitebad.com
View Replies !
View Related
Sound Object And Preloader Issue
Hi Folks!
Has anyone got an angle on the interference that linkage can create when the "export in first frame" option is ticked? I am using attachSound and the sound object to load an mp3 but it is wreaking havoc with the preloader.
If I uncheck the "export in first frame" box the sound does not seem to be instantiated. I believe that a way around this is to drag the sound onto the stage, but if you have 8 sounds for buttons for example, then you would have to create 8 sound layers - this seems a bit clunky to me!
My preloader code is:
Code:
stop();
_root.preloaderGraphics._visible = false;
this.onEnterFrame = function() {
if (this.getBytesLoaded()<this.getBytesTotal()) {
_root.preloaderGraphics._visible = true;
Total = this.getBytesTotal()/1000;
Received = this.getBytesLoaded()/1000;
Percentage = (Received/Total)*100;
_root.preloaderGraphics.percent = Math.round(Percentage)+"%";
_root.preloaderGraphics.progressBar._xscale = Percentage;
} else {
this.gotoAndPlay("intro");
this.onEnterFrame = null;
_root.preloaderGraphics._visible = false;
}
};
The preloaderMC also gets used by externalised swf files that are loaded into an empty MC with the instance name of "container".
I am loading the sound object like this:
Code:
var reviews:Sound = new Sound(this);
reviews.attachSound("kicksFM");
reviews.start();
As stated it makes the preloader initially display at 70% after an unacceptable lag!
Cheers
Andy
View Replies !
View Related
[AS]Preloader + Buffering Ext. MP3 Sound Object
First of all, This forum has been a big help to me. Thanks for this great resource.
Anyways here is my question.
I have a preloader that preloads the intro to the site. Right now I have the mp3 embedded into the flashmove and it plays on the last frame in my intro. My problem is that makes the filesize of the SWF extremely huge. Here is what I want to do:
I created a new sound object, its source is going to be a external mp3 on the server, and i want it to "Stream". But I also need it to play right away when I call it. So can I pre-buffer it though the preloader with out the preloaded trying to load the whole mp3 in? Or buffer the mp3 while the intro is playing? My solution is to have optimal load time.
Here is my preloader code:
ActionScript Code:
// get size and calculate %
sofar = _root.getBytesLoaded();
total = _root.getBytesTotal();
percent = sofar/total;
percentnext = Math.round((sofar/total)*100);
percentdisplay = Math.floor(percent*100)+"%";
// when done preloading: start
if (percentnext == 100) {
gotoAndPlay("start");
}
Here is my sound object code:
ActionScript Code:
soundtrack = new Sound(_root);
soundtrack.loadSound("soundtrack.mp3",true);
and I would call the soundobject to play on the frame using
ActionScript Code:
soundtrack.start(0,999);
SO is there away to buffer the audio while the into is running and then play it on the last frame.?
Thanks in Advanced.
View Replies !
View Related
Sound Object Stalling My Preloader...
The problem:
I load my audio first in the animation and then I start my byte counter (preloader)...but when I upload the flash file and view it in a browser I get nothing but a blank screen until the flash movie is 60% loaded.
Has anybody ever seen this and, if so, solved it??
what I want:
I need to use the Sound object to control my audio because I want to do a "fade out" when somebody moves to a different section of the animation.
here's how I set it up:
f1: I create a sound object and use my_mc.attachSound("ID name") to attach my audio from the library (setting a linkage name of course).
using attachSound directly effects the loading of my flash file. If I, for example, load another swf file with audio directly on the stage this doesn't happen.
f2-f4: I start all of the preloader loop so I can count down the bytes loaded, etc.
f5: movie starts...
Any ideas?
THANKS!
j.o.s.
View Replies !
View Related
Preloader For Movie With Linked Sound Object?
Hi,
I'm working on an audio player and am using the sound object linked from the library, rather than loaded externally. The MP3 is large (8MB), and plays fine (play, ff, rw, pause, stop) once loaded. The problem is that the entire .swf has to load before playing.
How (if I can) am I able to put a preloader in the first frame of the .swf? I've tried, but the preloader does not appear while the .swf is loading.
I'm new with Actionscript, so am not familiar with many audio techniques. I've searched the forums for an answer, but have found none.
Here is a link to the audio player...be warned - 8MB!
link to HTML page link to SWF file
thanks guys
View Replies !
View Related
Preloader Wont Work With My Sound Object.
Hello All.
I have a question about my preloader.
My sound object seems to be downloaded first rather than the preloader being displayed first.
I understand it probably has to do with the fact that I exported the soundobject in the first frame under linkage but I am not sure how to resolve my problem.
If I unclick the "Export into first Frame" option my sound doesn't seem to be playing.
I have used looping sounds in MCs and my preloader is working for those, but this time I want to use the sound object as shown below.
My current home page is http://www.fiskdesign.net
What I would like to do is to have my preloader display first and then the sound to start playing along with the animation.
(I attached below my AS I am currently using.)
I am greatful for any suggestions.
Henrik
// Pre Load Function
assessLoad = function (clip, endPreloadFunc) {
var kbLoaded = clip.getBytesLoaded()/1024;
var kbTotal = clip.getBytesTotal()/1024;
var percent = Math.floor(kbLoaded/kbTotal*100);
loaded.text = Math.floor(kbLoaded)+"Kb";
total.text = Math.floor(kbTotal)+"Kb";
bar._xscale = percent;
if ((kbLoaded/kbTotal == 1) && kbLoaded>1) {
endPreloadFunc();
}
};
endPreload = function () {
clearInterval(preload);
};
preload = setInterval(assessLoad, 100, this, endPreload);
// attach sound object
s1 = new Sound();
s1.attachSound("s1");
s1.start(0, 99999);
trace(s1.getVolume());
s1.setVolume(30);
play();
View Replies !
View Related
Sound Object / Scene / Preloader Help Needed
My knowledge of Flash MX is limited - especially ActionScript and I was trying to play around with sound objects because I can code but I seem to have a problem with launching them. My basic problem is this - I have 2 sound files that I want to put into a 'loader' the first one will play with the very start of the loader and set pictures to a set amount of time and then the second will loop continuously whilst 6 loading pages load.
So I thought put an Action Script command on my time line within my 'Loader Scene' to start the 2nd looping sound which I have definied at about frame 700 but for some reason the 2nd one doesn't play?!
My question is this - if you use the 'Linkage' method with sound objects what actually starts it off - because nothing happens - fair enough I understand exactly what 'Kenny SomethingOrOther' is saying on his tutorial but that's with buttons setting off the start and only works with an 'On ..' command because i get debug errors if i take it out. I just want to do it with Action Script related to a point in time within my 'Scene' and not user intervention ;
Do I need to put it in a 'Movie Clip' (I've tried that), do I need to put the sound somewhere special or is there a command i can put at the start of my scene which says start this loop at this frame?
Cheers in advance for any help - and if you live in East London I'll buy you a pint - because this is driving me nuts!
www.quitebad.com
View Replies !
View Related
Sound Object / Scene / Preloader Help Needed
My knowledge of Flash MX is limited - especially ActionScript and I was trying to play around with sound objects because I can code but I seem to have a problem with launching them. My basic problem is this - I have 2 sound files that I want to put into a 'loader' the first one will play with the very start of the loader and set pictures to a set amount of time and then the second will loop continuously whilst 6 loading pages load.
So I thought put an Action Script command on my time line within my 'Loader Scene' to start the 2nd looping sound which I have definied at about frame 700 but for some reason the 2nd one doesn't play?!
My question is this - if you use the 'Linkage' method with sound objects what actually starts it off - because nothing happens - fair enough I understand exactly what 'Kenny SomethingOrOther' is saying on his tutorial but that's with buttons setting off the start and only works with an 'On ..' command because i get debug errors if i take it out. I just want to do it with Action Script related to a point in time within my 'Scene' and not user intervention ;
Do I need to put it in a 'Movie Clip' (I've tried that), do I need to put the sound somewhere special or is there a command i can put at the start of my scene which says start this loop at this frame?
Cheers in advance for any help - and if you live in East London I'll buy you a pint - because this is driving me nuts!
www.quitebad.com
View Replies !
View Related
Preloader Doesn't Work Properly With My Sound Object.
Hello All.
I have a question about my preloader.
My sound object seems to be downloaded first rather than the preloader being displayed first.
I understand it probably has to do with the fact that I exported the soundobject in the first frame under linkage but I am not sure how to resolve my problem.
If I unclick the "Export into first Frame" option my sound doesn't seem to be playing.
I have used looping sounds in MCs and my preloader is working for those, but this time I want to use the sound object as shown below.
My current home page is http://www.fiskdesign.net
What I would like to do is to have my preloader display first and then the sound to start playing along with the animation.
(I attached below my AS I am currently using.)
I am greatful for any suggestions.
Henrik
// attach sound object
s1 = new Sound();
s1.attachSound("s1");
// Pre Load Function
assessLoad = function (clip, endPreloadFunc) {
var kbLoaded = clip.getBytesLoaded()/1024;
var kbTotal = clip.getBytesTotal()/1024;
var percent = Math.floor(kbLoaded/kbTotal*100);
loaded.text = Math.floor(kbLoaded)+"Kb";
total.text = Math.floor(kbTotal)+"Kb";
bar._xscale = percent;
if ((kbLoaded/kbTotal == 1) && kbLoaded>1) {
endPreloadFunc();
}
};
endPreload = function () {
clearInterval(preload);
};
preload = setInterval(assessLoad, 100, this, endPreload);
http://www.flashkit.com/board/newthread.php#
View Replies !
View Related
[F8] How To Make Preloader And Sound Object Play Nice?
'm building this file, and it's not an unusual, or even very challenging file. It's a long keyframe timeline animation, with a mute on/off button for the one sound object, and a pause/start button to control the whole movie.
Everything works, until I try to introduce a preloader.
Seems like preloaders and soundobjects don't like each other.
I've tried:
- preloader in main file: won't display the preload animation, whether or not the soundobject is exported to first frame (from linkages menu).
- external preLoader swf, with loadClip. This works, EXCEPT that the sound will only play if it's in the timeline. If I introduce the sound in the main movie as a soundobject, it plays in the main movie, but not when it's preloaded through an external preloader swf.
Now, I can think of a few things, but I'm a little daunted by the prospects.
1) Is there a way to control sound volume (only one sound file in entire file), without introducing the mp3 in a sound object? If yes, what/where?
2) I can use Ken Bellow's tutorial code
( http://www.kennybellew.com/tutorial/...ttachsound.htm )
to create an external swf containing only the audio file, and then use loadSound in the main movie to create a preloader for the sound only, but i still have another 800k or so in the main movie that I need to preload, so I need to preload BOTH the audio and the main file, and I don't know how to create a VAR that adds both of those, and base the percentloaded on that.
Any advice/guidance greatly appreciated. There are so many flash files with audio and UI, this must be a problem people deal with all the time....
Thanks!
View Replies !
View Related
How To Make Preloader & Sound Object Play Nice?
I'm building this file, and it's not an unusual, or even very challenging file. It's a long keyframe timeline animation, with a mute on/off button for the one sound object, and a pause/start button to control the whole movie.
Everything works, until I try to introduce a preloader.
Seems like preloaders and soundobjects don't like each other.
I've tried:
- preloader in main file: won't display the preload animation, whether or not the soundobject is exported to first frame (from linkages menu).
- external preLoader swf, with loadClip. This works, EXCEPT that the sound will only play if it's in the timeline. If I introduce the sound in the main movie as a soundobject, it plays in the main movie, but not when it's preloaded through an external preloader swf.
Now, I can think of a few things, but I'm a little daunted by the prospects.
1) Is there a way to control sound volume (only one sound file in entire file), without introducing the mp3 in a sound object? If yes, what/where?
2) I can use Ken Bellow's tutorial code
( http://www.kennybellew.com/tutorial/...ttachsound.htm )
to create an external swf containing only the audio file, and then use loadSound in the main movie to create a preloader for the sound only, but i still have another 800k or so in the main movie that I need to preload, so I need to preload BOTH the audio and the main file, and I don't know how to create a VAR that adds both of those, and base the percentloaded on that.
Any advice/guidance greatly appreciated. There are so many flash files with audio and UI, this must be a problem people deal with all the time....
Thanks.
View Replies !
View Related
Preloader Problem - _root.getBytesLoaded() Doesnt Include Sound Object?
I am using a function based on _root.getBytesLoaded() in a preloader progress bar, which I always use and works fine
I am working on a particular project that has quite a large sound track file, and since adding this, the preloader doesnt work right, the screen is blank for about 8 seconds before the preloader appears, and even then the progress bar is about 90% complete when it DOES appear.
Am I right in thinking that the large sound file is being ignored (removing it cures the delay)
FYI, the movie is 2 scenes, first is the preloader. The sound object for the big file is declared at the start of scene 2
Thanks!
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
Loop Sound ( Sound Class Preloader By Moock)
how can i loop the sound if i use the sound class preloader by collin moock?? here its the code :
ActionScript Code:
Sound.prototype.checkLoadProgress = function() {
var kbLoaded = Math.floor(this.getBytesLoaded()/1024);
var kbTotal = Math.floor(this.getBytesTotal()/1024);
var percentDone = isNaN(Math.floor(kbLoaded/kbTotal*100)) ? 0 : Math.floor(kbLoaded/kbTotal*100);
this.onBytesLoaded(this.getBytesLoaded(), this.getBytesTotal(), kbLoaded, kbTotal, percentDone);
};
Sound.prototype.clearLoadCheck = function() {
if (this.loaderID) {
clearInterval(this.loaderID);
}
};
Sound.prototype.preloadSound = function(url, isStreaming) {
this.clearLoadCheck();
this.loaderID = setInterval(this, "checkLoadProgress", 200);
this.loadSound(url, isStreaming);
};
music = new Sound();
music.onLoad = function(success) {
this.clearLoadCheck();
if (success) {
loadMsg_txt.text = "Done loading.";
} else {
loadMsg_txt.text = "Load failed.";
}
};
music.onBytesLoaded = function(bytesLoaded, bytesTotal, kbLoaded, kbTotal, percentLoaded) {
loadMsg_txt.text = "Loading: "+kbLoaded+" of "+kbTotal+"
"+percentLoaded+" percent complete.";
};
music.preloadSound("song.mp3", true);
thanks in advance
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
Help With Sound Object Please...
Hello everyone.
I'm working with the sound object and I need to know if it is possible to get the name of the attached sound. For example, if I do this:
firstSound=new Sound();
firstSound.attachSound("firstSound01");
Is there a function that returns "firstSound01"?
You know, something like this:
function returnName(){
return (firstSound.getmyNamePlease);
}
Anyone have any ideas... thanks for everyone's time!
Javier Cerdas
Atlanta, GA
View Replies !
View Related
|