Copy link to clipboard
Copied
I'm making a project for my online class, and my script is having errors in 2 lines. I need some help. Can anyone figure out what's wrong with this?
Import Flash.events.Event; Stop();
This.addEventListener (Event.ENTER_FRAME, loading);
Function Loading (e:Event)
Var total: Number = this.stage.loaderInfo.bytesTotal;
Var loaded: Number = this.stage.loaderInfo.bytesLoaded;
Loading_bar.scaleX = loaded/total;
Loading_text.text =Math.floor ((loaded/total)*100) + "%";
If (total == loaded) { play ();
Play():
This.removeEventListener (Event.ENTER_FRAME, loading);
}
}
If you can find the problem, I'll be grateful. And do hurry, I have until tomorrow to post my animation video.
Copy link to clipboard
Copied
When you get error messages and want help solving them you should include the complete messages. Looking at your code I would say the problem might lie in your use of capital letters for terms like: import, this, var, function,
Copy link to clipboard
Copied
It helps.
Thanks so much!
Copy link to clipboard
Copied
You're welcome
Copy link to clipboard
Copied
Wait, sorry.
Now the line 'function loading (e:Event) is the only one having syntax error. Any ideas?
Copy link to clipboard
Copied
At least in the code you show, you're missing an opening { after the function declaration. And you can get rid of 'this' - you're "in" this, so you don't need to use it.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now