# SWF errors only when uploaded

**URL:** <https://forum.kirupa.com/t/swf-errors-only-when-uploaded/59291>\
**Category:** flash\
**Created:** [July 29, 2004, 11:40pm UTC](https://forum.kirupa.com/t/swf-errors-only-when-uploaded/59291 "2004-07-29T23:40:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![evilcowsan](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/evilcowsan/32/651_2.png) [@evilcowsan](https://forum.kirupa.com/u/evilcowsan)\
**Post date:** [July 29, 2004, 11:40pm UTC](https://forum.kirupa.com/t/swf-errors-only-when-uploaded/59291/1 "2004-07-29T23:40:49Z")

</div>

Hey i am messing around with a random bg preloader and it works fine when i test it in flash and hit cntrl+enter to simulate the dl. It shows the percent and draws a bar. But when i post it to my website and try it i either get NaN% or something like -19,000% but the page still loads up fine. Anyhelp would be greatly appreciated.

I’ve included the fla so you can see it work correctly.  
And here’s a link that should show it going weird [http://www.monkeymods.com/test](http://www.monkeymods.com/test)

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:** [July 30, 2004, 8:02am UTC](https://forum.kirupa.com/t/swf-errors-only-when-uploaded/59291/2 "2004-07-30T08:02:58Z")

</div>

Funny, it seems to be loading fine in my browser. I can see that it increments from 0% to 100% just fine 🙂

---

<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:** [July 30, 2004, 8:31am UTC](https://forum.kirupa.com/t/swf-errors-only-when-uploaded/59291/3 "2004-07-30T08:31:19Z")

</div>

odd, maybe my comp has seen the loading screen so many times that it’s sick of the file ;p I tried clearing the cache but who knows. 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:** [July 30, 2004, 8:55am UTC](https://forum.kirupa.com/t/swf-errors-only-when-uploaded/59291/4 "2004-07-30T08:55:41Z")

</div>

Works fine for me too.

---

<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:** [July 30, 2004, 1:28pm UTC](https://forum.kirupa.com/t/swf-errors-only-when-uploaded/59291/5 "2004-07-30T13:28:18Z")

</div>

Worked fine for me, but…

I’d strongly suggest adjusting your code so that the prototype is NOT nested within an onEnterFrame and if you change “this.\_width = Percent;” to “this.\_xscale = Percent;” you might get the effect you’re going for. But the reason nothing fades or scales-in is because you have the functions all hackneyed and misplaced (sorry).

Also, if you look closely at the load percent it will display a number in the negative thousands for a second or two when it first starts.

You could also get rid of about 1/2 of the code you have there.😉

I don’t know if you’re used to older versions of Flash (your programming style reminds of me Flash 5-ish programming), but with MX 2004, OOP, and AS2.0 I’d say you could clean things up a bit and optimize your code to be bullet-proof.

(As if that’s all not enough, I would also suggest using myText.\_text = “some text” instead of giving the textBox a var name and setting the var to equal the text – again, just more Flash 5 flare peeking through your code) :red:

---

<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:** [July 30, 2004, 9:10pm UTC](https://forum.kirupa.com/t/swf-errors-only-when-uploaded/59291/6 "2004-07-30T21:10:32Z")

</div>

No hard feelings newhope, I’m incredibly new to this and I’m breaking the first newb law by just reading random tuts and trying to train myself without a well based introduction. I just wanted to test this idea before i jumped into fully training myself. I’m pretty decent in C++ so i just figured i could cost on basic rules ;p

One question, do you know if i can have an if statement like if percent == NaN? cuz i’d like to just get rid of the possibilities of having NaN and -19000 by just replacing them with 0%. 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:** [July 31, 2004, 2:22pm UTC](https://forum.kirupa.com/t/swf-errors-only-when-uploaded/59291/7 "2004-07-31T14:22:52Z")

</div>

No! No hard feelings at all!🙂

Seriously, it sounded cynical and snyde but I was only trying to make some coding suggestions.

Here are a few things you can try:

```auto
function checkData() {
     var percent = textBox.text;
     if (percent == -19000) {
          // do something
     } else if (isNaN(percent)) {
          // do something else
     } else {
          // do another thing
     }
}

```

I think there’s nothing wrong with your approach to self-teaching (it’s how I learned, actually). Screw those ill-defined newb laws. 🙂

---

<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:** [July 31, 2004, 11:36pm UTC](https://forum.kirupa.com/t/swf-errors-only-when-uploaded/59291/8 "2004-07-31T23:36:55Z")

</div>

Thanks kenny, i fully understood your comments as kind suggestions and never took them as rude =)

Thanks for all the help!
