All Bytes Loaded ?
hi,
simple question (i guess):
When I use getBytesLoaded and getBytesTotal:
Are all bytes of the complete movie loaded (all scenes), or just the bytes from the scene whith the AS in it?
Thankyou,
Maaike
FlashKit > Flash Help > Flash ActionScript
Posted on: 11-07-2003, 09:02 AM
View Complete Forum Thread with Replies
Sponsored Links:
Get Bytes Loaded And Bytes Total When Loading A JPG From A Different Domain
im probably better posting this here...
I have a online photo album but im likely to run out of server space for my images so i load pictures from different servers.
When ever i load in an image i have a progress bar that shows the bytes loaded and bytes total properties of that image.
Now if i load in an image that exists on the same server as the photo album swf then my progress bar works fine and it gets the bytes loaded and bytes total of that image, but if i load an image that is on a different server than the album then it doesnt get the bytes loaded or total, even though the image does load.
Is this part of macromedias security issues, what are macromedias security issues on this topic?
Any ideas round this?
I also found that the onData event for a movie clip doesnt work when your loading an image from a different server, but it does if you load an image from the same server as the swf. I got round this by checking if the height of the MC where the image was loading had changed, if it had then the image had loaded in.
cheers
View Replies !
View Related
Get Bytes Loaded And Bytes Total When Loading A JP
I have a online photo album but im likely to run out of server space for my images so i load pictures from different servers.
When ever i load in an image i have a progress bar that shows the bytes loaded and bytes total properties of that image.
Now if i load in an image that exists on the same server as the photo album swf then my progress bar works fine and it gets the bytes loaded and bytes total of that image, but if i load an image that is on a different server than the album then it doesnt get the bytes loaded or total, even though the image does load.
Is this part of macromedias security issues, what are macromedias security issues on this topic?
Any ideas round this?
I also found that the onData event for a movie clip doesnt work when your loading an image from a different server, but it does if you load an image from the same server as the swf. I got round this by checking if the height of the MC where the image was loading had changed, if it had then the image had loaded in.
cheers
View Replies !
View Related
Load Bar Progress Using Bytes Loaded As Opposed To Frames Loaded
My problem now is that I would like to build a preloader with a load progress bar etc., that is based on bytes loaded rather than frames loaded.
This is because I have most of my content loading in movie clips on just 1 or 2 different frames within the movie, perhaps bad design but somewhat of a necessity due to nested clips. So, the load bar hangs on these one or two frames for a long time while preloading, whereas if it could be based on bytes loaded the load bar would have a nice gradual sliding effect. I've been playing around with it myself but have yet to get if functioning. Any help would be greatly appreciated.
View Replies !
View Related
BYTES LOADED
_root.getBytesLoaded()
you all know this is usually used for preloaders
but the thing is i want to set up preloaded, but the thing i want to do is i want it to be set like
_root.getBytesLoaded()= 355000
like this is 350 kb so that it goes on after that amount of bytes loade....so how to do that??
View Replies !
View Related
Bytes Loaded
Because my intro loaded too slow I wanted to make a preloader.
Not a bar preloader but a summary of the bytes loaded. I want to have the following details:
Bytes loaded: ...
Kilobytes loaded: ...
Total kilobytes: ...
Percentage loaded: ...
Can someone help me out, or tell me which code I needed?
Kind regards,
Philippe
View Replies !
View Related
Get Bytes Loaded
Hi guys:
I'm making a preloader and I want to show the bytes or KB loaded of a movie. I found a MC method ._getBytesloaded, but it works apparently only with a MC or a movie loaded in different level than 0 or root.
I want to show the bytes or kb loaded of the complete swf file (_root, I say).
Any scripts for getting this?
Any suggestions or ideas.
I'll appreciate your feedback.
...
View Replies !
View Related
Bytes Loaded
Hi,
I have a part in my site with a hudge amount kb's so I don't want to load it all in one part, is use this code. How can I change it to "bytes_total" to a framenumber.
bytes_loaded = Math.round(_root.getBytesLoaded()/1000);
bytes_total = Math.round(_root.getBytesTotal()/1000);
_root.loadBar._width = bytes_loaded/bytes_total*405;
if (bytes_loaded == bytes_total) {
gotoAndPlay(14);
delete bytes_loaded;
delete bytes_total;
}
Thanx
View Replies !
View Related
Getting Bytes From Loaded MCs
am wondering if it is possible to have the framework of a preloader in the _root level.
if a movieclip is loaded (let's say an external MC) can the preloader (on _root) display progress/percentage of the MC currently being loaded? or does the preloader have to exist IN the loaded movie?
hope this makes sense. It is driving me crazy, but then there is always someone better than me....at actionscript.
cheers.
View Replies !
View Related
If Bytes Loaded.
I´m doind I small slideshow.
The pictures will be loaded apart, and will have a preloader.
I want to make the slideshow to play only after all the movieclip (pictures) are fully loaded on to the main movie.
How do I do that?
thanks
View Replies !
View Related
Get Bytes Loaded
I have this code but the getbytesloaded doesnt work.
Do you have any ideas?
Here is the code
_root.activate.linksbut.onRelease = function () {
_root.links.gotoAndPlay (4);
_root.empty.createEmptyMovieClip("target_mc", 1);
_root.empty.target_mc.loadMovie("links.swf");
_root.prel.gotoAndPlay (2);
_root.prel.transferIndicator.gotoAndStop("on");
}
this.onEnterFrame = function(){
percent = (_root.empty.target_mc.getBytesLoaded()/_root.empty.target_mc.getBytesTotal())*100;
_root.prel.bytesLoaded = _root.empty.target_mc.getBytesLoaded();
_root.prel.bytesTotal = _root.empty.target_mc.getBytesTotal();
if(percent == 100){
_root.prel.transferIndicator.gotoAndStop("off");
this.onEnterFrame = undefined;
}
}
function preload(theClip) {
if (_root.prel.transferIndicator._currentframe != 2) {
_root.prel.transferIndicator.gotoAndStop("on");
}
if (theClip.getBytesTotal() > 0 && theClip.getBytesLoaded() == theClip.getBytesTotal()) {
_root.prel.transferIndicator.gotoAndStop("off");
}
_root.prel.bytesLoaded = theClip.getBytesLoaded();
_root.prel.bytesTotal = theClip.getBytesTotal();
}
Thanks
View Replies !
View Related
Getting The Bytes Loaded For A Movieclip
I have a main movie that loads various other movieclips that are one frame and contain a single picture. These picture/movieclips are loaded into a target location. I'm trying to create a progress indicator when loading these separate pictures but it doesn't seem to return the bytes loaded information until the entire picture is loaded.
Anyone have any similar problems? Solutions?
View Replies !
View Related
Bytes Loaded From Loadmovie 2
This is the pre-loader routine:
if (_root.holder.getBytesLoaded()<_root.holder.getByt esTotal()) {
_root.progress = Math.round ( ((_root.holder.getBytesLoaded()/_root.holder.getBytesTotal())*100));
if (_root.progress >= 100) {
_root.progress = "00";
}
gotoAndPlay (_currentframe -1);
} else {
gotoAndStop ("idle");
}
When I place this in a movieclip that is loaded by another movieclip, it works fine and the variable 'progress' advances normally. However, when I place this EXACT routine in a loop on the _root timeline, the progress variable remains at 0 until the clip is completely loaded, then it returns 100. It appears to be a limitation within Flash 5. Does anyone know of a solution that will allow this routine to reside in the _root movieclip and retrieve the bytesloaded properly from a loading movieclip?
View Replies !
View Related
Bytes Loaded PRELOADER?
Hi all,
I have created a preloader using the ifFramesLoaded method. however some of the MC's that are on the frames that are being checked aren't being loaded yet and the movie is proceding and it is delaying. I was told that i should check the bytes are loaded instead. sounds good to me, but i dont know the exact script to do that. is it ifBytesLoaded???
Please help.
Thanks in advance.
dwyermm7
View Replies !
View Related
Variable Help If Bytes Loaded...
why does this not work
--------------------------------------------------------
onClipEvent (load) {
kb = " ";
}
onClipEvent (enterFrame) {
kb = _root.getBytesLoaded()/1000+" "+"Kb";
total = _root.getBytesTotal()/1000+" "+"Kb";
if (kb = total) {
gotoAndPlay (2);
}
}
--------------------------------------------------------
i want the code to work so if the text box (dynamic) kb is equaled to total (which is also dynamic) to make the main movie goto frame 2
why wont it???
--DarkFireball
View Replies !
View Related
Get Bytes Loaded Blows
I have 3 scenes,
In the first scene I want to use the getbytesloaded data to check when 30000 bytes have loaded, because from the test report I found this is the point where the 2nd scene has finished loading. Once the second scene has loaded I want to go to it, letting the 3rd scene load whilst the user plays with the 2nd scene, my code is as follows:
_root.getBytesLoaded();
if (_root.getBytesLoaded() >= 30000){
gotoAndPlay("Scene2",1)
}
gotoAndplay(1)
So it should loop back to the first frame and keep testing until more than 30000 bytes have loaded
But it simply goes back to frame 1 and keeps looping, it never figures out if more than 30000 has loaded (which the 'view streaming' window says it has).
I can't see what the problem is. Any help would be totally appreciated.
View Replies !
View Related
Round Bytes Loaded
for a preloader how do you round the bytes loaded to the nearest thousanth. my works, but for example displays 34.445453(to forever) when i want it to show 34.445
the code im using is
onClipEvent (load) {
_root.stop();
}
onClipEvent (enterFrame) {
var totalk = _root.getBytesTotal()/550;
var loadedk = _root.getBytesLoaded()/550;
var percent = Math.round((loadedk/totalk)*100);
if (loadedk<550) {
_parent.btxt = totalk;
}
if (loadedk<550) {
_parent.btxt = loadedk add "k";
}
if (percent<100) {
_parent.ptxt = percent add "%";
} else {
_root.play();
}
}
View Replies !
View Related
Getting Bytes Loaded In Root.
Hello,
I'm trying to read the bytes loaded of a picture in the root.
the command I'm using is: _root.picture+number.getBytesLoaded()
When I just give the command: _root.picture1.getBytesLoaded()
then it works fine.
I want to load more than one picture thats why I would like to use a loop for that.
Can somebody help me?
Thanks in Advance.
Edwin
View Replies !
View Related
Preloader Help But Not 100% Of Bytes Loaded
Happy holidays all...
I'm posting this here and there so if you've read this in another guise, shed some light for me please or ignore, whichever is a better fit...
I've got a bit of free time and wonder if someone might give me a little help with a flash site I'm working on with a bunch of video clips. I have each video converted to a movie clip that's nested inside of a button so it appears only on the rollover state. Right now I have published each one seperately with it's own preloader and I've set them all into an html page that's about 1500 wide that the viewer moves through with a horizontal scrollbar. Each video clip is about 600 kb. and I have things set up linearly so that the viewer will experience only one video at a time -one after another. The problem I have is that I have about ten such clips and worry about download time. It seems to work o.k. with the video clips all as seperate .swf files but it makes it impossible for me to script actions between clips because everything is broken up on the html page.
What I would like to know is how I can put all the mc's into one flash movie and somehow create a preloader where instead of waiting for 100% of the totalBytes to load before the first frame of the movie plays, the wait is say, only for 25% of the total Bytes Loaded?
Essentially, I want to have a preloader that will run until the title, initial sounds, and the first video clip load. Thereafter, I would like each successive video to load while the previous one is playing, or some such arrangement that avoids the viewer waiting for a clip to load and capitalizes on the time spent watching a clip that is already loaded. This way I can get the show on without having a ten minute preloader. I don't want the videos to stream within a little quicktime player but for everything to be embedded in the actual finished .swf file.
I have considered loading the videos into empty mc's one at a time with the loadMovie action but could use a little advise on the best way to design this -I know nothing about using levels, could there be some solution using levels?
Please help...
llyfre
View Replies !
View Related
Bytes Loaded Preloader, Please Help
Ok, so I've set up a preloader in Flash MX using the getbytesloaded controls. Here is the code I have:
onClipEvent (load) {
//set the status bar width to zero;
_xscale = 0;
}
onClipEvent (enterFrame) {
//calculate the load as a percentage;
counter = math.floor(_parent.getBytesLoaded()/_parent.getBytesTotal()*100);
_parent.counterpercent = counter+"%";
//if loaded, play;
if (counter>=100) {
gotoAndPlay("Scene 1", 1);
} else {
//if not loaded, set the status bar width;
_xscale = counter;
}
}
I want the preloader to load 50% of the movie and then have it start playing while the rest downloads... Anyone know how I can do this?? TIA!
View Replies !
View Related
In Function (bytes Loaded) Go To And.....
i am making a preloader for a huge game i made that has tons of levels and etc.. what i want to have happen is instead of loading it all at once, i want to make it so that after a certain amount of bytes load, u are able to start playing the movie, so u dont have to wait and while ur playing it continues to load, so is there any way to figure out how many bytes are loaded and then i NEED it in a function, its just like a thing i need because .. i heart functions, lol but yeah so is that possible in a function, or like the if frame is loaded go to and play (in a function) any help or links will be appreciated! no rush because its christmas, and im just fooling around testing out stuff! thanks
View Replies !
View Related
[F8] Get Bytes Loaded/Total On XML?
I've got a little gallery that pulls in XML data. Most of it works great, but I can't get getBytesLoaded or getBytesTotal to properly reflect how much of the images is actually loaded.
I cut out irrelevant code from this example. Prior to this code, _pic[i] has already gone through the XML and loaded the name of the appropriate pictures into an array. The pictures load fine; everything works great except for when I want to see how much of it is loaded.
PHP Code:
thumbSetup = function(){ for (i=0; i<total; i++) { _root.pic[i]; thumbs["thumbOuter" + i].thumbCon0._name = ["thumbCon" + i]; thumbs["thumbOuter" + i]["thumbCon" + i].loadMovie(_root.pic[i]); }}onEnterFrame = function(){ trace (thumbs["thumbOuter" + i]["thumbCon" + i].getBytesTotal()); trace (thumbs["thumbOuter" + i]["thumbCon" + i].getBytesLoaded());}
All I want is to be able to see how much the getBytesTotal and getBytesLoaded of each image are for each one of these images.
Thanks in advance for any help.
View Replies !
View Related
Loaded Bytes Question
hey folks,
I have the following code attached to a movie clip which I am using to load various images into. How would I go about finding the total size of the image being loaded so I can put it into a variable. I want to then show this variable value in a text field so the user knows how big the image is that is being loaded.
Code:
onClipEvent (data) {
this._alpha = 0;
this._x = 496;
this._y = 306;
this._x = this._x-(this._width/2);
this._y = this._y-(this._height/2);
}
onClipEvent (enterFrame) {
if (this._alpha<100) {
this.float_alpha += 20;
this._alpha = this.float_alpha;
}
}
I'm sure there's probably an easy way of doing this but at the moment my brain is fried and I can't seem to get it.
any help would be greatly appreciated.
NF
View Replies !
View Related
Bytes Loaded Of Upload
Does anyone know if its is possible to get the 'bytesLoaded' of the serverside script itself that upoads a file, instead of the 'bytesLoaded' of the file itself. My serverside script has lots of other jobs and I would like to see the percentage of the loaded bytes in Flash.
View Replies !
View Related
Finding Bytes Loaded?
How do I find out how much of a streaming video has been buffered? The variable stream.bytesLoaded is zero (stream is of type NetStream). Why?
The platform: AS3 + MediaServer 3
File format being streamed: MP4
View Replies !
View Related
Loaded Bytes Question
hey folks,
I have the following code attached to a movie clip which I am using to load various images into. How would I go about finding the total size of the image being loaded so I can put it into a variable. I want to then show this variable value in a text field so the user knows how big the image is that is being loaded.
Code:
onClipEvent (data) {
this._alpha = 0;
this._x = 496;
this._y = 306;
this._x = this._x-(this._width/2);
this._y = this._y-(this._height/2);
}
onClipEvent (enterFrame) {
if (this._alpha<100) {
this.float_alpha += 20;
this._alpha = this.float_alpha;
}
}
I'm sure there's probably an easy way of doing this but at the moment my brain is fried and I can't seem to get it.
any help would be greatly appreciated.
NF
View Replies !
View Related
Loaded Bytes Question
hey folks,
I have the following code attached to a movie clip which I am using to load various images into. How would I go about finding the total size of the image being loaded so I can put it into a variable. I want to then show this variable value in a text field so the user knows how big the image is that is being loaded.
Code:
onClipEvent (data) {
this._alpha = 0;
this._x = 496;
this._y = 306;
this._x = this._x-(this._width/2);
this._y = this._y-(this._height/2);
}
onClipEvent (enterFrame) {
if (this._alpha<100) {
this.float_alpha += 20;
this._alpha = this.float_alpha;
}
}
I'm sure there's probably an easy way of doing this but at the moment my brain is fried and I can't seem to get it.
any help would be greatly appreciated.
NF
View Replies !
View Related
Get Bytes Preloader In Loaded Movie
I have been using a preloader technoqiue that uses the follwing script
if (_root.getBytesLoaded() != _root.getBytesTotal()) {
gotoAndPlay (1);
}
it also has an expanding loader bar .
This workds great as a preloader for my main movies.
However I am using load movie into an empty movie clip for the sites pages (.swfs) and unfotunately the preloader isn't working here.
I realise this is to do with the _root refernce. So in this case it either checks to see if the home page is loaded (?)( which it will be ) and then plays the clip ( which is not loaded).
I have tried changing the the line to _root.empty but this stops the loading bar from working though it does stop the loaded.swf form running until it is loaded.
I'm interested in the best preolder solution for my loaded.swf's really.
This technique has worked fine when I have loaded on a level but now I am needing to make them come in via the empty clip I'm a bit stuck.
any help/suggesstions would be appreciated.
thanx in advance
View Replies !
View Related
Bytes Loaded Controling 2 Movies
Ok.... I have 3 movies.
index.swf (the main movie on level 0)
interface.swf (the nuts and bolts on level 100)
home.swf (a smaller movie loaded into level 10)
Now... the interface plays through till around frame 100. At this point i call for home.swf. Now before interface.swf continues and clears a hole for home.swf to be viewed, I want to make sure that home.swf is fully loaded. Once it is fully loaded, There should be an action telling interface.swf to continue playing (which is a doorlike effect that opens up to reveal home.swf, which is sitting beneith it) and telling home.swf to play from frame 2 (home.swf has a stop action in frame 1).
I cant get the actions to work. For some reason, it will play through but home.swf is stuck on frame one (which is stopped).
Any takers?
View Replies !
View Related
Advanced Bytes-loaded Preloader
hi,
i followed the directions in this tutorial:
http://www.flashkit.com/tutorials/Ac...12/index.shtml
the preloader scene works great, the only problem is when i get to the next scene, it opens that scene on frame 100. i assume(<-alert) what is happening is the tellTaget part in the preloader script is telling scene2 to to goTo frame 100 too.
loadedbytes=getBytesLoaded()
totalbytes=getBytesTotal()
loadedkbytes=Math.ceil (loadedbytes/1000)
totalkbytes=Math.ceil (totalbytes/1000)
if (loadedbytes == totalbytes) {
nextScene ();
}
frame = int(loadedbytes/(totalbytes/100));
tellTarget (_root.loader) {
gotoAndStop (_root.frame);
}
i have my loader movie properly labeled in the preload scene as loader.
perhaps someone can look at this script and tell me what is wrong with it, or me.
View Replies !
View Related
Checking Bytes Loaded For External Mc
FlashMX
I am trying to build a preloader that runs everytime an external mc is loaded into a placeholder mc on the main timeline. As is I have preloaders built into the begining of each movie clip. The problem is that my progress bar is getting it's scale from the main timeline instead of the movie that is loading so it is always at 100%. Either I want to know how to get it to work as is, or I would like to know if there is a way to build a preloader in an external movieclip and have it run everytime data is loaded into the targetLayer. Thanks in advance.
View Replies !
View Related
Bytes Loaded Preloader Conundrum
Hi all - is there any SIMPLE way (sorry I'm a designer not a developer and a bit thick when it comes to high-end action script) you can substitute the bit in a preloader that says "if FramesLoaded = 'x', gotoandPlay 'y' ", with something like " if BytesLoaded = 23453, gotoandPlay Frame 15".... you get the idea. I want to make my percentages more accurate. I'm sure it's perfectly simple but I can't find anything in the help index. Oh yeah and I'm using MX.
Thanks for reading!
View Replies !
View Related
After 50% Of Total Bytes Loaded GotoAndPlay...
Can someone please give me some help with a preloader that will get the show on after loading just a percentage of the total bytes?
Or better yet, is it possible to have the loader load a specific number of frames and then play?
Or can I have the "_root.getBytesTotal" be the total bytes of a specific MC instead of the whole .swf?
Here's info about my current preloader down to the atom:
I'm using a loader bar made of two mc's with three frames each, one exactly on top of the other with the mc's registration in the upper left and lower left corners respectively. On the second frame of the actions layer exists the following frame action:
if (_root.getBytesLoaded() !=_root.getBytesTotal()){
gotoAndPlay (1);
}
and on frame three there is a "gotoAndPlay" frame action to send things along to the second scene once the whole .swf is done loading. In the loader bar MC itself there is a frame action like this:
setProperty(this, _xscale, (_root.getBytesLoaded()/_root.getBytesTotal())*100);
I've tried a few things like changing the *100 to *50 or adding the instance name of the MC I'm interested in between the "_root" and the "getBytesLoaded" but nothing's come of it...
thanks,
llyfre
View Replies !
View Related
After 50% Of Total Bytes Loaded GotoAndPlay…
Can someone please give me some help with a preloader that will get the show on after loading just a percentage of the total bytes?
Or better yet, is it possible to have the loader load a specific number of frames and then play?
Or can I have the "_root.getBytesTotal" be the total bytes of a specific MC instead of the whole .swf?
Here's info about my current preloader down to the atom:
I'm using a loader bar made of two mc's with three frames each, one exactly on top of the other with the mc's registration in the upper left and lower left corners respectively. On the second frame of the actions layer exists the following frame action:
if (_root.getBytesLoaded() !=_root.getBytesTotal()){
gotoAndPlay (1);
}
and on frame three there is a "gotoAndPlay" frame action to send things along to the second scene once the whole .swf is done loading. In the loader bar MC itself there is a frame action like this:
setProperty(this, _xscale, (_root.getBytesLoaded()/_root.getBytesTotal())*100);
I've tried a few things like changing the *100 to *50 or adding the instance name of the MC I'm interested in between the "_root" and the "getBytesLoaded" but nothing's come of it...
thanks,
llyfre
View Replies !
View Related
Getting Bytes For Loaded Movie Clip
I'm loading a movie into a movie clip on my main timeline. I want to be able to get BytesTotal() and getBytesLoaded for the loading movie clip. Is there a way to do this? If there is what would be the correct path...
movieClipInstanceNameRecievingMovie.getBytesTotal( )????
Thanks
View Replies !
View Related
Problem On Loading Outside Swf And Get Bytes Loaded
I'm making a flash that load several swf files and tell how many bytes we
have downloaded. now I have finished loading the swf to _root,
but it couldn't tell how many bytes we have loaded.
I've tried to explain the actionscript as much as possible.plese help me!
your reply is appreciated.
Code:
for (i=0; i<6; i++) {
//to test, there is 6 swf files in the same folder
//imgArray is used to store the swf file's url
var imgArray = new Array();
imgArray[i] = i+".swf";
//create some mcs to store swf file which going to download
this.createEmptyMovieClip("newMc", 1000);
duplicateMovieClip("newMc", "myMc"+i, 1000+i);
var tempImg = imgArray[i];
eval("myMc"+i).loadMovie(tempImg);
eval("myMc"+i)._x = i*100;
// loading is the function that get bytes loaded ......
//it seems it never get the swf file's bytes....loading(tempImg, this["myMc"+i]);
}
function loading(theMc, theUrl) {
//load moive outside, theUrl is swf'url ,theMc is the mc to store swf
loadMovie(theUrl, theMc);
this.onEnterFrame = function() {
var bLoaded = theMc.getBytesLoaded();
var bTotal = theMc.getBytesTotal();
var pLoaded = int((bLoaded/bTotal)*100);
if (bLoaded == bTotal and bLoaded>=100) {
trace("loading completed");
delete this.onEnterFrame;
} else {
trace("bLoaded: "+bLoaded+" bTotal: "+bTotal);
}
};
}
View Replies !
View Related
[F8] Getting Total Bytes Of Loaded Images
Hi all
is there anyway to amend the script below to give me the total bytes loaded of all the images, instead of one at a time? thanx in advanced.
PHP Code:
this.createEmptyMovieClip("image", this.getNextHighestDepth());
for (i=0; i<7; i++) {
duplicateMovieClip("image", "mc"+i, this.getNextHighestDepth()+i);
}
pix = [path+"001.jpg", path+"004.jpg", path+"006.jpg", path+"asia.jpg", path+"007.jpg", path+"pk5.jpg", path+"pk3.jpg"];
n = 0;
mcs = [mc0, mc1, mc2, mc3, mc4, mc5, mc6];
mcs[n].loadMovie(pix[n]);
onEnterFrame = function () {
ld = mcs[n].getBytesLoaded()/1000;
tl = mcs[n].getBytesTotal()/1000;
mcs[n]._xscale = mcs[n]._yscale=30;
pc = (ld/tl)*100;
if (pc == 100) {
n++;
mcs[n].loadMovie(pix[n]);
pos.text += "Image "+n+" Size "+(ld+"
");
dim.text = "loaded "+(n)+" of "+mcs.length;
}
};
View Replies !
View Related
Don't Play Until Total Bytes Are Loaded
Hiya,
I have a flash movie loading other flash movies into it. The parent movie uses a loading bar that says when bytesTotal = bytesLoaded gotoAndPlay the next frame whereupon the loadbar will disappear. The problem I'm having is that the loaded child swf will start playing before everythign is loaded i.e. it plays when the initial part is loaded and continues loading the rest as it plays through.
This means that the first part of the child swf is hidden by the loading bar in the parent swf.
I want to be able to code the child swf to effectively say "do not play until all bytes are loaded".
I've tried if (this.getBytesLoaded==this.getBytesTotal) = true then goto next frame etc. but it doesn't seem to have the right effect.
Can anyone tell me how I can get a movie to hold from playing until all bytes are loaded?
Thanks for your help!
View Replies !
View Related
Tracing Loaded External SWF Bytes
I have a file that loads 13 external Swfs into a shell. When they are all loaded, the shell plays the files in succession. That works fine, but I a trying to show the progress of the loading process, but the flash pretty much freezes until all of the files are loaded then jumps my progress bar all the way to the end. Basically, nothing is allowed to happen until the scenes are all loaded completely. I can't even put a revolving animation on the main timeline to display until the files are loaded. The animation just sits on frame one until all the files are loaded, then starts to play, which defeats the purpose. Is there anyway to pause the code until the first movie is loaded, hten move on to then next movie load or a way to concurrently display bytes loaded while the file is being loaded.
var courseArray:Array= Array("Scene1.swf", "Scene2.swf", "Scene3.swf", "Scene4.swf", "Scene5.swf", "Scene6.swf", "Scene7.swf", "Scene8.swf", "Scene9.swf", "Scene10.swf", "Scene11.swf", "Scene12.swf", "Scene13.swf");
startup = function() {
this.createEmptyMovieClip("scene"+(i+1), (i+1));
this["scene"+(i+1)].loadMovie(courseArray);
}
for (i=0; i<13; i++) {
startup();
//****Jumps progress bar 1/13th of the way each time the loading code happens****
this.progressBar.gotoAndStop(_root.progressBar._currentframe+(int(100/13)));
}
The code all seems to happen immediately because the progressBar jumps all the way to the end right away, but the flash freezes until the files are completely loaded. Can I pause this code until each individual file is finished loaded, then run the next loop?
View Replies !
View Related
File Upload - Not Getting The Bytes Loaded
Last edited by Codemonkey : 2006-08-12 at 12:15.
Hi guyz
I have a small issue in file uploading.
I have no problem in uploading a file.My problem is that im not able to get the TOTAL BYTES LOADED while uploading is going on.
im using
ActionScript Code:
listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
value_txt.text="onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " + bytesTotal;
}
The above code returns the both the BYTES LOADED and BYTES TOTAL as same value which is actually the TOTAL BYTES.
some one help me
thanks
karan
View Replies !
View Related
How In Tarnations Do I Get Bytes Loaded With Decimal Point?
I have a preloader with a little byte counter in it.
It works great!
But, how do I also include a decimal point & numbers following?
Here's what I have for the actionscript for the first frame.
total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = int((loaded_bytes/total_bytes)*100);
ifFrameLoaded ("ftp") {
}
Thanks,
~senior pooglins
View Replies !
View Related
How Can I Track The Amount Of Bytes Loaded (more Accurately)?
I want to use the MovieClip.loadMovie() method to load an external .swf file into my flash 5 movie.
The external file is just a jpeg that I've exported from fireworks as a .swf. It's 100kb.
Now, as the .swf file loads, I want to monitor how many bytes have loaded. I want to do this as accurately as possible because I like to let my users know how long they have to wait.
Seems reasonable, right? Wrong. I have read in Colin Moock's 'Actionscript- the Definitive Guide' that: "getbytesloaded() measures bytes in whole-frame chunks only. So if a movie's first frame is 200 bytes in size and its second frame is 3000 bytes in size, getbytesloaded() will return 200 and 3200 but never any increment in between".
So, assuming that my jpeg/swf file has all 100kb in one frame, I'm probably going to have a very long night trying to devise an accurate preloader movie.
Still, I reckon that if there's a will, there's a way. Can anyone point this newbie in the right direction? Thanks.
View Replies !
View Related
Bytes Loaded Of This External Swf File.. Not Working :(
I want to load an external SWF file named "one.swf" in a movieclip named Content
How do i calculate the bytes loaded of this external swf file, and when its loaded do an action.
I did this code, but its not calculating the bytes file "one.swf"
if ((_root.content+"one.swf").getBytesLoaded()>=(_roo t.content+"one.swf").getBytesTotal()) {
gotoAndPlay(27);
} else {
gotoAndPlay(25);
}
Thanks for any help
View Replies !
View Related
Advanced Bytes-loaded Preloader Problems
I have a current preloader that works perfectly with small swf file sizes, but doesn't perform well with anything over 10mbs.
How it is set up is there are two scenes, one scene with the loader and the next is content. With the file sizes larger that 10mb, when you click on the HTML file to load the swf file it is initially blank. The preloader doesn't show up on the screen until about 75-80% of the swf file has been loaded.
Like I said it runs like a champ on smaller file sizes. The preloader comes right up and shows everything.
Here is the script I am using:
Code:
totalbytes = Math.round(getBytesTotal()/1000);
loadedbytes = Math.round(getBytesLoaded()/1000);
loadbar._width = totalbytes/10;
loadedbar._width = loadedbytes/10;
percentloaded = Math.round((loadedbytes / totalbytes) * 100)
if (loadedbytes == totalbytes) {
gotoAndPlay ("main", 1);
}
On the loader scene there are the following items:
a percent loaded dynamic text box for var percentloaded
a bar that shows total to be loaded size for var loadbar
a bar that shows total loaded so far for var loadedbar
Any one else have problems with large filesizes and preloaders? Anyone have a way to fix it?
View Replies !
View Related
Play Video Only After X Number Of Bytes Loaded
Hello.. I'm making an online video player.. that dynamically plays videos.
I'm trying to figure out how I can make the video only start playing after 10% of the video file has been loaded. I basically want a little splash screen to show saying "Please Wait... loading video" .. while the video loads 10%.
Then after 10% the video will start playing.
How can I do this?
Here is the code I have so far to get the video playing. What should I add?
ActionScript Code:
var ncConnection:NetConnection = new NetConnection(mcVideoHold);
ncConnection.connect(null);
var nsStream:NetStream = new NetStream(ncConnection);
nsStream.play("video1.flv");
View Replies !
View Related
Still Can Not Get Preloader To Show Correct Percentage And Bytes Loaded
Here is my fla. file. If ant one can figure out what im doing wrong here I would gretly appreciate it. Im in the middle of doing this for a job im currently at, and at this point i'm very frustrated. PLEASE HELP.
GET FLA FILE HEREThis is a .rar file. about 11mb.
here is the coding i used if you dont want to upload the fla zip.
----------------------------------------First Frame Script------------------------------------------
_root.stop();
onEnterFrame = function () {
preloader._width = (_root.getBytesLoaded()/_root.getBytesTotal())*200;
statusTxt.status.text = Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100)+"%";
statusTxt._x = preloader._width;
if (_root.getBytesLoaded == _root.getBytesTotal()) {
trace("loadDone");
_root.gotoAndPlay(3)
} else {
loading._xscale = ((_root.getBytesLoaded()/_root.getBytesTotal())*100);
output = ((_root.getBytesLoaded()/_root.getBytesTotal())*100);
outputFrame = _root.getBytesTotal();
loaded = _root.getBytesLoaded();
}}
------------------------------------------Second Frame Script----------------------------------
gotoAndPlay(1);
-------------------------------------------------Third Frame Script---------------------------------------------
_root.loadMovie("santiagointro.swf");
----------------------------------------------Script---------------------------------------
If an one knows a better way to to preload external swf files while showing the loading process (Percentage, bytes loaded) PLEASE PLEASE plese tell me.
View Replies !
View Related
|