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

Creating a Linkage

In this video we take a deeper look into how we create a linkage to be used in our code. A linkage is a library asset that is available for our code.

Video Transcript

00:00Right, so we got our timer we cleaned it up the next thing that I want to do is I actually want to go to our view
00:06And give us a few view options for example
00:08Let's say we want to create two different variations of our timer
00:11One is going to be in a certain font and a certain color and a certain layout and the other one will be a different
00:17Layout a completely different layout
00:20Okay, so let's see how can we make that happen first of all what I want to do is
00:24I'm just going to create a new movie clip as I create that new movie clip
00:28I'm just going to grab this timer
00:30and I'm going to just click on modify convert to symbol and
00:35I'm just going to give it some sort of name, so I'm going to call it um
00:39MC timer time out
00:43MC timeout, so we have an MC timeout now our app is not going to work anymore, right?
00:48What I want to do is I'm just going to delete it from the stage as I delete it from the stage
00:53I'm going to go to my library and as we worked on before oh
00:56When we have your little error because we created a button instead of creating a movie clips
01:00I'm just going to right click on that go into my properties and in my properties
01:05I'm going to make sure that I'm going to turn it into a movie clip, so it's a movie clip
01:09Now the next step if we're already in our properties is that we want to export it for action script
01:15So I'm going to click on export for action script and now I have my MC timeout
01:19Which is a movie clip which is available for action script as we've done previously
01:25We just created a movie clip and I want to also as we said in the previous video properties again
01:32I'm just going to call it
01:34LMC timeout when I'm working from the library because I want to make sure that when I'm looking at this
01:39I know that this is a library linkage, and it's not a real class or not a real property
01:44And that's why I like calling it LMC. It's kind of like a fake class or an automatic class and in my app
01:50I could go back again, and now I'm going to have to delete
01:53I'm going to have to delete my text field because it's not valid anymore. There's no text field there anymore, and I could create a private
02:01variable and I could call it
02:03MC timeout and
02:05The type of that MC timeout is LMC timeout because that's the name we gave it in the library
02:11And all we really have to do next is create a new take a take our timeout
02:17MC timeout and tell that it equals to a new LMC timeout, and then we could add child
02:25And add our MC timeout onto the display now
02:32Everything should work besides one thing our problem is that we don't have the text anymore
02:36So we don't have to go inside of areas where we're calling our text directly and just call our MC
02:42time out
02:44ttime
02:46MC time out and again
02:49I had a lower case here which is an error if we run our application
02:52Hopefully we won't get any errors and our application will work now
02:56It's not aligned correctly because we're we're not we didn't play with the alignment
02:59But if we wanted to we could have set it to the center or just so we could do something quickly
03:03We could go to our MC timeout
03:09Y and just say that it's going to be a 25 just so it's a little bit lower
03:14Maybe even more, right?

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!