Loadbar workin not %field

Here is my site. http://www.alimirza.com
Loading is perfect with loadbar but it doesn’t going well with percentage field which shows only 1% or 2% though bar progress with the load data.

[AS] percentLoaded = (theClip.getBytesLoaded()/theClip.getBytesTotal());
_root.transition.loadBar._width = 100*percentLoaded;
_root.transition.loadText = Math.round(percentLoaded)+"% Loaded";
[/AS]

One more thing on my index.swf the main loader doesn’t appear and work.
[AS]
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar._width = getPercent100;
_root.loadText = Math.round(getPercent
100)+"%";
if (bytes_loaded == bytes_total) {
_root.gotoAndStop(5);
}
[/AS]

Please help!!!
thanks in advance.

Question 1.
Is loadText the var name for the textfield or is it the name for the textfield instance? If its the instance name then it should be;

_root.transition.loadText**.text** = Math.round(percentLoaded)+"% Loaded";

Aslo, is it a dynamci text box?


Question 2.
Do you have an instance called loadBar? And see above for the text box.

Regards,
Viru.

loadTest is the var name of the textfield. no instance name given for the dynamic field.
Yes! loadBar is the instance name for progress bar.

Ok, are the paths targeting the bar and the text field correct in each case? And check for spelling.

mmh you forgt to multiply ‘percentLoaded’ by 100 before rounding it =)
cheers

I double checked them.
loadBar for external swf is working perfectly but same place loadText %field not working at all infact giving 1% or 2% doesn’t excede.
Let me upload my FLA’s n If you do get sometime to look at them
thanks.

mlkdesign that right for the external.swf and thanks for it:)

But
what about loader on my main swf.its not showing up at all.
on first frame script is following with label “kick”
[AS]
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
_root.loadBar._width = getPercent100;
_root.loadText = Math.round(getPercent
100)+"%";
if (bytes_loaded == bytes_total) {
_root.gotoAndStop(5);
}
[/AS]
on 4th frame

[AS]gotoAndPlay(“kick”);[/AS]

for the second AS


bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());

dunno if it helps but getBytes Total and Loaded are whole numbers, no need to round them…

you want to round the answer to the division and only that… too many Math.round functions are in your code at the moment.

I would do…


bytes_loaded = _root.getBytesLoaded();
bytes_total = _root.getBytesTotal();
getPercent = Math.round(bytes_loaded/bytes_total*100);

is the fla too big or can ya post it ?

here is the fla file.

i found that you need to embed font onlines to make dyamic text (your percentages) to work correctly, thats if they arent showing at all.

EDIT ::just saw your attachment, nevermind :stuck_out_tongue:

It is embeded with all characters.
because I am using the same loader’s copy everywhere else in mysite.
Problem is being loadbar and textfiled and loading…mc in first frame do not appear till 48kb or 50kb loaded.