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

Albert

We ask for help from Albert to look into the basics of time (waiting for things in flash).

Video Transcript

00:00Now obviously the next step that we probably want to do is actually know how long will it take for application to load now in
00:06This scenario because we're working locally
00:08It's not going to take any time right, but let's see how we do this first of all
00:12What if we called for a function that doesn't exist so we call a image
00:17It doesn't exist and we try to load it in you'll see that we're getting an error
00:20But this error is not getting caught so it's throwing us an error now because I'm running in flash debugger
00:26These errors are going to be quite annoying to users that have flash debugger. They're going to get all these errors
00:31The basics we first we just created a new loader
00:34We said we added a new request a new load
00:37Function and then we send a new URL request which was what we wanted to load that easy
00:42And then we just add it to the stage because it's a visual element
00:46Running it really quickly again. You'll see that our image loaded just as we expected it
00:51But what if we wanted to add some sort of effect whenever the image is loaded?
00:56If we just run it this way, and I'm just going to type again, and I'm going to go into my control
01:05Bend with profiler view bandwidth profiler now
01:09Because I'm running it dynamically and my image is actually local. I can't really even see
01:15The pre-loading so what I could do just because I'm running in flash
01:18And we're not worried about security issues because when we're running in flash
01:22Then we don't have security issues when they're in the editor
01:26We'll have all these security issues when we run in the browsers, but for now
01:29We're not going to worry about that so what I want to do
01:32I'm just going to go I'm just going to grab a random image from let's say Wikipedia
01:37So let's just grab a random image from Wikipedia. Let me just file a new tab
01:44Alright, let's just time for
01:47Albert fine
01:50Here we go in Wikipedia. I'm sure there's an image of Albert here
01:56Here we go
01:58Alright, so we have your an image of Albert
02:02So I'm just going to copy that image and close this window go back into flash
02:07We're just going to paste that URL of Albert
02:11Now if we run our application one more time
02:13We're going to see that now it's taking it some time until our image actually loads
02:17Doesn't look fantastic right now right and we didn't scale it to the stage
02:21We couldn't really scale it to the stage even right now right because we don't know how big it is
02:25We only know how big it is after it's actually loaded

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!