Flash MX LoadVariables GetBytesLoaded GetBytesTotal
i know how to use getBytesLoaded getBytesTotal on an external loading .swf or .jpg but is posible to use it on a .txt that you loading in useing loadVariables ?
FlashKit > Flash Help > Flash ActionScript
Posted on: 08-29-2003, 12:58 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.
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
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!
LoadVariables No Effect On GetBytesTotal?
Hey people,
I'm working on a little application where I need to load .swf's and .txt's every once in a while. While these are loading I've got a little pre-loading bar that'll just show the % loaded. However, this is all working with the .swf files. I'm just using getBytesTotal and getBytesLoaded to calculate the %. But this doesn't seem to work with the .txt files, they don't seem to affect the butesTotal. I do have data in the .txt files, not much, but they should make a difference right?
What can I do to fix this?
SaphuA
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);
}
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...
_root.getBytesLoaded() And Flash 5
Howdy,
Quick Flash 5 question for you.
I haven't seen any examples or been able to successfully use "_root.getBytesLoaded()" with an instance like this "_root.myinstance.getBytesLoaded()". While this may work if the playhead is already at "myinstance", it does not seem to work if "myinstance" is later in the timeline.
1. Can I target an instance in my movie, which hasn't been reached by the playhead, using the .getBytesLoaded()? If so how?
2. ifFrameLoaded ("Scene 1", "myFrameLabel") {//some code }
is depricated in Flash 5. How can I do the equivalent using either .getBytesLoaded or _framesloaded ?
Determining the bytesloaded and bytestotal of a Scene>FrameLabel is still a mystery to me.
Thanks for any replies!
Joe
Is There A GetBytesLoaded For Flash Remoting?
Yo, just out of curiousity, is there a way to get the bytes loaded from a PendingCall like you can do with XML?
For example:
ActionScript Code:
var rs:XML = new XML();
rs.ignoreWhite = true;
rs.load('hugeXMLdocument.xml');
var preloadMC:MovieClip = _root.createEmptyMovieClip('blah',1000);
preloadMC.onEnterFrame = function(){
var loaded:Number = rs.getBytesLoaded();
var total:Number = rs.getBytesTotal();
var prcnt:Number = Math.round(loaded/total*100);
trace(prcnt);
if(prcnt >= 100) this.removeMovieClip();
}
I was wondering if there is something similar for PendingCalls (Flash Remoting Calls).
For Example:
ActionScript Code:
/* lets say i've already created the remoting connection and everything */
var pc:PendingCall = myremote.getMyInfo();
pc.responder = new RelayResponder(this,'getMyInfo_Result','getMyInfo_Error');
/* if there any ways to do an onEnterFrame similar to the XML
example so I can get the remoting calls progress?*/
Flash 5 - Using A Variable As The Target Name With The Getbytesloaded Command?
Hi Folks,
I have a quick question about the getbytesloaded and getbytestotal commands in flash 5 (Hopefully they haven't changed in MX - I won't be getting that for another month or two). At the moment I'm doing a site for a friend which is a photography portfolio. I am using an external movie file for each photo which get loaded by the main movie in a great big loop - the files are called 1.swf, 2.swf, 3.swf et cetera all the way up - the looping load command is controlled by an external text file which contains a variable that tells the loop when to stop looking for movies to load.
My problem is that I want the flash movie to load an external file and when it's fully loaded, activate a button that will allow you to view the photo that has just loaded. My problem is that I'd like to show the status of the photo loading in the main movie and when the file has finished loading the loop would continue on to load the next file all the way up to the total amount of movies. I thought that I'd simply be able to do something like this to get the bytes loaded of the external movie to compare to the bytes total:
Frame 1 actions:
movienumber = 1 (controlled by the looping if)
Frame 2 actions:
percent_loaded = ("_level" + movienumber).getbytesloaded()
total_size = ("_level" + movienumber).getbytestotal()
if ( int(total_size) == int(percent_loaded)) then
movienumber = int(movienumber) + 1
end if
and when the two match the loop does a tell target and increases its count. Now my only problem is that the getbytesloaded() command seems to only work with an absolute name for a level or a movieclip - it will not allow you to use a variable for the name of the movieclip it's getting its size for. For example if I say
bytes_loaded = _level20.getbytesloaded()
Then it works fine but if I say
movie = _level20
Bytesloaded = movie.getbytesloaded()
It doesn't work at all - my variable is undefined. I've tried a few tricks with bracketing as you can see above - i've also tried doing things like
movie = _level20
bytesloaded = string(movie).getbytesloaded()
I've had no luck with getting the getbytesloaded() to work with the variables names at all. Also if I need to use levels instead of target movies to get the entire thing to work then how can I use the set property command to position a loaded movie in x and y?
But no dice at any stage. It's pretty much the only thing holding me back at this stage so If anyone can explain a method to allow the getbytesloaded to work with a variable as its movieclip name then I'd really appreciate it. I'm sure it's probably something stupid (last problem I had was not using eq instead of = in flash 4) but hopefully someone can shed some light on it.
All the best,
John
[Flash MX] Preloading JPG's When Using Mymovie.loadMovie() And GetBytesLoaded()
i have a script that creates a few instances of the MC imageHolder tha i created. within imageHolder there is another MC called loader. to bring in JPG images i use:
code:
_root.imageHolder.loader.loadMovie("imageURL")
if i want to use getBytesTotal() and getBytesLoaded() for a graphic preloader, what MC do apply these methods to? i have tried both of the following:
code:
total = _root.imageHolder.getBytesTotal()
total = _root.imageHolder.loader.getBytesTotal()
but neither work. any suggestions? please it's quite urgent
LoadVariables: Can Two LoadVariables In The Same Script Cause A Problem?
Hi,
It seems that for some reason, my attempt to send vaiables is not working. I'm not certain if its my syntax or the fact that I have a second loadVariables later in my script(with a different name of course). help?
heres a sample of the script that I'm using:
ClickedSendVar = new loadVariables();
ClickedSend = "bob="+bob+"&fred="+fred+"&jim"+jim;
ClickedSend.send(_root.on_card, ClickedSend, "POST");
Flash LoadVariables
Hi all,
Ive been having some recent problems with FireFox retrieving data from a php page which checks if the user is logged in, IE7 works fine which I cant understand.
What the flash is doing is once it loads is checks the game_login.php page by using the loadvariables function:-
game = 66;
loadVariablesNum("game_login.php?game="+game, 0, "POST");
then the game_login.php checks session variables and outputs:-
print "&Name=".$_SESSION['kt_login_user'];
It used to work and for some reason wont anymore.
Edited: 10/28/2007 at 09:14:21 AM by Syndicate24
Flash 5: Loadvariables INT
Hello,
I'm trying to retrieve some data at startup. All connection and code is correct. I jsut can't get a movie clip property to _visibe if a condition is met.
I tried using onClipEvent as shown below and also just placing tie loadVariables at the top line of the root.
loadVariables("pathtofile", page, "POST")
//Troubleshooting > this code executes if I attach and execute it from a button.
No matter what I do, I can't get loadVaraibles to pass ti's value from the server at startup.
Any suggestions on would be greatly appreciated.
onClipEvent(data){
_root.fshowsignin();
if(page >=1){
__root.isignin._visible = true;//set sigin to visible if > 1 _root ==
}
}
Thank you
Ike Austin
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.
|