02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

Runtime vs. Compiler Errors

There is a difference between runtime errors and compiler errors: this is vital to understand so we won't get confused or frustrated when unexpected things happen. Unexpected things will happen: part of the fun comes from figuring out why!

Compiler errors are errors that Flash catches while it's trying to compile your application, preventing it from finishing compilation. On the other hand, runtime errors are warnings that Flash triggers to you after the application is compiled (and it's already running) that it didn't catch before. It is also important to know that these two panels are not visible to the end user.

What are compiling errors?

Compiling errors happen when you build your application, and there are mistakes that Flash knows are mistakes. For example, you assign something the wrong value, you type something incorrectly, you missed a parameter, or you added too many things. Flash will know that you made an error or did something that you didn't mean to do: it will give you a warning.

All of the errors are related to your mistakes in syntax (typing errors, wrong arguments or the like.) They will be put into your compiling errors panel as soon as Flash tries to compile your application into an .SWF file. Any such error will prevent you from completing your compiling.

What is a runtime error?

Run-time errors, on the other hand, happen after your application is compiled and running. If Flash hits an unexpected something (could be anything) as your application is running it will warn/announce it to you. For example, if it couldn't find a file that you tried to load, it triggers a runtime error letting you know about it in the output panel (well true only for us as we are working in the Flash editor.) So, on the fly, flash will output into the output panel warnings and errors that it didn't catch during compilation. Additionally, you can send messages to the output panel as you're trying to run your application. It is also important to know that the output panel and compiling error panels are not visible to the end user, but programmers will be able to see your output panel if you don't omit the capability.

Compile Errors vs. Runtime Errors Video Transcript 

Video Transcript

00:00The next topic we want to talk about is our output and our compiler errors and see what
00:05the difference is between them and kind of just touch them briefly and then revisit them
00:09as we start coding.
00:12To do that again, currently I'm in CS5, I have to create first a new ActionScript 3.0 file,
00:17which is an FLA file format.
00:20Now that I have a file, we could actually see that I already have preset because I'm
00:24in my bin settings.
00:25We're in my bin settings, I put my output panel and I put my compiler errors up here.
00:31If you don't find it, you could always, again, go to your window, search for your output,
00:36you'll reach output, or you could search in your window, go to your compiling errors
00:41and see your compiling errors.
00:43What is output?
00:44What is compiling errors?
00:45And we're going to see this much more into depth, but we just want to get right now
00:48a very, very quick overview of what they are.
00:53Let's start with the compiling errors.
00:55Compiling errors happen basically when you build your applications and you've done a
00:58few things wrong in your code that are clear cut for Flash and knows you made a mistake,
01:04which could be that you assigned the wrong value, you've typed something incorrectly,
01:09you've missed the parameter, you've added too many things.
01:12Flash then will know that you've made a mistake or it would notice that you're
01:16doing something that you might not mean it and then it might want to give you a warning.
01:21Now without showing a live example right now, because I'm going to do that as we
01:24start touching the programming part of this course, all of the errors that are
01:30related to your mistakes into your syntax or your mistakes into things that
01:35are clear cut, Flash knows you made a mistake, they're going to be outputted here.
01:39As soon as Flash tries to build out your application, as soon as Flash tries
01:42to convert, like we were saying, convert your application into that mid tier
01:47language, that language that then Flash player knows how to run with.
01:53Any error that's clear cut will actually compile and come directly into your
01:58compiling errors and then prevent you from, you know, you won't be able to complete
02:02your compiling. Now what does the output do?
02:06Output on the other hand is, does not happen while your application is
02:10compiled, it happens after your application compiles. After your
02:14application compiles, if Flash finds some error or warning or message that
02:19it needs to tell you after the application is running, which it couldn't
02:22tell you in advance, such as it couldn't find a file they tried to load, which is
02:27a great example where there's a warning that Flash gives an error then it says
02:30it can't find it, or things that are, well, probably more detailed than what we
02:35get right now, but basically mistakes that we've made that Flash couldn't
02:40realize they didn't notice until it was too late, until after we compiled.
02:44So then on the fly, Flash will then generate errors when it notices that they
02:48happen and they would have, they would output enter our output panel and not
02:52enter our compiling errors. What else could happen in the output? In the
02:56output, and we're going to see that really shortly, we could actually send
03:00messages to the output as we're trying to run our application. Now it's
03:04important to note, obviously our compiling errors and our output are not
03:07visible to our end user, although programmers would be able to see our
03:12outputs if we don't omit them, if we don't get rid of them, but
03:18our basic users, if they're running it on their phone or they're running it on the
03:21browser or an error application, they would not see those messages that are
03:26running in our output. Okay, so we now, we got, we know the definition, the
03:33difference in compiling errors in the output, and we're actually going to see
03:36that in action really soon.

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!