Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




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



FlashKit > Flash Help > Flash ActionScript
Posted on: 01-02-2002, 11:23 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

GetBytesTotal Returns 0
This is really doing my nut, i'm preloading an external jpg into a movie on my stage, with a preloader on the main stage rather than the loaded movie, but it always return 0 to getBytesTotal(). Here's the code:


Code:
_root.createEmptyMovieClip('holder', 2);
holder.loadMovie("img1.jpg");
holder._x = 50;
holder._y = 50;
var l = holder.getBytesLoaded();
var t = holder.getBytesTotal();
if (l<t) {
this.texttotal.text = Math.round(t/1000)+'kb total';
gotoAndPlay (1);
} else {
// fully loaded
this.texttotal.text = "loaded";
//this._visible = false;
}

GetBytesTotal Returns 0
This is really doing my nut, i'm preloading an external jpg into a movie on my stage, with a preloader on the main stage rather than the loaded movie, but it always return 0 to getBytesTotal(). Here's the code:


Code:
_root.createEmptyMovieClip('holder', 2);
holder.loadMovie("img1.jpg");
holder._x = 50;
holder._y = 50;
var l = holder.getBytesLoaded();
var t = holder.getBytesTotal();
if (l<t) {
this.texttotal.text = Math.round(t/1000)+'kb total';
gotoAndPlay (1);
} else {
// fully loaded
this.texttotal.text = "loaded";
//this._visible = false;
}

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...

XML Object: GetBytesLoaded() And GetBytesTotal Returns Same
i am trying to build a preloader for loading XML documents, but getBytesLoaded() and getBytesTotal returns the same number as the document is loading.

has anyone heard of a problem with this?

GetBytesTotal Returns Wrong File Size...
my file size is 42KB yet getBytesTotal returns as 83K.. is this a bug?

Sending Text With "RETURNS" Through A Button To A Dynamic Textfields With "RETURNS"
I have a dynamic textfield which I am loading text into through a button. Here is the button code

on (press) {
_root.about = "this is my text that is loaded into a dynamic text field named about";
}

I'm trying to make returns appear in the dynamic textfield


HERE is what I would like the text to look like in the dynamic textfield


this is my text
that is loaded into a
dynamic textfield named about




I tried using /n in the button script but nothing appeared.

n (press) {
_root.about = "this is my text /n
that is loaded into a /n
dynamic text field named about";
}

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@)


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.

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...

GetBytesTotal Of A Compressed Swf?
Hi all,

Has anybody any idea how to get the correct value of a compressed swf?? I have a preloader and I'm using the mc.getBytesTotal value to control several other things...but it doesn't return the correct value. mc.getBytesLoaded doesn't either...it returns the value of the swf as if it was not compressed.

Any help would be greatly appreciated
Natsurfer

GetBytesTotal When I Use LoadMovie
I use this code:

_root.createEmptyMovieClip("image", 1);
_root.image.loadMovie(_root.image);

I get "_root.image" from a serverside script.

Is it possible to make some nice preloader that shows total bytes?

LoadMovie , GetBytesTotal()
I´m using loadMovie to load another small movie.

1. I want to know when this movie is loaded.

Is that possible ?

2. Is there some way to get getBytesTotal(), or frames from the movie beeing loaded ? (without any AS in the movie that is beeing loaded)

any hints on this questions ?

peace.

GetBytesTotal And Loaded
Hey peeps,

Ok if I do this

mov=createEmptyMovieClip("test")
mov.loadMovie("file.swf")
mov.onEnterFrame=function(){
total=this.getBytesTotal()
loaded=this.getBytesLoaded()
trace(total+','+loaded)
}

the trace only outputs zero. The actual filesize is over 19 k. Whats the deal?

Xml Obj With GetBytesLoaded And GetBytesTotal
is it possible to use getBytesLoaded and getBytesTotal methods on an xml object?

GetBytesTotal() Problem
Hi all,

I'm having a problem with getBytesTotal() method.
I'm loading an external swf into an empty movie clip. I'm using the getBytesTotal in the script that run the preloader.
The problem is I'm getting -1 as the return value from the getBytesTotal. I do get the total size of the external swf, but I only get it after the movie has been completely loaded. So that value is useless.

Can anybody tell me what's going on?

Thanks in advance

GetBytesTotal Problem
I'm doing a site in MX. it consists of a first frame with global variables defined and a second frame stopped with all the actionscript for the site. I'm trying to load external swf images as thumbnails in the second frame with the rest of the actionscript. that part is working fine. but I want the images to have an alpha of 0 and then when they are loaded, to fade in as opposed to just pop up. when i put the getBytesTotal line of code with the rest of the script on the second frame it returns undefined. even if i put it on it's on on enter frame for the root movie. but if use the trace inside a button on the movie it returns the correct size. anyone have any suggestions how to fix this? also do i want to reference the swf or the blank movie clip containing the swf when using the getbytestotal function. thanks.

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..

LoadVars.getBytesTotal ();
i tried first time to use this method, but i dont recieve any information

i use this script:


Code:
pollURL = "http://mysite.com/projects/tfts/poll.asp";
function pollLoaded ()
{
_root.gotoAndStop ("display");
}
poll = new LoadVars ();
poll.onLoad = pollLoaded;
function submitChoice ()
{
// loaded size
loadedSize = poll.getBytesTotal ();
loadedSize_txt.text = loadedSize;
var choice = radioGroup.getData ();
poll.load (pollURL + "?choice=" + choice);
_root.gotoAndStop ("waiting");
}
where shoud i call this method?
i tried to display it in d. txt field

thanks jan

GetBytesTotal For _root.mc.mc.jpg
For the life of my sanity, could someone please explain how I can get the total bytes of a jpg loaded into _root.mc.mc?

I'm trying the following, but am just having no luck;
code: thumbnails["thumbnail"+i].onEnterFrame = function(){

// Trace each thumbnail
trace(thumbnails["thumbnail"+i] + " traced");

/* Create thumbnails preload function. */
if (thumbnails["thumbnail"+i].getBytesLoaded() > 0 && thumbnails["thumbnail"+i].getBytesLoaded() >= thumbnails["thumbnail"+i].getBytesTotal()){
delete thumbnails["thumbnail"+i].onEnterFrame;
_level0.loadnote = "Done.";
trace("done");
} else {
trace("Bytes total = " + thumbnails["thumbnail"+i].getBytesTotal());
if (thumbnails["thumbnail"+i].getBytesLoaded() > 0){
var tkilobytes = Math.ceil(thumbnails["thumbnail"+i].getBytesTotal() / 1000);
var tpercentLoaded = Math.ceil(thumbnails["thumbnail"+i].getBytesLoaded() / thumbnails["thumbnail"+i].getBytesTotal() * 100);
_level0.note.html = true;
_level0.loadnote = "Loading ... " + tpercentLoaded + "%";
trace("loading");
}
}

}

An example result of thumbnails["thumbnail"+i] is: _level0.thumbnails.thumbnail1

Contributions to "my sanity" will be greatly appreciated.

Flash MX 6.0

GetBytesTotal/Loaded Of A JPG
hello,
Just wondering if its possible to use the getBytesLoaded/getBytesTotal commands with a JPG that is being loaded:
eg:

//this bit goes somewhere in the scene
loadMovie (myPic.jpg,_root.picDrop);

//this bit goes in the actions for the picDrop instance and is looped
onClipEvent(enterFrame){
_global.myPicLoaded = getBytesLoaded;
_global.myPicTotal = getBytesTotal;
}
if you cant getBytesLoaded of a jpg then is there a workaround for this problem?

any help is much appreciated.
Thanks in advance.
Owen

Preload - GetBytesTotal() Always The Same?
Hi,
Another problem here with an image-preloader:
In the following code there is a for loop who duplicates a movieclip and does a loadMovieClip ... with an image.
But when I trace the "getBytesTotal" and the "getBytesTotal" I always get the value "639" (bytes). The images (thumbn) are between 3-6k.


Code:
// XML load
menuXml.onLoad = function(success)
{
loadProduct(menuXml.firstChild.childNodes[0].attributes.collection_id);

if (success)
{
_global.numberItems = menuXml.firstChild.childNodes.length;

for(i=0; i< menuXml.firstChild.childNodes.length; i++)
{
temp_mc = mcSliderPhotoHolder.duplicateMovieClip("photoContainer"+i, i);
temp_mc._x = (widthSpace * i);

temp_mc.collectionID = this.firstChild.childNodes[i].attributes.collection_id;

temp_mc.mcItem.mcPhotoHolder.loadMovie(URL+"images/thumbnails/"+this.firstChild.childNodes[i].attributes.model_number+".jpg", i);

// ????
total = eval("photoContainer"+i).getBytesTotal();
loaded = eval("photoContainer"+i).getBytesLoaded();

trace(total + " / "+loaded); // returns always 639 / 639

temp_mc.onEnterFrame = function()
{
percent = loaded/total * 100;

if(percent >= 100)
{
delete this.onEnterFrame;
this.gotoAndPlay(2);

startFeather();
updateMovie();
}
}// end onEnterFrame
}// end For loop
}
}
Does anyone see what i'm doing wrong?

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");
}

[F8] Using GetBytesTotal On An External .swf?
I'm creating a website purely for fun with no commercial value or anything. Just messing around since it's been awhile since i've done this. Basically I my main .swf that the user views. This file loads all the components to the site as they're all saved as seperate files.

(so that the media player isn't saved into the main page but a seperate file named mediaplayer.swf and the same for the 'news movie clip' (news.swf) to conserve space... fairly basic)

so the main page is basically the frame work with the code telling it to
"loadMovie("mediaplayer.swf",placeholdermedia) ;"

this works fine. However, is there anyway i can apply the getBytesTotal command to an external clip in order to build a loader for it?

So that if i wanted to load external music files it will display a load bar so the user isn't sitting there looking at nothing while it loads.

i tried _url.[url of the external file].getBytesTotal(); but that's not correct.

any ideas on how i could make my main movie apply the getBytesTotal(); command to an external movie BEFORE it's actually loaded?

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

Problem With GetBytesTotal()
Hi, this is a very basic AS2 question. I'm trying to trace the total size of a SWF that I load into an empty movie clip but I keep getting "0" as the file size's value. I must be doing something wrong that I'm not seeing. Please take a look and let me know. Thanks. This is the code:

btn_1.onPress = function()
{
game_mc = createEmptyMovieClip("game_mc", 1);
game_mc.loadMovie("game.swf");

Ttotal = game_mc.getBytesTotal();
trace(Ttotal);

}

GetBytesTotal With A Dynamic MC Name? How?
hmm i having trouble with the syntax on this one.. im trying somthing like..


Code:
frame 1:
myNextTargetMC = "mc_holder";
loadMovie("file.swf", myNextTargetMC);

some time later:
myLoadedBytes = eval(myNextTargetMC+".getBytesTotal()");
the line in red doesent work.. and it doesent surprise me..
but i hope you can see what i'm trying to do..
can anyone help me out?

note: i know that i can jsut use
Code:
mc_holder.getbytesTotal();
but its not what i want.. cause the name of the movieclip has earlier been set dynamical, so this has to be with a dynamic mc name also

Xml.getBytesTotal & Dynamic XML
Hey all,

I don't believe there's a way to make this work, but I thought I would drop a post here anyway to see if anyone out there has found a way

I'm working on a Flash app that is going to pull some data from a MySQL database via PHP scripts which format the SQL query results into a useable XML. The issue I'm having is that I cannot get a byte total on the XML document I'm loading since it's dynamically created at request time.

I can't give the end user any feedback on load progress since getBytesTotal always returns 0 until the dynamic XML is fully loaded. I've tried using output buffering commands in PHP so that Flash wouldn't receive any data until the query was complete, but even that doesn't seem to work.

Aside from having the PHP script create and save a static XML document on the server at certain intervals, does anyone have any ideas on how I could get something like this to work?

Copyright © 2005-08 www.BigResource.com, All rights reserved