This content has been marked as final.
Show 11 replies
-
1. PreLoaderBar Error
yachts99-2vTvY1 Jun 7, 2006 12:28 AM (in response to gold987987987)From the Flash Help section:
Deprecated Operator summary
"Add"
Deprecated since Flash Player 5. Macromedia recommends that you use the add (+) operator when creating content for Flash Player 5 or later. This operator [add] is not supported in Flash Player 8 or later. -
2. Re: PreLoaderBar Error
gold987987987 Jun 7, 2006 7:44 AM (in response to yachts99-2vTvY1)Thanks so much!!!! That stopped the error message! My only problem now is getting the actual progress bar to start working again. As the swf loads the progress bar does not show or even move. I am posting all the Action Script in the preloader in hopes you might find something wrong with it too:
1st frame contains
t = this.getBytesTotal();
l = this.getBytesLoaded();
p = l/t*100;
_root.PreLoaderBar.gotoAndStop (Math.round(p/1)+1);
_root.PreLoaderBar.PercentL = String(int(p)) + "%";
The 2nd frame contains:
t = this.getBytesTotal();
l = this.getBytesLoaded();
if (t<>l || loaded_ok == NULL) {
gotoAndPlay (1);
}
_global.txt_logo = txt_logo;
_global.txt_slogan = txt_slogan;
_global.txt_b1 = txt_b1;
_global.txt_b2 = txt_b2;
_global.txt_b3 = txt_b3;
_global.txt_b4 = txt_b4;
_global.txt_b5 = txt_b5;
_global.txt_copyright = txt_copyright;
_global.contact_script_url = contact_script_url;
_global.contact_script_confirm = contact_script_confirm;
_root.musicoff = false;
That's it, thanks for your help! -
3. Re: PreLoaderBar Error
gold987987987 Jun 7, 2006 1:10 PM (in response to gold987987987)Does anyone have any suggestions for my Action Script? Does any of this not look right for FP8 or AS 2.0?
Thanks, -
4. Re: PreLoaderBar Error
yachts99-2vTvY1 Jun 7, 2006 1:58 PM (in response to gold987987987)Not so sure about this one but take a look again at Deprecated Function summary in the Flash Help as "int" is in there as well as "add".
quote:
int(value:Number)
Deprecated since Flash Player 5. This function was deprecated in favor of Math.round(). -
5. Re: PreLoaderBar Error
gold987987987 Jun 7, 2006 2:08 PM (in response to yachts99-2vTvY1)Sorry to be such a Action Script newbie but how would your rewrite that code with the Math.round()
Thanks for all your help! -
6. Re: PreLoaderBar Error
yachts99-2vTvY1 Jun 7, 2006 2:11 PM (in response to gold987987987)_root.PreLoaderBar.PercentL = String(Math.round(p)) +"%"; -
7. Re: PreLoaderBar Error
gold987987987 Jun 7, 2006 2:26 PM (in response to yachts99-2vTvY1)We'll I change it and it still doesn't work. Good news is I'm not getting an error. Can you think of anything elese in this AS that might be causing this not to work from one version of FP and AS to another?
Thanks for your help. -
8. Re: PreLoaderBar Error
yachts99-2vTvY1 Jun 7, 2006 3:12 PM (in response to gold987987987)I'm not too sure how you were getting the bar to move at all!
Normally I'd expect to see some code that lengthens the bar as the percentage goes up, something like:
preloader.bar._width = percentLoaded;
Sp what is making the bar change size? -
-
10. Re: PreLoaderBar Error
yachts99-2vTvY1 Jun 8, 2006 12:09 AM (in response to gold987987987)Congratulations!
As a typo was the cause I would recommend the link below, which is an article on ActionScript 2.0 Best Practices (from Macromedia/Adobe) where it suggests naming conventions. Having read this article you probably would have used preLoaderBar as the spelling and I bet your code would have been a lot easier to debug! There's tons of stuff in this article that make AS easier.
http://www.adobe.com/devnet/flash/articles/as_bestpractices_02.html -
11. Re: PreLoaderBar Error
gold987987987 Jun 8, 2006 8:37 AM (in response to yachts99-2vTvY1)I'll check it out. Thanks again for all your help!

