# Loadbar workin not %field

**URL:** <https://forum.kirupa.com/t/loadbar-workin-not-field/29952>\
**Category:** Uncategorized\
**Created:** [September 2, 2003, 12:13pm UTC](https://forum.kirupa.com/t/loadbar-workin-not-field/29952 "2003-09-02T12:13:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![alimirza](https://avatars.discourse-cdn.com/v4/letter/a/9e8a1a/32.png) [@alimirza](https://forum.kirupa.com/u/alimirza)\
**Post date:** [September 2, 2003, 12:13pm UTC](https://forum.kirupa.com/t/loadbar-workin-not-field/29952/1 "2003-09-02T12:13:38Z")

</div>

Here is my site. [http://www.alimirza.com](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 = getPercent_100;  
\_root.loadText = Math.round(getPercent_100)+"%";  
if (bytes\_loaded == bytes\_total) {  
\_root.gotoAndStop(5);  
}  
[/AS]

Please help!!!  
thanks in advance.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2003, 12:47pm UTC](https://forum.kirupa.com/t/loadbar-workin-not-field/29952/2 "2003-09-02T12:47:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2003, 12:54pm UTC](https://forum.kirupa.com/t/loadbar-workin-not-field/29952/3 "2003-09-02T12:54:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2003, 12:55pm UTC](https://forum.kirupa.com/t/loadbar-workin-not-field/29952/4 "2003-09-02T12:55:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2003, 12:58pm UTC](https://forum.kirupa.com/t/loadbar-workin-not-field/29952/5 "2003-09-02T12:58:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2003, 1:02pm UTC](https://forum.kirupa.com/t/loadbar-workin-not-field/29952/6 "2003-09-02T13:02:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2003, 1:08pm UTC](https://forum.kirupa.com/t/loadbar-workin-not-field/29952/7 "2003-09-02T13:08:42Z")

</div>

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 = getPercent_100;  
\_root.loadText = Math.round(getPercent_100)+"%";  
if (bytes\_loaded == bytes\_total) {  
\_root.gotoAndStop(5);  
}  
[/AS]  
on 4th frame

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2003, 1:18pm UTC](https://forum.kirupa.com/t/loadbar-workin-not-field/29952/8 "2003-09-02T13:18:59Z")

</div>

for the second AS

```auto

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…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2003, 1:33pm UTC](https://forum.kirupa.com/t/loadbar-workin-not-field/29952/9 "2003-09-02T13:33:10Z")

</div>

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…

```auto

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

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2003, 1:34pm UTC](https://forum.kirupa.com/t/loadbar-workin-not-field/29952/10 "2003-09-02T13:34:58Z")

</div>

is the fla too big or can ya post it ?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2003, 1:41pm UTC](https://forum.kirupa.com/t/loadbar-workin-not-field/29952/11 "2003-09-02T13:41:57Z")

</div>

here is the fla file.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2003, 1:42pm UTC](https://forum.kirupa.com/t/loadbar-workin-not-field/29952/12 "2003-09-02T13:42:31Z")

</div>

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 😛

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 2, 2003, 1:52pm UTC](https://forum.kirupa.com/t/loadbar-workin-not-field/29952/13 "2003-09-02T13:52:39Z")

</div>

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.
