Mac GetBytesLoaded() And GetBytesTotal()
in my flash app i have the block:
Code: if(_root.main_mc.loader_mc.getBytesLoaded() == _root.main_mc.loader_mc.getBytesTotal()) { ... } works fine on a pc. i don't think mac supports getBytesLoaded() and getBytesTotal(); i've had some buggy problems in the past with it on a mac. is this true? any way around it?
thanks
FlashKit > Flash Help > Flash ActionScript
Posted on: 04-26-2004, 04:21 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Help - GetBytesTotal() And GetBytesLoaded()
hi,
i wonder if anybody can help me,
i have a movie clip called "imgholder" which is on the stage of a movie called main.swf.
I am using "imgholder" to load external .swf files.
This is fine, however when i try to use flash5's new object style code,
e.g. imgholder.loadmovie("test.swf")
Or
loaded = imgholder.getBytesLoaded();
it doesn't work.
At the moment i am using:
loadMovie ("test.swf", "imgholder");
and
test = getProperty("imgholder", _framesloaded);
to achieve the above.
I have also tried using _root.imgholder.getBytesLoaded();
to no avail. should i be using levels?
Thanks in advance,Ben.
Getbytesloaded/getbytestotal ?
I have a few problems with getbytesloaded/getbytestotal.
offline, when I try to trace their value from an object (on stage) in witch I loaded a JPG they both give me the same value. (usually 18 and then around 44 thousands...)
then online I can't trace their value but flash seems to react as if they are both equal. which makes it impossible to make a loader, because
getbytesloaded/getbytestotal always returns 1.
anyway here's how I'm trying to do this.
on 1st frame I got:
content.loadMovie("files/" + _root.selected +".jpg");
then on the 3rd frame:
bl = content.getBytesLoaded();
bt = content.getBytesTotal();
if (bt != bl) {
bar._xscale = bt/bl;
gotoAndPlay(2);
} else {
content._visible = true;
play()
}
thanks..
How To Use GetBytesLoaded And GetBytesTotal
Hey, can anyone help me get this section of code to work? What I am trying to do should be pretty self explanitory . . .
Code:
function swf(clip){
loadMovie("box.swf",clip)
bytesLoad = getBytesLoaded();
totalBytes = getBytesTotal();
if (bytesLoad = totalBytes) {
fadout = setInterval(fade,30,this);
}
trace("function swf is working");
}
GetBytesLoaded() == .getBytesTotal
Hi Forum,
I want to have two preload scenes, pre_load1 scene checks
if (_root.getBytesLoaded() == _root.getBytesTotal())
{
_root.gotoAndPlay("Main", 1);// skip pre_load2 scene and play Main scene
}
If not go to pre_load2 scene and download.
Reason is for repeat visitors so they dont have to view preload again. cheers P
GetBytesLoaded() / GetBytesTotal()
Hello there... I have a small problem with getBytesLoaded() / getBytesTotal() for use with a preloader. I know how to make a preloaded, but ive decided to make a preloader on a specific level that will be loaded into the embedded swf.
so the preloader is accessed by _level200
this works fine. I can use getBytesLoaded() / getBytesTotal() to find out how much is loaded.
example:
Code:
myLoader.myKBs.text = _level0.getBytesLoaded() add "kb/" add _level0.getBytesTotal() add "kb";
//OR use it to get to level the loader is inside
myLoader.myKBs.text = this.getBytesLoaded() add "kb/" add this.getBytesTotal() add "kb";
but the second i try any level BUT "_level0" or "this" then I just get undefined!!! Any ideas? Btw, I KNOW the other levels are there because they are showing up in the embedded file.
thanks guys/gals
GetBytesTotal & GetBytesLoaded?
Hi
I want to load a picture from outside my site and get the size info of that file.
But when I use getBytesTotal & getBytesLoaded it's only return 0 byte.
Code:
...
newImg_mc.loadMovie("http://www.helpexamples.com/flash/images/image1.jpg");
...
trace(newImg_mc.getBytesTotal());
trace(newImg_mc.getBytesLoaded());
...
I want to know the filesize of a file outside my site.
And to be able to see the downloaded bytes.
please someone!
/Stenberg
GetBytesLoaded() & GetBytesTotal()
Say I have 2 files (file a, file b) and I want to use file a to load file b (in a blank movie clip symbol). The problem is that file b has a preloader that uses _root.getBytesLoaded() & _root.getBytesTotal() in it.
These values, however, return the size of 'file a', what should I put in place of _.root (which is in 'file b') so that it returns the size of 'file b' even if I load it from somewhere else?
Thanks
GetBytesloaded && GetBytesTotal Undefined
I'm loading an external swf on a button release. Since the external swf was small I initially didn't have a preload check. The first time the button is clicked the swf doesn't load, but the on the second click the swf would load and play.
I tried using basic tests with _framesloaded and even tried a comparison with (getBytesloaded & getBytesTotal). If all cases , _framesloaded and getBytesloaded & getBytesTotal return "undefined" and the swf loaded only have the second click.
Any ideas.
Lisa
GetBytesLoaded()/getBytesTotal() = Headache
Got a flash piece at http://www.lake.k12.fl.us/makearipple.asp that pops it in a new window.
Problem is, preloader shows up on some machines, not others.
Real frustrating. Because it will show up, say, on a p4 2+ GHZ machine as well as a 128 MB Ram AMD older machine, but won't show up on similar machines running same software, browser and players.
I'd rather use getBytesLoaded vs ifFrameLoaded -- site is a bunch'a mcs that play when buttons are activated, etc. getBytesLoaded is more accurate than ifFrameLoaded in this case.
Also, want preloader to load dynamically, which, as I said above, it does in most cases. It's the times that it chugs along before jumping strait in to the main movie that's got me all frustrated.
Any suggestions are appreciated.
I've tried multiple variations.
Here's preloader code:
----------------------------------
stop();
myInterval = setInterval(preloader, 10);
if (getBytesLoaded() == getBytesTotal()) {
nextScene();
}
function preloader() {
if (getBytesLoaded()>=getBytesTotal()) {
play();
clearInterval(myInterval);
}
myTextField.text=(Math.round(getBytesLoaded()/getBytesTotal())*100)+"% loaded";
progressBar._xscale=(getBytesLoaded()/getBytesTotal())*100;
mask._xscale=(getBytesLoaded()/getBytesTotal())*100;
mask._yscale=(getBytesLoaded()/getBytesTotal())*100;
ripple._xscale=(getBytesLoaded()/getBytesTotal())*250;
ripple._yscale=(getBytesLoaded()/getBytesTotal())*250;
ripple._alpha=(getBytesLoaded()/getBytesTotal())*50;
ripText._alpha=(getBytesLoaded()/getBytesTotal())*100;
}
----------------------------------
Thanks,
Andy
_level1 GetBytesLoaded/getBytesTotal.. Help
Does anybody know how can I make my preloader.. if I want to load music from _leverl1 ?
setProperty("_parent.load_bar", _xscale, ((_level1.getBytesLoaded()/_level1.getBytesTotal())*100));
//this script doesn't work for me
Thanks..
GetBytesLoaded Returns GetBytesTotal...
Okay what I am trying to do should be pretty simple... I've done it quite a few times before but I'm getting nowhere this time. Here's my setup.
I have a main swf that simply is used to load other swfs as links are clicked. Now two different swfs are always loaded at the same time. One is a banner that contains the menu which is never unloaded. And the other is the content swf that is changed as the links are clicked.
Here's the setup: It's not as optimized as it could be because I've been messing it up continuously trying to find the problem.
Code:
//SNIPPET: this is in the banner.
if (loading) {
loading = _root.checkLoading();
if (!loading) {
turnOn();
}
}
//SNIPPET:this is in the main swf
function checkLoading() {
var rbool:Boolean = true;
var loaded:Number = content.getBytesLoaded();
var total:Number = content.getBytesTotal();
lbar.lbar._xscale = loaded/total*100;
lbar.perc = loaded;
if (total == loaded && total > 1) {
rbool = false;
}
return rbool;
}
//SNIPPET: Last here's the setup for content which is also in the banner
if (_root.chg == "2d") {
loadMovie("2dViewer.swf", _root.content);
} else if (_root.chg == "3d") {
loadMovie("3dViewer.swf", _root.content);
} else if (_root.chg == "web") {
loadMovie("webViewer.swf", _root.content);
} else if (_root.chg == "contact") {
loadMovie("contact.swf", _root.content);
} else if (_root.chg == "about") {
loadMovie("about.swf", _root.content);
} else if (_root.chg == "home") {
loadMovie("main.swf", _root.content);
}
Okay now here's my problem. content.getBytesLoaded() returns the same as content.getBytesTotal(). And no it's not 0... it's a large amount of bytes that I am assuming is the actual Total. And it's not loaded yet either, one of the swfs is about 2.5 megs and says it is loaded but it's not even close...
Am I doing something stupid? Probably... if you can help me that would be awesome! In the mean time... I'll scratch my brain some more...
_level1 GetBytesLoaded/getBytesTotal.. Help
Does anybody know how can I make my preloader.. if I want to load music from _leverl1 ?
setProperty("_parent.load_bar", _xscale, ((_level1.getBytesLoaded()/_level1.getBytesTotal())*100));
//this script doesn't work for me
Thanks..
GetBytesLoaded And GetBytesTotal Isnt Getting
Hi! Im going crazy! It seems no matter how I try to get the bytes loaded and total, its not getting them. Im loading a picture into a holder. The swf loads into the holder fine, but the preloader isnt working because the bytes loaded and total are always 0. Here's the code Im referring to...
function load_pic(myLoad, myNum:Number)
{
//this loads the picture into backpics
_root.mc_backpics["img" + myNum].loadMovie(myLoad);
//this is what I cant get working. myLoad isnt referencing the file I think
total = myLoad.getBytesTotal();
loaded = myLoad.getBytesLoaded();
percent = int(loaded/total*100);
and here's how I call it...
var myPage = 1;
load_pic("backpics/pic" + [myPage] + ".swf", myPage);
Thanks!
Rich
MovieClip.getBytesLoaded() And GetBytesTotal() == 0?
For some reason when I load a movie clip these functions always seem to return 0 to me. Does this mean that it loads the movie with the LoadMovie method from the cache memory which makes that value 0? Even then I'd think it would still display that number.
I load it like this in a frame:
LSL=loadingScreen.getBytesLoaded();
LSL shows 0 as a value when I do Debug - List Variables when testing it. It's the same for LST=loadingScreen.getBytesTotal();
Btw I load the MovieClip like this and in the next frame I update those LSL and LST variables:
_root.createEmptyMovieClip("loadingScreen",2);
_root.loadingScreen.loadMovie("LoadingScreen1.swf");
Of course those both values being 0 will always end up in this if statement to fail:
if(LSL<LST){
gotoAndPlay(1);
}
Suggestions to let these methods return the correct values are appreciated a lot.
GetBytesLoaded Showing As GetBytesTotal About 50% Of The Time. Help.
I am loading a sound file and have a loop that continually checks getBytesLoaded and compares it to getBytesTotal.
unfortunately the getBytesLoaded is returning getBytesTotal about 50% of the time and then it doesn't download the file at all.
I have stripped it down to the bare bones just checking getBytes Loaded and can't figure out why this is happening.
I am loading the sound off of a button click and if I click the button 5 or 6 times it usually kicks in and starts showing getBytesLoaded but that is not really acceptable. The funny thing is sometimes it goes on the first click. Can anyone give me any hints.
My guess is it has something to do with the large file size and my slow internet connection but then many other people will have a similarly slow conntection.
Problem With GetBytesLoaded And GetBytesTotal With A SendAndLoad
I can't get it work. It's loading fine, but I can't find a way of retrieving the informations. I would like to do a preloader, so I need the getBytesLoaded and getBytesTotal
here is the code I have done :
Code:
stop();
var sendData:XML = new XML();
var replyXML:XML = new XML();
checkProgress = function() {
var lvBytesLoaded:Number = replyXML.getBytesLoaded();
var lvBytesTotal:Number = replyXML.getBytesTotal();
trace("Loaded "+Math.floor(lvBytesLoaded/lvBytesTotal)*100);
};
replyXML.onLoad = function(success:Boolean) {
clearInterval(intervalID);
if (success) {
trace(replyXML.getBytesLoaded()+" Bytes sent.");
} else {
trace("error");
}
};
sendData.sendAndLoad("http://127.0.0.1/RandomThoughtsHandler.ashx", replyXML);
var intervalID:Number = setInterval(checkProgress, 100, replyXML);
GetBytesTotal() And GetBytesLoaded() Not Working When Loading Jpg File Into MC...hlp
Using MX, anyone see a problem with getBytesLoaded() and getBytesTotla() not being returned correctly using this code? Does not work for me. movBirdContainer is just an empty mc with 1 empty frame.
Code:
movBirdContainer.createEmptyMovieClip("movBird", 1);
movBirdContainer.movBird.loadMovie("./image.jpg");
onEnterFrame = function()
{
// Preloader code
var nLoaded = Math.round(movBirdContainer.movBird.getBytesLoaded() / 1024);
var nTotal = Math.round(movBirdContainer.movBird.getBytesTotal() / 1024);
trace("total bytes loaded is: " + nLoaded);
trace("total bytes is: " + nTotal);
trace("percent loaded is: " + Math.round((nLoaded / nTotal) * 100));
}
Sound.duration Continues To Increase After GetBytesLoaded()==getBytesTotal()?
Try this:
ActionScript Code:
var s = new Sound();
s.loadSound('sound.mp3',true);
onEnterFrame = function(){
var a = s.duration+" : "+s.getBytesLoaded()+" / "+s.getBytesTotal();
}
Have sound.mp3 or whatever in the same dir as the fla. Test movie, and simulate download. Notice that the Sound.duration continues to steadily increase even after getBytesLoaded()==getBytesTotal()! Example:
45166 : 201558 / 201584
45322 : 201584 / 201584 // done loading bytes
45558 : 201584 / 201584 // duration increasing??
45793 : 201584 / 201584 // still increasing?! and continues for a long time
I was trying to extrapolate the duration of the mp3, since Sound.duration only returns milliseconds of audio downloaded when loadSound stream is set to true(like above). I got so close, but fear I'm stuck. The discrepancy created by this is as long as 10 seconds, which is not acceptable. I am probably going to have to settle for a nasty alternative, like creating id3 tags(ug) or manually enter all the timestamps into XML. If any gurus have any last ideas, I'm all ears.
GetBytesLoaded() And GetBytesTotal() Return Nothing When Loading Content From Another Domain
I have created a movie that loads various media using loadMovie() and then in many cases performs actions on the newly loaded MCs once the loading is complete. I'm relying on getBytesLoaded and getBytesTotal to know when to run these actions.
This works just fine when the content is on the same server as the movie, but I also need to load content from another domain and this is where it falls apart. The media is actually loading just fine into the target MCs, but the functions that should be running when loading is complete never do. The problem is that getBytesLoaded() and getBytesTotal() both return nothing when the content is loaded from another domain.
I'm stuck with loadMovie and the getBytesLoaded/getBytesTotal check as this movie must be published for Flash Player 6, but I have actually tried using loadClip() and onLoadInit() and I get the same problem - onLoadInit() never runs.
Another weird thing is that testing by previewing in flash doesn't show this problem - the content loads fine and getBytesLoaded and getBytesTotal both return values as expected. It's only when I publish the movie and view in a browser that I have this problem.
Where am I going wrong?
Thanks!
GetBytesLoaded() Or Math.round(getBytesLoaded())
hi have a problem with my preloader it is in scene1 and when it loads it goes to scene2 it works fine on my computer but when i upload it to the web it doesn't work right the preloader bar shows up allready loaded can any body help me, here is the script i'am using:
ActionScript Code:
total_bytes=_root.getBytesTotal();
loaded_bytes=_root.getBytesLoaded();
remaining_bytes= total_bytes - loaded_bytes;
percent_done=int((loaded_bytes/total_bytes)*100);
bar.gotoAndStop(percent_done);
ifFrameLoaded("main",11){
gotoAndPlay("main",1);
}
SO What Really Is GetBytesTotal()?
Here is a quick question on the getBytesTotal() function.
When calling this funtion on the _root movie,
i.e _root.getBytesTotal()
It is understood that it will return the total number of bytes of the _root movie.
NOW...
What if the root movie have an empty movieclip on it which is linked to a symbol in a shared library, and is purely there for registration purposes...
Then does getBytesTotal() return the TOTAL including the shared library (which is what I would expect as it is also needed to run the movie) or just the main root movie not taking into account any linkages.
The reason for my question is that I have put a very simple preloader into the first frame of a movie, but when the movie resumes play at frame 2 it seems to have only been half loaded with the linkage part coming in later....and then some other bits of the main root movie after that...
The movie has in fact not fully loaded.
Any ideas in this pls...would be greatly appreciated.
Many thanks
regards
GetBytesTotal()...?
I have been using the method getBytesTotal(), but I have been having a problem with it...so far, I have only been successful using it on _root; if I try to get the total bytes for a MC, it gives me bogus numbers.
For Ex., I have a MC (homeImage) with a large jpg (50k.) When I do:
homeImageBytes = homeImage.getBytesTotal();
and I see the value of homeImageBytes in a dyn txt field, it gives me some wack value like 223 bytes - what's up with that. Why can't I get the # of bytes for a particular MC, but can for root?
Thanks,
Brian Riley
GetBytesTotal
Hello guys. I have this problem: I want to make an instance (movieclip)that contains the "getBytesLoaded" and "getBytesTotal" commands and i want to insert it into my "main" scene so that it shows a progress bar and when it loads to show my logo instead of the progress bar. I know the code looks like this:
if(?.getBytesLoaded()!=?.getBytesTotal())gotoAndPl ay (10)
} else
{
gotoAndPlay (1);
}
;
I don't know what I should put in the code instead of the exclamation marks!
Be carefull!!!I don't want it to be a preloader because I want the user to see the frames at the time that are downloaded not all of them. I just want him to know how many bytes are there left to be complete (don't ask me why!)
Thank you
GetBytesTotal
How can I apply the (getBytesLoaded / getBytesTotal) method on a movie that´s being loaded into a main one?
When I use:
percent = Math.round((_root.getBytesLoaded()/_root.getBytesTotal())*100) add "%";
it seems that (_root) is refering to the main movie, and not the movie in particular. So what happens is that it goes directly into the next scene and the animation gets all mess up. The file is 205K so it´s not that small to jump without preload.
Suggestions are welcome
-----
Manuel
GetBytesTotal?
Someone please throw some light here for me!
I have the following code
movieSize = this.getBytesTotal();
Now this gives me the total file size of the swf right.
But what I would like to get is just the size of the first two sceens,
I have absolutly no actionscript exp, so I am in desperate need of some assistance, as I would not even know which section to swap out!!! lol!
Also if someone could point me to a good beginneers document on actionscripting, I would be 4ever grateful, I have looked through the help files with MX but it reads in stero and is of no help to me.
Andy
GetBytesTotal
I have some text that I’m loading dynamically into a text box. I’ve used loadVariablesNum to get the .txt file into it. However when I try to use the getByteTotal method it gives me nothing.
Help me!
GetBytesTotal HELP
Hi, I can't find a way to get the total bytes from an external swf?
I have an MC, in that mc i have a dynamic field where i want to show the total bytes (getBytesTotal) of an external swf, how do i specify this? I can't get it to work!
I do now how to use the getBytesTotal but I don't know how to get this value of an external swf. Please help!
I use Flash MX.
GetBytesTotal HELP
i want my getBytesTotal to see how many bytes scene 3 contains (U know what I mean.. how big scene 3 is)
but what am I going to write?
scene3.getBytesTotal?
_root.scene3.getBytesTotal?
Pleae Help...
-HM-
GetBytesTotal() ?
Hi everybody.
I'm doing a preloader like "10% of 25Kb" style. I get the total size of the file I'm loading with getBytesTotal() but here comes the problem... the file I'm loading is 8Kb and with getBytesTotal the total size is 30k.
I mean, the downloading time is ok (8k), but on the preloader it shows "25% of 30K"...
Anyone can help?
Thanks
Pier
GetBytesTotal
Ok, I'm having a bit of difficulty with this one ... I really don't even think its possible ...
I making a web page that the client can upload there own photos using a text doc. ...
Is there a way to get the total number of bytes the pic is going to be before its show on the screen ... reason is, I want to make a loader and display the loader message until the number of bytes loaded equals the number of total bytes ...
any suggestions
thanks
-S
.getBytesTotal
Can't find any simple solutions for simple problem.
I ve been searching thru forum but found only solutions for separated jpgs.
I want to preload 4 or more jpges
myJpg = new Array();
myJpg = ["1.jpg","2.jpg","3.jpg","4.jpg"];
and I want to show progres bar of total 4 jpg not each of them.
So I need do somthing like this
Code:
for (var i = 0; i<=_root.myJpg.length-1; i++) {
this.createEmptyMovieClip(["myjpg"+i], i);
this["myjpg"+i].loadMovie(_root.myJpg[i]);
}
//then somehow
total += ["myjpg"+i].getBytesTotal()
loaded += ["myjpg"+i].getBytesLoaded()
myPercent = (Math.round(total/loaded))*100;
Maybe you can point me to some tutorials.
Thanks in advance
GetBytesTotal?
So, im still trying to figure out how i can disable a button when a movieclip doesn't load.
Basically, my problem is that i have an image gallery that shows 12 images to a page. So if they open page 1, and theres only 10 images to show, the buttons over the images 11 and 12 still work. Which is bad, because when you click them flash tries to expand a box with dimensions 0x0 through divison and it ends up shrinking infinitly. I tried some:
if(this.getBytesTotal<100){
button.enabled = false
}
But the problem is, that it cant get the total bytes of an image that isnt there (took me a long time to realize that one). I remember seeing the command, onFailedLoad, or something like that. Could that work? Is there any other way i can get this to work? Because i'm stuck.
How To Use GetBytesTotal();
I would like to make a dynamic text box display the filesize of an external SWF file (in kilobytes, if possible). How would I go about this? I am completely lost with this function.
Any help would be greatly appreciated.
Help GetBytesTotal
Hello everyBody!!!!
I need help doing a loader.
this.createEmptyMovieClip("Content",Fading.getDept h()-1)
Content.loadMovie(_root.contentToLoad)
_root.loader.text = Content.getBytesTotal()
Content is the movieClip where I want to load a movieClip
_root.contentToLoad contains the URL of the movie I want to load
_root.loader.text SHOULD show me the bytes total to load, so I will create a loop the next frames with the loader. But in this Frame Content.getBytesTotal() is 0. I think flash hasn't time enough to calculate the number total of bytes.
Anyone can help me?
Visca el Barça!!!!
GetBytesTotal
Hey,
How can I confirm that flash has actually done the following for me on frame 1:
host = loadMovie("cm_intro.swf", "host");
if (host.getBytesLoaded () == host.getBytesTotal()) {
host.play();
soundTest = new Sound();
soundTest.attachSound("cm_intro");
soundTest.start();
clipLength.text = soundTest.duration/1000+" s";
}
I think getBytesLoaded and getBytesTotal equals "0" so flash instantly enters the loop without downloading.
BTW, the mc "host" was created on a different layer by drawing a rectangle, giving it behaviour "movie clip" and instance name "host" on frame 1.
XML.getBytesTotal()
has anyone had any luck getting XML.getBytesTotal() to work?
I have an XML preloader, and XML.getBytesLoaded() works but, getBytesTotal only shows up when the file is 100% loaded.
Right now, I am using PHP filesize() to pass in the total size of the XML file, and use that instead of XML.getBytesTotal(), but I was wondering if anyone has gotten that function to work.
XML.getBytesTotal()
Has anyone got XML.getBytesTotal() to return a value before the XML file is fully loaded???
XML.getBytesLoaded() worked as youd expect, but getBytesTotal() returns undefined until the file is fully loaded, then it return the filesize.
I have made XML preloaders but I have either had to hard-code the size of bytes or use PHP to pass it in as a param.
Has anyone got the function to work? if so, how?
Thanks
GetBytestotal Of .swf
Hey Guys,
I load a swf into my movie using the loadMovie command. I want to be able to read the size of the swf so I can create a preloader for this movie. How do i go about this?
Lumstar
______________________________________
Keep On Coding!!
If my post helped you, please give me a star.
If your post helps me, I'll give you one!
XML GetBytesTotal()
Hi, I have set up a news scroll for my site. The content is loaded in as xml.
I have put a liitle load window on the front. It works great, using:
this.TheNews.getBytesLoaded();
But, I don't think people are interested in the bytes - so I just want to display the percentage.
This also works, but badly as far as I'm concerned.
Basically, the bytes loaded slowly goes up and up - but the this.TheNews_init.getBytesTotal(); does not appear until the file has completly loaded. Meaning my bytes goes up, then it appears as 100 at the end.
I have thought of loading the xml in twise. Once, to find the files size - and then to compare it with bytes loaded on the second run. But this can't be the best way.
here is an extract from my debug:
0 of
0 of
0 of
9684 of 0
12392 of 0
12392 of 12392
12392 of 12392
Please advise...
M@)
GetBytesTotal() Returns -1 ?
I've got a clip called ImageContainer and within a clip called Image. On the root timeline I have a loadMovie command that loads a movie into _root.ImageContainer.Image
I am trying to preload the content into Image, but on displaying getBytesTotal() for the image it returns -1. Anyone know what I am doing wrong?
The code to display the total bytes is inside ImageContainer i.e. this.Image.getBytesTotal();
Thanks
Using GetBytesTotal With Variables
Is this possible? I've seen that I can't just type variable.getBytesTotal and expect it to work (My instance names aren't fixed, and only those variables know for sure how they're called).
Is there a way of using dot notation in general with variables? I've managed to get my variables in doing it the long way in other cases, e.g:
getProperty (variable_for_instancename)
instead of
instancename._property
however, this doesn't do for some things (the getBytesTotal method is, at the time being, my greatest headache).
Anyways, if somebody could tell me a way to take my variables into dot notation, or to get around the getBytesTotal thing, I'd greatly appreciate it.
GetBytesTotal On Loading Jpg ?
Hi people!!!
i am working on a photo gallery where a movieclips replace themselves with a jpg found on a server. an mc named 'pic001' uses contains a movie clip named 'picture'. i use a loadMovie command to replace 'picture' with a file named 'pic001.jpg'. this works fine.
trick is, some of the photos are large and i would like to have a simple loader sho up until the jpg is entirely loaded. i first managed this by creating a library of swf files (each with their own loader) that work fine, but i wanted to take advantage of the killer new feature, so i don't have to go through the extra step of compiling a .swf file for each image...
when i use the command 'picture.getBytesLoaded()' it only returns the ORIGINAL value for the picture MC (which contains nothing other than a rectangle use to determine placement). is there a way to determine the size of the actual .jpg as it is being loaded?
thanks in advance for any help you may be able to provide...
theoceanfrog
GetBytesTotal Gets More Than BytesTotal ?
Hi,
I have a problem with my preloader. No, relax, it's working fine actually and I won't ask how to build one
I have a holder MC which is showing a preloader and which loads another MC as soon as it's been fully loaded (loader.loadMovie("Main_MC.swf").
In the holder MC i have the preloader showing a status bar and dynamic text telling the user how many kbytes have been loaded. My File (Main_MC.swf) is around 143 kbytes but the dynamic text field shows 210 kbytes ?!
How come?
Thanks in advance
Natsurfer
Flash MX GetBytesTotal Bug Perhaps?
There seems to be discrepancies in the way that getBytesTotal is reported in macintosh OSX and windows flash player...
If you try and load a jpg (i haven't tried it with a movieclip, but i assume it's the same) into a empty movieClip and the jpeg does not exist, or it's taking it's time to connect to the server.....in windows getBytesTotal() returns -1 whereas on the macintosh it returns 0. Whiuch means this code won't work....
if(toLoad.cont.getBytesLoaded()==toLoad.cont.getBy tesTotal()) {
gotoAndPlay(movie);
} else {
//code to continue loading jpeg...
}
I've had to change th if statement to read...
if(toLoad.cont.getBytesLoaded()==toLoad.cont.getBy tesTotal()&&toLoad.cont.getBytesTotal()>1)
Has anyone else seen this problem? Or am i doing something wrong?
thanks...
|