Groups | Blog | Home
all groups > flash actionscript > august 2005 >

flash actionscript : autoloader script imploding warp core breach imminent!


pc1971
8/29/2005 11:44:04 PM
ok, i wrote my first autoloader today and i get errors when i preview the
movie... here is the script:

onClipEvent (load) {
total = _root.getBytesTotal();
}
onClipEvent (enterFrame) {
loaded = _root.getBytesLoaded();
percent = int(loaded/total*100);
text = ""+percent+"%";
gotoAndStop(percent);
if (loaded == total) {
_root.gotoAndPlay(2);
}
}


here are the errors:
Scene=Scene 1, Layer=Layer 1, Frame=1: Line 1: Clip events are permitted only
for movie clip instances
onClipEvent (load) {

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 4: Clip events are permitted only
for movie clip instances
onClipEvent (enterFrame) {
Kolja1987
8/29/2005 11:58:10 PM
Kolja1987
8/30/2005 12:00:00 AM
Go to Insert -> New Symbol, enter something to name the symbol, choose Movie
clip, and click OK. Press Ctrl+L (if you can't see your library), drag&drop
movie clip you just created to the main stage, click on it and paste the code
you wrote up here.
Hope you get it!
pc1971
8/30/2005 1:20:45 AM
Originally posted by: Kolja1987
You just need to create empty movie clip, place it somewhere in the movie, and
attach this code you wrote to it, not to the root of the movie. Then try again.

pardon my ignorance, but could you please explain the best way to do this...
as simple as possible or a different script 0_o
AddThis Social Bookmark Button