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

contentLoaderInfo

Ok, we know we have an issue, our loaderInfo isn't doing what we hoped it would do, and more then that it's actually returning a null value. We figure out together what's going on...

Video Transcript

00:00What, what was the re-, why doesn't the loader info exist?
00:04The reason it doesn't exist is because the item wasn't loaded yet.
00:07But at the same time, we already learned that our loader object itself
00:11does not contain the information of our thing that is going to be loaded.
00:15So we need another method, we need some sort of property that would exist inside of the loader.
00:19Now I already, now that I made the mistake, I remember that the actually item is the context,
00:24the context loaded info, content loader info.
00:29Now, why is that? I mean, it's quite a big mistake, but a very common one that I make,
00:34everyone makes, you do a few traces, you figure it out.
00:37Now, before I actually explain the difference between the two,
00:40it'd be really, really great to see how you guys just come up with randomly,
00:44figure out, okay, so there's a loader info, but there's a content loader info as well.
00:49What do you guys think is the difference between the two?
00:52And why would, and if you know what the difference is,
00:55then why does the loader info return null?
00:57Exactly, and what is the loader info for?
01:12The loader info is for our loader itself, but the loader info for our loader is empty
01:19because our loader wasn't loaded, we created it internally in Flash,
01:22we just created it right here, nothing else loaded it, bingo.
01:28So really, really, really great, Danny.
01:31So basically the difference between our loader info and our content loader info
01:36is our content loader info is returning the content information.
01:40While our loader info is returning the information of that movie clip,
01:44of that loader that was created, okay?
01:47As we said, every single movie clip, every single visual element inside of Flash
01:50has a loader info, thus that loader info kind of tricked me,
01:54but it would trick you as well, probably, if we didn't go through this,
01:58saying, okay, no, but we don't want that loader, that loader is not relevant,
02:01we actually want the information of its child.
02:04So let's go back and fix that issue,
02:06and all we have to do is just change from trying to talk to our loader info
02:10to talk directly to our content loader info and add that event to it.
02:14So if we run it one more time, we're going to see that, first of all,
02:17we're getting that loader info, we're getting that event.
02:21Whoop, or not.
02:23Oh, it didn't actually load it because it's taking it a little bit of time,
02:25it's a big file.
02:26So instead of loading it, let's just wait there for just a second
02:29and see if our application loads at some point.
02:31And there we go, at some point our application finishes loading, fantastic.
02:35Okay.

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!