Preloading Sound And Video Simultaniously
I'm loading some swf's that only contain video (with integrated sound) using the Loader componant. Everything's working fine, except that I want the video to start to play after a 35% of the swf has loaded. Problem is when the video begins play there's sound but no video until the swf is completely loaded. If I use a MovieClipLoader everything loads together, but with the testing glitch, it'd make my life a lot easier if I could just use the Loader componant.
Anyone know how to get the sound and video of an swf to load at the same time using the Loader component???
'preciate it! -mother
ActionScript.org Forums > Flash General Questions > Other Flash General Questions
Posted on: 10-21-2004, 09:17 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Getting Code To Work Simultaniously
i have been trying to get a button to change size when rolled over, and continue to grow and shrink until you roll off. i did this by creating a movie clip which loops. it works fine. i cant however get this to work aswell as loading a different movie when the button is clicked, both my pieces of code work independantly when 1 lot is commented out, but they jsut wont work together.
please help!
[F8] Mutiple Mp3 Players Simultaniously
Im making a website to do with generative music and need to make a flash app that contains 2-4 mp3 players that start simultaniously, playing different music when a button is pushed. I was wondering how i might go about this, i have an mp3 player i have been using.
I was wondering if i would be able to somehow copy the mp3 player i have a number of times into a new flash file on an invisible layer and make a button that starts them simultaniously?
Or is it possible to do it within an html page, linking swf files to each other, having 2 mp3 players as seperate swfs and a 3rd swf that is a button that starts the mp3 players?
Any help would be greatly apreciated.
Many thanks
Alex
Calling Function From Different Movieclips Simultaniously
Hi,
I've got a function on the main timeline that has to be called by different mc's. It works fine except when the function is called from two mc's at the same time. There's the code:
Code:
// FUNCTION TRANSFORM transform colour and size
function transform(mc_name){
trace ("enter transform");
if (_root[mc_name][mc_name+"_fill"]._visible == 0 && _root[mc_name][mc_name+"_fill"]._xscale == 100){
_root[mc_name][mc_name+"_fill"]._alpha = 0;
_root[mc_name][mc_name+"_fill"]._visible = 1;
}
if (_root[mc_name][mc_name+"_fill"]._alpha < 100){
_root[mc_name][mc_name+"_fill"]._alpha++;
}
else {
_root[mc_name][mc_name+"_fill"]._alpha == 100;
if (_root[mc_name]._xscale > 20){
_root[mc_name]._xscale = _root[mc_name]._yscale--;
}
else {
_root[mc_name]._xscale = _root[mc_name]._yscale = 20;
clearInterval(transform_interval_id);
trace("clear interval");
}
}
};
//
// FUNCTION PRESS_MC mc is pressed
function press_mc (mc_name){
trace("press func");
if (_root[mc_name]._xscale == 20){
// make fill object invisible
_root[mc_name][mc_name+"_fill"]._visible = 0;
// make img object visible
_root[mc_name][mc_name+"_img"]._visible = 1;
// scale img object
_root[mc_name]._xscale = _root[mc_name]._yscale = 100;
// create unique interval, call transform function
transform_interval_id = setInterval(_root.transform, 100, mc_name);
}
};
As you can see I use a clearInterval. It stops the function on all the movieclips and not just on the clip that's finished.
Is there an easy way to prevent this while still keeping my code central?
Thanks very much in advance, Danielle.
Unable To Simultaniously Download Multiple Mp3s
I've been developing a mp3 player which loads multiple mp3 which are different tracks in a song. The idea is to allow someone to turn on/off tracks to help understand how a song is composed.
I've implemented a SoundObj class to encapsulate the methods I need to control sound loading/playback.
ActionScript Code:
public function SoundObj(url:String):void {
snd = new Sound();
theurl = url;
// register event listeners
snd.addEventListener(Event.OPEN, onSoundOpen);
snd.addEventListener(Event.COMPLETE, onSoundLoaded);
snd.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
snd.addEventListener(Event.ID3, onID3InfoReceived);
snd.addEventListener(Event.SOUND_COMPLETE, onPlaybackComplete);
// initialize fields
sndContext = new SoundLoaderContext(1000, false);
req = new URLRequest(url);
snd.load(req, sndContext);
positionTimer = new Timer(100);
}
When I attempt to load the multiple sound files, I noticed that multiple onSoundOpen methods are executed asynchronously (I assume on different threads after snd.load is executed), but then onLoadProgress shows that only one file is being loaded at time. The application loads them serially - once one file is completed, it starts on the next one. Is there a way to configure my application so that I can open multiple sockets (or something equivalent)? Or is this a limitation of the flash player?
Thanks,
GF
Video Preloading In MX
I have a site with a video presentation in 3 languages.
It loads 3 MP3s of the same speech in 3 languages simultaniously.
Once those speeches are loaded it starts the download of a swf containing the video. A script checks the time remaining for the video to load and if it's ok it starts the playback.
http://www.pixelpharmacy.com
Works great on PC but on a MAC os9 the player freezes until the video is fully loaded.
Is there a way to make a loaded swf "fast start" on Mac?
Preloading Video?
Hello,
How can I preload some video that's being pulled into a Target so that when I want to view the video later in the site, it's already chached? Also, I don't want to bog down the flash player, so perhaps after the loading animations? I just want it to be loaded, not play. So, again, just sitting there loaded into cache until I want to tell it to act later on, at some point.
Preloading SWF Video
Im using Sorenson to make a swf video file. I would like to preload the swf file because Sorenson does not add one. Using the load movie command how do I preload the video swf displaying totalbytes a bar and all that jazz. Anyone got any code?
Preloading Video?
Hello,
How can I preload some video that's being pulled into a Target so that when I want to view the video later in the site, it's already chached? Also, I don't want to bog down the flash player, so perhaps after the loading animations? I just want it to be loaded, not play. So, again, just sitting there loaded into cache until I want to tell it to act later on, at some point.
Video And Preloading
Hi everyone.
I'm trying to use Macromedia's Flash for streaming video.
The thing is, the file size is huge, now i dont minf the size but inorder to watch it viewers will have to wait for the loading to end, which is bad having the file reach 70MB and more.
My question is, can i have flash to precache only some of the swf file before playing it and then, while playing it continue loading the file to it's end?
I'll very much appriciate any help, =)
Era.
Preloading Video
Preloading Video
Preloading Video
I know I'm on the right track, I'm just having a small problem.
I have an external .swf with an embeded video. I've created a two ketframe preloader with a looping animation for the .swf with the video. When I export the video the preloader runs and then plays the video.
The .swf with the video is loaded into a target clip called workTarget. This clip is inside another target clip called target.
Here's the script on the first keyframe:
if (_framesloaded == 1250) {
gotoAndPlay(3);
}
Second keyframe:
gotoAndPlay(1);
When I load the .swf with the video into the CD ROM I'm creating the preloader animation just loops. It never jumps to frame 3 and plays the movie.
Is my target path incorrect? Should I use an expression instead of a frame number? Any help would be greatly appreciated. Thanx ahead of time.
Preloading Video
I know I'm on the right track, I'm just having a small problem.
I have an external .swf with an embeded video. I've created a two ketframe preloader with a looping animation for the .swf with the video. When I export the video the preloader runs and then plays the video.
The .swf with the video is loaded into a target clip called workTarget. This clip is inside another target clip called target.
Here's the script on the first keyframe:
if (_framesloaded == 1250) {
gotoAndPlay(3);
}
Second keyframe:
gotoAndPlay(1);
When I load the .swf with the video into the CD ROM I'm creating the preloader animation just loops. It never jumps to frame 3 and plays the movie.
Is my target path incorrect? Should I use an expression instead of a frame number? Any help would be greatly appreciated. Thanx ahead of time.
.stop() For Sound Object Stopping Embedded Video Sound
I have a problem where the stop funtion for a sound object is stopping the audio in an embedded video. Has anyone ever encountered this? Ihave poured over my code and there is no cross-linked intance names, so I do not have a clue what is happening.
Preloading External Video
I know this has been asked before but never FULLY resolved - so I am back!
Been looking everywhere on how to easily do this. Something always goes wrong. I have a blacnk movie clip that I load external videos (swf files that contain video) into this blank movieclip. I want to initally stop the video (easy enough), pop up a progress bar that shows the percentage loaded and once done, play the movie. You would think this would be easy enough but sometimes the video size of the 2nd or 3rd clip loaded doesn't show up, etc.
Can anyone point me to a resource or fork me some actionscript that will allow me to take care of all of this easily? Thanks!
:::Flash Video Preloading?
for some reason, preloading embedded video is NOT working using the getBytesLoaded() method....anyone know how to work around this??? My goal is basically to be able to show video clips effectively with flash....I've seen other flash sites do it....(I am using flash 6)
fla here
help anyone please?
XML To Flash To Preloading Of Video
Hi there.
Just wondered if could help me figure out how to preload a video file (.flv), when the only reference I have is in the XML.
I have already loaded in the xml, and I wish to preload the video (but not show it), so that I can "get" it later in the animation.
Is this possible?
Thanx
Embeded Video And Preloading...
Hi!
I have a quicktime video, 3mb or so in size. I can import it into Flash and it puts it on the timeline with about 300 frames. So I save this as a SWF.
So in another movie I want to load this SWF in... but I want it to stream if possible. How can I get this movie SWF to stream in and play when enough of the video is loaded so the user can watch the video and load the rest without any breaks or pauses in the video due to not enough of the file loaded?
Does that make sense?
Is that possible?
Thanks.
DryCow
PB Preloading Swf Containing Stream Video AS
Hello,
it seems i have problems to preload my swf documents containing
embed streaming video (flv)(netStream object, no components).
THe prelaod MC bar keeps on loading again and again without
going to image 2.
Here is the simple code i use with preload bar:
Code:
onClipEvent (enterFrame) {
this.preload() ;
}
and the code on the action layer (image 1):
Code:
movieClip.prototype.preload = function() {
this.Total = _root.getBytesTotal();
this.Charge = _root.getBytesLoaded();
this.rapport = Math.round((this.Charge)/(this.Total)*100);
_root.progression = Math.round(this.rapport)+" %";
this.gotoAndPlay(this.rapport);
if (this.rapport == 100) {
gotoAndPlay(2);
}
};
This code works with every other type of documents,
so i wonder if there is not a conflict with embed video AS somewhere...
Can someone help here?
Embeded Video And Preloading...
Hi!
I have a quicktime video, 3mb or so in size. I can import it into Flash and it puts it on the timeline with about 300 frames. So I save this as a SWF.
So in another movie I want to load this SWF in... but I want it to stream if possible. How can I get this movie SWF to stream in and play when enough of the video is loaded so the user can watch the video and load the rest without any breaks or pauses in the video due to not enough of the file loaded?
Does that make sense?
Is that possible?
Thanks.
DryCow
PB Preloading Swf Containing Stream Video AS
Hello,
it seems i have problems to preload my swf documents containing
embed streaming video (flv)(netStream object, no components).
THe prelaod MC bar keeps on loading again and again without
going to image 2.
Here is the simple code i use with preload bar:
Code:
onClipEvent (enterFrame) {
this.preload() ;
}
and the code on the action layer (image 1):
Code:
movieClip.prototype.preload = function() {
this.Total = _root.getBytesTotal();
this.Charge = _root.getBytesLoaded();
this.rapport = Math.round((this.Charge)/(this.Total)*100);
_root.progression = Math.round(this.rapport)+" %";
this.gotoAndPlay(this.rapport);
if (this.rapport == 100) {
gotoAndPlay(2);
}
};
This code works with every other type of documents,
so i wonder if there is not a conflict with embed video AS somewhere...
Can someone help here?
Video Preloading + Streaming
Preloading video
Hello guys,
I did a search, cant really find any related to my problem, so here goes..
i got a 10mb demo reel that gonna stream on flash.
Is there a way to make it stream simmilar to quicktime? such as the player will detect the user's connection speed and determine lets say it loads up to 30% and start to play the movie and stream while playing till the end.. =D
Cuz currently my video is working fine, but when i play it on the web, if my connection wasnt fast enough it starts to choke
Anyway to detect user's connection speed, and base on the speed determine how many % needed to be preloaded first so it can starts playing and streaming together without choking?
Cheers
Preloading A Video Problems
I have done some research on this but got nowhere.
I found various tutorials but realised that they used Action Script 2.0 however the video I imported needed 3.0 to play.
I have then found a tutorial which uses action script 3.0 at
http://www.gotoandlearn.com/play?id=85
When testing locally the it appears to work fine and the video plays normally. However when uploaded and load the preloader .swf file the preloader goes from 0-100 in a few seconds which seems to work fine but however then the video first frame loads then thats it!
Am I really missing something?
Help with the way Im doing it now or a different technique would really be appreciated, thank you.
Stopping Timeline's Sound But Continue The Video's Sound
Hi folks!
I need help to solve this problem. I can't seem to get it work out.
I have a music playing in Timeline (looping forever) when the flash site starts.
In some sections of the flash site, there is a video section where users can watch a video.
When the video is played, I would like to stop the sound in Timeline so it doesn't interfere with video's sound.
For loading the video, I am using Video Object, the code is simply:
var my_conn:NetConnection = new NetConnection();
my_conn.connect(null);
var my_stream:NetStream = new NetStream(my_conn);
my_video.attachVideo(my_stream);
my_stream.setBufferTime(3);
Many many thanks in advanced for your help!!
ps: I have tried following links, but no luck to me.
http://www.kirupa.com/forum/showthre...ht=sound+video
http://www.kirupa.com/forum/showthre...ht=sound+video
http://www.kirupa.com/forum/showthre...ht=sound+video
Importing And Preloading .swf Video Files
Hi,
I have a client that insists on sending me .swf video files to import into the main .fla file (which has the navigation etc..). The .swf files to be imported are pure video. The problem I'm having is that when I try to import the .swf file to the timeline, it simply inserts a bunch of empty keyframes, (the same amount as if the video were to play), but with no content. The file size of the resulting .fla file gets large as if the movie was imported, however, when I export the .fla nothing shows up.
Does anyone know what the problem is? Same thing happens when I try to "import to library" and then drag the symbol to the timeline.
Question 2, (if question one can't be solved). Is there a way to preload an external movie clip? If I take the .swf video file and loadmovie into my main timeline it works (and the video plays), but it's such a huge file that it requires a preloader. I've seen a bunch of stuff on this online, but nothing has worked properly. I need a way to preload the external video file before it starts playing from the main "root" level.
Thanks in advance for your help.
Andrej
Preloading A Movie With A Video Embedded
hi, i have problems preloading a movie which contains a video embedded. i use flash 8, i import the the video to be a part of the movie (embedded), i set up the codecs for flash 8. but my old preloader does not work at all.
this is the preloader
onClipEvent (load) {
BL = 0;
BT = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
if (BL<BT) {
BL = _root.getBytesLoaded();
PL = Math.round(100*BL/BT);
_root.pre.BL_T = BT;
_root.pre.BL_L = BL;
_root.pre.BL_P = PL;
if (BL<BT) {
_root.Pre.LB.LoadedBar._xscale = PL;
} else {
_root.Pre.LB.LoadedBar._xscale = 100;
_root.Pre.gotoAndPlay(2);
}
}
}
can anyone help me to find some preloader which works fine with video embedded files in the movie?
thank you.
Preloading An External Streaming Video
Hi, I'm relatively new to Flash and will most likely sound like an idiot while explaining my problem. I apologize for this in advance.
I'm trying to create a site that loads random streaming video clips as the central element when the homepage loads.
For each clip I
imported the video,
an flv is created,
i export the swf file.
each swf file is named in a numerical fashion, 1.swf, 2.swf, 3.swf etc.
Then in my main movie, I have a FLVPlayback component that I've placed this code on:
onClipEvent(load){
var numMovies = 2;
loadMovieNum( Math.ceil(Math.random()*numMovies)+".swf", 0);
}
This works just fine. I'm sure it's not a very good way to do it, but for me, it's just nice to see it working.
Ok, here is my question. There is most definitely a big one to two second or so long pause before each clip starts to play, and that's with broadband. I was assuming that there would be a way for me to preload these clips (or rather the initial 36K file size of the swf file). I've built a bunch of preloaders that work great for images and regular clips, but the streaming video just seems to break them.
I would really appreciate any advice. Thanks so much in advance.
Flash Video Hidden Preloading
To preface, i'm pretty new at the whole flash stuff so bare with me on some off it but any help is greatly appreciated. I'm mostly a software programmer.
What i whan to do is play 5 random swf videos (roughly 20 seconds up to 40MB in size) all residing in one folder on a local machine in a loop. Not really the standart user for flash i know.
what i tried to do first was use a php file to loop through the files by reloading after the lenth of the movie wiht the next movie.
the problem is it has to load the flash file everytime and it doens't store it in memory for some reason ( I have control of the browser using mozilla )
so possible solutions was to use loadVars and MovieClipLoader . I'm trying to take it in steps so i have this demo i'm working off:
http://www.jeebers.com/movieclip/LoadClipExample.swf
with this action script
Code:
// This example uses the MovieClipLoader class. It works with
// listeners, and it gives you lots of control over how the movie
// loads. In this example, we will load a SWF file called "brownCounty.swf"
// into an empty movie clip, called "container_mc"
// STEP 1: Create a MovieClipLoader object instance and a standard listener
var mcl:MovieClipLoader = new MovieClipLoader();
var myListener:Object = new Object();
// STEP 2: Spell out what you want to happen with given MovieClipLoader events,
// and assign that to the Listener object.
myListener.onLoadStart = function(container_mc:MovieClip) { // This will trace out when the MC starts to load
trace("------------ START -------------");
trace("Your load has begun on movie clip = "+container_mc);
};
myListener.onLoadComplete = function() { // This will trace out when the MC is done loading
trace("------------ COMPLETE -------------");
container_mc.setMask(mask_mc);
};
// STEP 3: Register "myListener" with the MovieClipLoader object
mcl.addListener(myListener);
mcl.loadClip("brownCounty.swf",container_mc);
// STEP 4: Create a button, which enables the user to initiate the loading the process.
// Note that the code here references the mcl object before it calls the loadClip method.
click_btn.onRelease = function() {
mcl.loadClip("brownCounty.swf",container_mc);
};
clickJPG_btn.onRelease = function() { // Note that loadClip(), as with loadMovie(), can load a JPG as well as a SWF
mcl.loadClip("stairs.jpg",container_mc);
};
now what i need to figure out is how to know when brownCounty.swf is done so i can tell it to play anonther swf in the same folder (eg:test2.swf)
can anyone help me out?
In the long run i want be able to play test1.swf and at the same time be loading test2.swf into memory then play test2.swf and be loading test3.swf all in hte background.
This is all about action script.. eventually it will take the full screen and just play 5 swfs and repeat forever. the idea being there is no loading time between each movie and it goes smoothly form one to the next.
Thanks,
Derek
Preloading FLV? Online Game W/video Question
This is a great forum. I had a question on a game I am building that uses a lot (500+) of short video clips (encoded as FLV files). In a nutshell, the game is all about making choices that load a particular clip to play, then making another choice which causes another clip to play, etc. If you recall the old video game "Dragon's Lair", it's something like that but without the twitch factor.
So anyway I have a basic framework built out where each user interaction loads an FLV file, using the typical netStream commands. The problem is the client is not happy with the several seconds that each clip takes to buffer before they start playing (clips are 300k - 1 MB each). They are more used to console/disc games where multiple clips can be adaptively preloaded off the media so they playbacl instantly. So I am looking for a way to achieve more instantaneous playback of the video clips. Here are some ways I was thinking of:
1. Embed the FLVs into swfs and preload them like any other asset (yuk)
2. Re-edit the video so all clips for a particular section of the game are edited together in one large FLV. Load this large FLV at the beginning of each game level, then jump around in it using cue points. I like this idea but it will be very time consuming to go back to the original video files and re-edit them all together.
3. use netStream(play) to start loading a clip, then (pause) as soon as onStatus reports it's actually playing on stage. However I would need to do this for 3-4 streams simultaneously.
Any thoughts on these methods, or any other approaches would be welcome! Thanks!!!!
Also, what software supports adding of cue points to FLV files? I don't think Sorenson does this, does it?
Sound Causing Jerky Sound/video
in a flash movie i am making when a sound effect is streamed the movie get jerky as well as the sound for a second. I am pretty sure its not my cpu (3ghz 512 ddr). As of now.. i don't have a preloader but my whole movie is contained in the first frame of the main timeline. I heard somewhere that this means the movie will not start until everything is loaded. Anyway thanks for your help
Sound Controller Turns Off Video Sound...help
im trying find out why.......here is my set up
onClipEvent(load)
{
_root.soundstatus="on";
_root.mySound = new Sound(_level0);
_root.mySound2 = new Sound(_level1);
_root.mySound3 = new Sound(_level2);
_root.mySound4 = new Sound(_level3);
_root.mySound5 = new Sound(_level4);
maxvolume=100;
minvolume=0;
}
onClipEvent(enterFrame)
{
if(_root.soundstatus=="on") {step=5}
if(_root.soundstatus=="off") {step=-5}
maxvolume+=step;
if (maxvolume>100) {maxvolume=100;}
if (maxvolume<0) {maxvolume=0;}
_root.mySound.setVolume(maxvolume);
_root.mySound2.setVolume(maxvolume);
_root.mySound3.setVolume(maxvolume);
_root.mySound4.setVolume(maxvolume);
_root.mySound5.setVolume(maxvolume);
}
Preloading Sound
hello
I'm wondering Why is it that when I put a preload scene in front of a scene that contains sound my file size resides in preload scene 1 so I never get to see the preload cause once frame one is loaded the whole file is
please help
thanks
Preloading Without Sound ?
I have a main movie with sound wich loop in the end, before the loop start I have sevral loadmovie actions
loading additionals movies also with sound. How can I make these additionals movies load without hearing their sounds in the background ?
Preloading Sound Only
hi all,
at the moment i have a preloader that uses a bytes counter. this is so i may employ the use of a perscentage bar/counter. this is of course counting the full 100% of bytes.
however, preferably i would like it to just preload the sound (and maybe images), for it is the sound/images that are taking up the greater percentage of the file size. my original solution was to dump all offending file hoggers on the first frame, preload that frame, then skip it and move on once loaded. however this isn't satisfactory for i can't see a bytes counter working with that - or maybe it can, u tell me
danke
b
Preloading Sound
Ok, much like preloading instances for quicker playback, I figured I could copy sound and place it into its own scene to be checked by preloader to see if it is loaded, but problem is It sits on 0% and then 100% as soon as it loads apparently. I have preloader which loads graphic in 4 stages for sound in quarters 25 50 75 100. I just used if frames loaded command for it, but I guess this doesnt work? Any ideas- I figure if I have sound streaming though I dont need preloader. am I right>?
Preloading Sound? Plz Help...
I am loading a 150kb sound loop into my movie at the start. The loop sits in its own SWF, so how can I have the main movie not start until the music movie has preloaded? Make sense?
Sound Preloading
I am dynamically loading an mp3.
I have a preloader, that uses a bar to show the progress.
this set of actions starts when the file is loaded, and loops until the file is completely loaded:
_parent.loadbar._xscale = _parent.MyMusicMC.myMusic.getBytesLoaded()/_parent.MyMusicMC.myMusic.getBytesTotal()) * 100;
if(_parent.MyMusicMC.myMusic.getBytesLoaded()/_parent.MyMusicMC.myMusic.getBytesTotal() >= 1){
_parent.MyMusicMC.MyMusic.start();
_parent.jukebox.playstop.gotoAndStop(1);
_parent.loadbar._xscale = 0;
_parent.lbaa.removeMovieClip();
}
The loadbar's size should be linked to the progress of the download. This worked offline, but when I checked it online.. it did not.
So I had it display the values for:
_parent.MyMusicMC.myMusic.getBytesLoaded
and
_parent.MyMusicMC.myMusic.getBytesTotal
Online Total equalled nothing and loaded equalled 0.
Offline they equaled a large number representing the actual data.
Does anyone have any idea what I should do?
Thanks!
Max
Preloading Sound?
how do i preload a sound that is being exported for actionscript?
i have an action clip with this code:
onClipEvent (load) {
currentSong = new Sound(_level11);
currentSong.attachSound("song");
total = int(currentSong.getBytesTotal());
trace(total);
}
but the trace function keeps returning 0.
what's the proper way to do this? i've also tried doing:
total = int(_level11.currentSong.getBytesTotal());
with the same lack of results.
Preloading With Sound
I attached sound to a flash game I am developing using the attachSound() function, it's not streaming. When my game loads in a browser, the preloader does not appear until the sound has loaded first is there a way I can work around this problem? It has been suggested to me that I could use loadSound() but that is not an option for me as I don't want to waste the extra bandwidth.
Preloading Sound
hello,
ive used this tutorial to link up sounds to my website.
http://www.flashkit.com/tutorials/Au...-824/index.php
but running into problems when i set up a preloader.
because all the sound files load into the cache before the preloader is activated. the browser has to stare at a blank screen for a while, then is flashes 100%, and runs .
is there any solution to this problem>?
thanks,
jboom
Preloading Sound?
Im trying to preload my flash site, I already have a preloader script which I know works in flash MX 2004 as I have tested it on some other sites. However on this new site I use a lot of sound which is attached to movie clips and exported for actionscript in the first frame...
when you go onto the site you dont see the preloader, wait for 5 minutes (on 56k) and then the whole site loads up.
I think because all the sound is exported flash loads it before the preloader?? anyone know a way around this or am I miles of track?
you can check out the site here
Sound Gone After Preloading?
Hi,
I'm preloading the frames of my flash movie in the first frame, after UN-checking the 'export in first frame' from all the sounds in the library and assigning the AS Classes to export into frame 2 in 'Publish Settings' - my sounds appears have vanished for some reason....
Any help would be great....
Here's the code for the sound object (on frame 3 of the movie - beginning of the movie)
_root.createEmptyMovieClip("soundHolder0_mc", 1);
_root.createEmptyMovieClip("soundHolder1_mc", 2);
_root.createEmptyMovieClip("soundHolder2_mc", 3);
mySound1_sound = new Sound(soundHolder0_mc);
mySound2_sound = new Sound(soundHolder1_mc);
mySound3_sound = new Sound(soundHolder2_mc);
// attach sounds
mySound1_sound.attachSound("housesound");
mySound2_sound.attachSound("walking");
mySound3_sound.attachSound("mousey");
// loop sounds
mySound1_sound.start(0, 100);
mySound2_sound.start(2, 100);
// set volume
mySound1_sound.setVolume(25);
mySound2_sound.setVolume(100);
Thanks
Preloading Sound?
Im trying to preload my flash site, I already have a preloader script which I know works in flash MX 2004 as I have tested it on some other sites. However on this new site I use a lot of sound which is attached to movie clips and exported for actionscript in the first frame...
when you go onto the site you dont see the preloader, wait for 5 minutes (on 56k) and then the whole site loads up.
I think because all the sound is exported flash loads it before the preloader?? anyone know a way around this or am I miles of track?
you can check out the site here
Preloading Sound
Hey, I'm usig the following action to do sound:
scene02
firstSound=new Sound();
firstSound.attachSound("trance");
in the same scene I got this button:
on (release) {_root.firstSound.start()
..very simple!
in scene01 I've made a preloader:
if(_framesloaded == _totalframes){
nextScene ();
play ();
}
else {
loaded = Math.round(getBytesLoaded()/1024);
total = Math.round(getBytesTotal()/1024);
percent = Math.round((loaded/total)*100)+"%";
bytes = loaded+"kb loaded";
}
BUT this don't work with sound!! WHY?.. it works with any other movie..
Sound During The Preloading
i use lee's tutorial for the basic flaxh preloader and i want to put a mp3 while it loads. more pecisely, i want the mp3 to stop when the file is loaded.
thanks
Preloading Images And Sound
I have built a preloader into my flash 5 movie.. it preloads using the "if frame is loaded" code. Once the movie starts it plays pretty slow because i have alot of images in the movie but when it goes around and plays the second time it plays at normal fast speed. How do you preload the images so when it plays it plays fast the first time. The images are called up from the library into the scene.. thank you..
Preloading Sound Objects
i have sound objects in a flash 5 movie that are loading before my preloading routine. the movie is structured as follows:
i have a background image on frame 1.
the preloader starts on frame 2.
on frame 3, i have mySound=new sound ();
on various buttons in the movie, i have mySound.attachsound ("loop"); mySound.start("",999);
(where loop has been linked to object in the library)
given that the sound files are the bulk of the movie, this problem renders the preloader redundant (it finally kicks in at 80% loaded).
any help greatly appreciated.
yjk
Preloading External Sound .swf
problem:
i'm trying to preload an external .swf whose only content are sound files linked as objects. in preview-movie, the sound files load perfectly into my empty mc on the main movie (i can fully modify all the linked sound objects from the main timeline). but when i test the movie on the internet, it blows through the preloader and my sound files are not playing. (it does so as well when simulating streaming under test-movie but i figured that was normal -- am i wrong? i am still able to access the sound objects.)
assuming the sound file is still loading in the background (ie, the preloader didn't catch), even if i wait for quite some time (~150k sound file on 56k dial up), still no sound.
theory:
the sound files are being pulled correctly into the mc-holder (instance named "noise") since i am able to call on these objects from the main movie. i believe its the preloading structure i have setup which is faulty.
frame structure / action scripts:
------------
//on frame 2 i have just the following action which defines the "preload" function used by the empty mc ("noise") on the main timeline...
function preload (theClip) {
if (!theClip.doneLoading) {
if (theClip._framesloaded>0 && theClip._framesloaded == theClip._totalframes) {
theClip.doneLoading = true;
}
//define variables
noiseLoaded = Math.round(theClip.getBytesLoaded()/1024);
noiseTotal = Math.round(theClip.getBytesTotal()/1024);
noisePerc = Math.round((noiseLoaded/noiseTotal)*100);
//define status outputs
nbytesOut = noiseLoaded+" kb of "+noiseTotal+" kb";
npercOut = noisePerc+"% loaded";
noiseBar._width = noiseBarHousing._width*(noisePerc/100);
//if not done loading, go back
_parent.gotoAndPlay (Number(3));
}
//if done loading, play on
_parent.gotoAndPlay (Number(6));
}
-------------
//on frame 3 i have the following action to tell "noise" to loadMovie (as well as the empty "noise" mc, loadbar, status boxes below this action script layer)...
noise.loadMovie("flash/noise.swf");
//on the "noise" mc i have the following action attached on the clip (not in the frames of the clip) (this mc has nothing in its frames - just all my sounds which have been linked as objects through the library)...
onClipEvent (enterFrame) {
if (this._url != _root._url) {
_root.preload(this);
}
}
--------------
//on frame 7 i define the various linked sound objects which should now reside in the "noise" mc (as well as start one of them)...
noise.loopStart = new Sound(noise);
noise.loopStart.attachSound("loopStart");
noise.loopBio = new Sound(noise);
noise.loopBio.attachSound("loopBio");
noise.loopStylings = new Sound (noise);
noise.loopStylings.attachSound("loopStylings");
noise.loopXperim = new Sound (noise);
noise.loopXperim.attachSound("loopXperim");
noise.loopStart.start("",999);
noise.loopStart.setVolume(50);
---------------
this has been driving me up the wall. exactly 24 hours ago, i was just beginning to learn about the pain that is preloading sound objects and i am sooooo close. please help before i throw this computer out the window.
young.frustrated.as.hell.jedi.knight
Preloading External Sound .swf
problem:
i'm trying to preload an external .swf whose only content are sound files linked as objects. in preview-movie, the sound files load perfectly into my empty mc on the main movie (i can fully modify all the linked sound objects from the main timeline). but when i test the movie on the internet, it blows through the preloader and my sound files are not playing. (it does so as well when simulating streaming under test-movie but i figured that was normal -- am i wrong? i am still able to access the sound objects.)
assuming the sound file is still loading in the background (ie, the preloader didn't catch), even if i wait for quite some time (~150k sound file on 56k dial up), still no sound.
theory:
the sound files are being pulled correctly into the mc-holder (instance named "noise") since i am able to call on these objects from the main movie. i believe its the preloading structure i have setup which is faulty.
frame structure / action scripts:
------------
//on frame 2 i have just the following action which defines the "preload" function used by the empty mc ("noise") on the main timeline...
function preload (theClip) {
if (!theClip.doneLoading) {
if (theClip._framesloaded>0 && theClip._framesloaded == theClip._totalframes) {
theClip.doneLoading = true;
}
//define variables
noiseLoaded = Math.round(theClip.getBytesLoaded()/1024);
noiseTotal = Math.round(theClip.getBytesTotal()/1024);
noisePerc = Math.round((noiseLoaded/noiseTotal)*100);
//define status outputs
nbytesOut = noiseLoaded+" kb of "+noiseTotal+" kb";
npercOut = noisePerc+"% loaded";
noiseBar._width = noiseBarHousing._width*(noisePerc/100);
//if not done loading, go back
_parent.gotoAndPlay (Number(3));
}
//if done loading, play on
_parent.gotoAndPlay (Number(6));
}
-------------
//on frame 3 i have the following action to tell "noise" to loadMovie (as well as the empty "noise" mc, loadbar, status boxes below this action script layer)...
noise.loadMovie("flash/noise.swf");
//on the "noise" mc i have the following action attached on the clip (not in the frames of the clip) (this mc has nothing in its frames - just all my sounds which have been linked as objects through the library)...
onClipEvent (enterFrame) {
if (this._url != _root._url) {
_root.preload(this);
}
}
--------------
//on frame 7 i define the various linked sound objects which should now reside in the "noise" mc (as well as start one of them)...
noise.loopStart = new Sound(noise);
noise.loopStart.attachSound("loopStart");
noise.loopBio = new Sound(noise);
noise.loopBio.attachSound("loopBio");
noise.loopStylings = new Sound (noise);
noise.loopStylings.attachSound("loopStylings");
noise.loopXperim = new Sound (noise);
noise.loopXperim.attachSound("loopXperim");
noise.loopStart.start("",999);
noise.loopStart.setVolume(50);
---------------
this has been driving me up the wall. exactly 24 hours ago, i was just beginning to learn about the pain that is preloading sound objects and i am sooooo close. please help before i throw this computer out the window.
young.frustrated.as.hell.jedi.knight
ps - i had posted this on the 'newbie' section and was suggested to post it here. apologies if this appears to be 'spamming.'
Sound Object Preloading
ok - i have an swf with a sound object (loop) that loads and plays called sound.swf. now i've heard that the best way to play this is keep it in an external swf and load it into your movie cos the sound object loads befor ethe first frame of the movie.
ok, so ive done that, but the sound doesnt play once its loaded into the movie clip. the sound.swf plays on its own, but doesnt when loaded into the main clip. is it something to do with the referencing?
this is driving me mad. any tutorials specifically on sound object preloading?
sid
|