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

Code setup

In this video we are moving some things around, customizing our vision of our final product.

Video Transcript

00:00So the first thing that I want to do is I actually want to go and start changing a few
00:03things around.
00:04And I already know that I wanted to create some sort of silhouette.
00:08And to do that, I'm going to take advantage of the fact that I've already created earlier
00:12we created the MC timeout.
00:14So I'm just going to grab that MC timeout and what I want to do is I want to go inside
00:18of it and just change the way it looks like.
00:21Now because I'm viewing it, I double clicked on it, I'm viewing it without seeing my stage
00:25and I really want to see that stage.
00:26So it'll make it easier for me to see how will my item look like in the end of the day.
00:33So to do that, I click back onto my scene and what I want to do is I'm just going to
00:36drag my element directly onto the stage.
00:39So I'm just going to grab my MC timeout and I'm just going to place it on the stage
00:43just as it was in one of the earlier videos.
00:47Now the next thing I want to do is I want to go to my app itself and just delete everything
00:50that's not relevant anymore.
00:52Now that I have an item that's directly on the stage, I don't want to create two
00:56items on top of it.
00:57So if I run it right now, I don't want to create two items on top, right?
01:00I just want to get rid of them.
01:02Now I want to take advantage of the fact that I already have one MC timeout.
01:06So instead of deleting it, I'm just going to go to my new instance and I'm just going
01:10to call it MC timeout, paste that name right there, save my FLA, go back to my AS file
01:19and this time around I'm just going to delete everything that's not relevant.
01:21So public.
01:22So I'm just making sure that I'm keeping that variable and it has to be public for flash
01:27to recognize it.
01:28I want to delete anything related to MC2 and that would be about MC2 as well.
01:34Let me just click on F4 so we could see everything here and all the rest seems about right for
01:39now.
01:40So if I run an application one more time, I should be getting that one instance that
01:44I have on the stage.
01:45Oh, and I have an error.
01:47So let's fix that.
01:48First of all, I'm creating a new one on top, which is exactly not what I want to do.
01:52And this is a fantastic way to explain something.
01:56Right now we have the instance on the stage and it is called MC timeout.
02:02Only on line 9 we're deleting supposedly that item, right, because we're creating
02:06a new one on top of it.
02:07We're not really deleting it.
02:09As we said that primitive values, if we would do that with a primitive value, we would
02:13basically be replacing the data itself, but what we're really doing here is we're
02:17creating a new element and storing a reference to that element inside of MC timeout.
02:23Now I don't have a direct reference to my element, but it's still on the stage, so
02:27it wasn't deleted, even if we have no way, no logical way to access it anymore.
02:32Alright, so what I want to do is I'm just going to delete this line line 9 and delete
02:36line 10 because I'm not adding anything new onto the stage.
02:39I'm just trying to talk to whatever is already there.
02:41And if I run my app just one more time, I could see that my timer is now working
02:46again.
02:47Fantastic.
02:48And that's all I really needed.

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!