Some weird output

Hey. just wondering if someone can explain to me why I get this output:

“Target not found: Target=“undefined” Base=”_level0"

It shows up after my preloader finishes and goes to the nextscene. Heres my actionscript setup on frame 2.

[AS]loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = Math.ceil(loadedbytes/1000);
totalkbytes = Math.ceil(totalbytes/1000);
if (loadedbytes == totalbytes) {
nextScene();
}
percent = Math.ceil(loadedbytes/(totalbytes/100));
tellTarget(_root.loading) {
gotoAndStop(_root.percent);
}[/AS]

my preloader instance name is “loading” . And it works fine, I just dont understand why im getting that output?

[AS]
loadedbytes = getBytesLoaded();
totalbytes = getBytesTotal();
loadedkbytes = Math.ceil(loadedbytes/1000);
totalkbytes = Math.ceil(totalbytes/1000);
if (loadedbytes == totalbytes) {
nextScene();
}
percent = Math.ceil((loadedbytes/totalbytes)*100);//that will give you a percentage
tellTarget("_root.loading") {//needs to be in quotes or it thiks it is a variable
gotoAndStop(percent);//if that relates to the percent you just defined you can write it like that
}
[/AS]

Hope that helps,
Shawn

Why are you using [font=courier new]tellTarget[/font] anyway? It has been deprecated since Flash 5!! :-\

_root.loading.gotoAndStop(percent);

I was wondering the same thing myself, however, I figured I would leave it since it seems they know how to use it, and I didn’t want to explain the other format, lazy me always tring to get out of working. :slight_smile:

Thanx for the help guyz. I figured it out :thumb: . The script was taken from Flash Super Samurai so that might explain why its out of date…

btw, what does deprecated mean?

deprecated means, disapprove of strongly literally speaking, for flash it means it has a newer better way of doing it, and that method will probably be removed in a future release.