Global Scope
Not everything has a something some things just don't have an owner. these type of functions/variables live in the global scope.
Video Transcript
00:00Yeah, all right. Let's say let's take one step further. So I'm gonna delete all this fun stuff. We've just created
00:07Here we go now we've seen we've seen something that we've talked about a little bit
00:12We haven't talked about it too much. We've talked about the first of all, we've talked about the trace
00:17We've talked about a lot we worked with the trace as well
00:19And I wanted to ask before I continue actually to the next topic is to who does the trace belong to?
00:23So I'm gonna cycle between you guys again, and then we're gonna then we're gonna
00:27Answer that question then move on to the next topic
00:30So that's the last question. I guess. Yeah, unfortunately Carol. Sorry, but you should know that one
00:36I think it's a little bit hard now when you're thinking about it seems like all the hard questions I send towards you
00:42when you think about answering about this trace think where did we
00:46Create it and did we actually create it? We didn't create it
00:49So we it's definitely does it definitely does not belong to our function because we didn't create it in our class
00:55Devon doesn't belong to our main class because we didn't create it there either and we could use the trace anywhere that we want
01:00to and
01:01These type of various these type of functions that exist in flash are very very unique. They actually don't well
01:10Carol do you want to try to answer it or let me go for it. They're very unique type of function. They
01:23It's even more than that. They don't even belong to the root. It's
01:30That's the thing after we got used to saying that everything belongs to something
01:33There are some things that just don't belong to anything. They belong to say that's called the global scope
01:38the global scope means that everyone has access to them, but they don't belong to anyone and
01:43The way you know that oh the way you know that also a great way to know that is
01:48Trace the root itself right if it belonged to the root I could have said trace
01:53I could have traced out Troy. First of all, I could trace out trace if I want to I could trace out trace
01:57I'll see that it's a function
02:00Output oh
02:02I should probably say before I do that. All right, so I could see it's a function. That's good
02:06We know it's a function. Now if I thought it was the right I could have gone and said root dot trace
02:09Just see if it works. Well, it's throwing an arrow. It doesn't belong to it doesn't belong to the root root can't find it there
02:15Now trace just doesn't belong to anyone that that's really the plain answer
02:19Traces like a global function that's available to everything. It really belongs to this output panel you could say but that output panel is
02:25Not an application. It's not part of our code. It's just a global helper utility type of function that doesn't belong to anything
