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

What is scope? What are objects and what are not?

Probably the most important concept you need to master when working in a programing language and mainly when working in a OOP programing language is to understand what is scope. This video is another layer in our understanding of the meaning of scope.

Video Transcript

00:00Okay, great. So that answered that question. I'm going to ask you a few questions before I'll let you ask your own questions, okay?
00:06So now you know the difference between commands and things, and really things in Flash are only variables, objects, and functions.
00:18And I'll tell you a secret, and even though I think we've covered that in the functions a bit, functions are a type of variable.
00:24It's a type of variable that's just not really declared the same way.
00:27And technically, you could go to a function and say, you could say var me too, let's say, equals me.
00:36And now I didn't have to define it, but I could even go inside and define it and say you are a type of function.
00:40And I always uppercase, I'm going to uppercase function, and I just declared that me too equals me.
00:48And I could use me too, just as if I would use any other function.
00:52So a function is a variable, even though it's defined differently than a variable, because it's a variable that does actions.
00:58And we didn't really cover that, because we didn't really want to confuse things.
01:01We said there's three different types of things. We said there are variables, there are functions, there are objects.
01:06In the background is just a hint that functions are also a type, it's a type of thing.
01:11It's just as much a type of thing as a variable is, it's only a little bit more smarter.
01:15It's a variable that does stuff, it doesn't only store things.
01:19So now when we went into the for loops and the if statements, and we'll see a few more of those type of things.
01:26Whenever we also switch statements, there's quite a lot of commands, operators that, like you said, they control the flow of the application,
01:33but they don't store actual information in them.
01:36All right, so we know what a for loop is.
01:40Now, I wanted to ask, do you know what is an endless loop?
01:45Right, exactly.
02:06Perfect, and that's a perfect answer.
02:11Exactly, and then Flash will just crash at some point, or will tell you, I tried doing this for over 15 seconds,
02:17or whatever amount of time, and I'm terminating the application.
02:21And obviously, you don't want to be in that scenario, and that's the tricky place where you want to make sure with loops that you're always 100% sure,
02:27especially when you move on to the next course, which is loops part two, which is much harder.
02:32And the exam is a lot harder as well.
02:35Even though we've covered the basics, then we're going and looking into more sophisticated types of loops that are much harder to wrap around.
02:44All right, so that really covers really what I thought was really, really fundamental to make sure that we talked about, so we know what loops are.
02:51And like you said, it really is just a convenient way for us to say something a couple of times.
02:57By the way, hi, Peter. And, Peter, if you have any question at any point, just write it up on the chat, and then I'll restate it, because we're doing...
03:07Yeah, we'll just do it that way, okay, Peter?
03:11All right, so what I wanted to ask next, and also, Peter, please join in if you know the answer.
03:16And also, Peter, now that I know that you're here, if you could answer, did you already watch the videos about loops?

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!