02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous Video
Chapter is concluded.Next is

How to create a menu in Flash and ActionScript 3.0

One of our students in our live event from 03/27/11 asked us to create a menu in flash. I thought why not do it together live and so we did. The video is not edited at all as i really want to keep this othentic fun relaxed non-hyped enviorment. In this video you will learn a bit about movieclips, text, events, and getting urls to open up(getURL for the oldies or navigateToUrl in AS3).

Video Transcript

00:00I can hear. And our recording is starting. So we're in the middle of a live event and
00:05if you haven't been with us in a live event, then we will, I definitely welcome you to
00:10come and check us out because it's a really fun experience. All right, so right now we're
00:16working on a, you know, where I was stumbled or alive kind of thing, we're going to try
00:21to figure out how to build a menu out together. And we're going to start off from a really
00:25simple menu. And to do that, I just have a little bit of artwork already set up here.
00:29So I could also brainwash you while I'm talking about this new topic. And I'm going to
00:36put a menu, I'm just going to put here something random, such as four buttons
00:40underneath this main logo that are going to be our main menu. And then we're going
00:45to take a step further and a step further based on our time and see how far we
00:49could take it in this realm. So first of all, I'm just going to create, I'm going
00:52to take a text field and I want to make it a dynamic text field. And I'm
00:57just going to put here how much copy I think this menu is going to have. So I'm
01:01going to call you and say menu copy. Well, menu one, because I know that I know
01:06basically the length, this is going to be one, actually want the color to be blue.
01:13And I want to make sure that it's a dynamic text field. And we're going to
01:17see in a second why. So it's a dynamic text field. It's a classic dynamic text
01:21fields, which will enable me to control it, control it and change it via code.
01:30Which is good. I'm just going to call it label. LBL in short. And now that I have
01:36my label, I'm going to just grab that and put it into a movie clip. So I'm going
01:43to do that by controlling it by converting it into a symbol. And I'm going
01:47to turn it into a movie clip. And I'm just going to call this menu button,
01:51menu button. And I'm actually going to keep it as a movie clip. It's going
01:57to be a menu button, but it's going to be a movie clip. I am not going to
02:01export it to action script right now. And really the steps that what I'm
02:04doing here, first of all, I'm wrapping it into a movie clip because I don't
02:07want it only to be text. I'm going to add a little bit more fancy things
02:11into it. And before we continue, there's a question coming from the chat
02:16room. So I'm just going to read that question out. And Adam Scott is
02:19asking, could you make it a movie clip before you name it? Did it matter?
02:25Well, it completely didn't matter when I'm when I'm when we're talking
02:29about it, you're talking about the text field. The text field is like we're
02:32talking about in earlier videos, a text field is just a complex data type.
02:36It's another complex visual object. All I'm really only thing that's
02:39important is that I first created my text field and selected it. And then
02:43I'm going to go into my modify convert to symbol, convert to symbol
02:46doesn't convert that text field into a symbol, it puts it inside of a
02:49symbol. And in our case, it's going to put it inside of a movie clip.
02:54And now when we have our convert the symbol, I couldn't name it right
02:56ahead and just call it okay. Or I could go to my library, just click
03:00onto my library, find my symbol. And I could right click onto the
03:04properties and change the name of that symbol. But the name doesn't
03:07really matter. It's the library name. It's not really the name that
03:10we're going to be using in the code itself. Okay, so I'm just
03:13going to call this our menu button. This menu button name is not
03:18an actionable name. It's really just a way for us to differentiate
03:21it inside of our library more than anything else. And it makes
03:24sure that we have our movie clip. So we have a movie clip, it has
03:28a text field, which is called has a label, we called it label
03:31when we double clicked into it. This is our text. And I just
03:36want to add one more layer here, which is going to be serving us
03:39for two things. It's going to serve us also as our hotspot,
03:43which hotspot basically means this is the area that's going
03:45to be clickable. And two, it's also going to be our hover
03:48state. So when we roll over our item, it's going to change
03:51the color and hopefully help our users know that they should
03:56be clicking on it. So I'm just going to call this hover state,
03:59I'm just gonna call it our BG, because it's also our
04:02background. And I'm just going to create a quick, very, very
04:06simple, say we're going to make it gray. And I'm just going
04:11to create a rectangle, I don't want it to have any stroke just
04:15to fill. So I'm just gonna make that gray or let's find a
04:21color that's not as making maybe like a really, really
04:28light gray wheel. So just a little bit of gray. So it just
04:50shows that something happened. Okay, so the next thing I want
04:53to do because I want to control this by code and to be able to
04:56control it by code. Again, I have to put this into a movie
04:58clip. Anything you really want to put into code has to be a
05:02text field, or a movie clip, or a button. But most of the
05:07times you're going to be working with movie clips until
05:09you start working with the with the with coding and
05:13until you start working with sprites. So I'm going to call
05:16this background menu button, BG. And we have a question coming
05:22in. My screen is jumping is my Oh, that was my mouse is my
05:26screen still jumping? Sorry, Carol. Is everything okay?
05:30Could you guys see my screen? No, no, no. No, no. Not now.
05:39It's not jumping now. Yeah, because yeah, basically, when
05:45I'm converting a symbol, it's happening outside of the
05:47screen. So it's, I think it's because you're zoomed in. So
05:50then it goes a little bit wacky, but it hopefully that
05:55won't be too crazy. All right, so we created our element, we
06:01have our we just want to wrap up and make sure that we
06:04get where it's still on the same page, we have our text
06:06field, which was named label, we have our movie clip, which
06:09is named, we're going to name it BG, but it's a menu
06:13button, BG, okay, which is a movie clip type. And all the
06:18all these two, two, two elements are inside of that
06:21bigger element, which is our movie clip, right, our movie
06:25clip that was called menu button, which then contains
06:28those two text field and movie clip. So I'm going to
06:32call this menu one. Alright, so so far, so good. Now the
06:37next thing I know that I'm going to have four, so it
06:39makes it really easy, right? Because now all I have to
06:42do is just like, create maybe a little small separator.
06:45And really, you know, there's not a lot little separator,
07:00we could just duplicate this a couple of times. Two, three,
07:06four, get rid of all the rest. Now, obviously, this
07:10isn't the best way to create a menu, you'd want to
07:12externalize as much as you can. But this is a great way
07:15to start. And we'll give you guys a little bit of
07:18homework when we're done. Now, by the way, also, if
07:20you want to center everything, one thing you could do
07:21is just group all the stuff that's selected by
07:24clicking on command G, which I just did before I'll
07:27undo that command G will then group everything up.
07:29And after I grouped everything up, I could go into
07:32my window, align, and my align or I could go from
07:36the side here because I had that already saved. And
07:39I could set it to align to stage and say I want it
07:41to be in the center of the stage, making sure that
07:43it's in the exact center could have done the same
07:45thing with these two. But I didn't because they're
07:49in two different layers, so it makes it a little
07:51bit harder. So I'm just going to manually just move
07:54them a bit until it feels right. It feels about
07:59right to me. Okay, look, there we go. All right, so
08:03we have your we have four menu buttons. Now, our
08:07primitive menu buttons, really, what we want to
08:09do next is basically want to approach each menu
08:11button and just give it a unique name. So do
08:14that. I want I want to work all in classes
08:16because we've been working with classes so far.
08:18So I'm going to save this. And I'm going to go
08:20into my properties. And because I'm working in
08:22CS5, I could automatically I'm just going to
08:25create your my main and click on Edit. It's going
08:28to automatically create one for me. Well, here
08:34we go. So it's created it created me a new
08:37main, which is a movie clip, all this stuff that
08:38I usually need to work with. And I'm going to
08:41click on File Save and just save it down to
08:43the right spot, which is inside of our folder
08:46where our menu is, just going to save that. And
08:50we have our empty constructor and we're
08:51ready to go. Now, really, the next thing that
08:53we have left to do is just define those things
08:55that we want to be clickable. And we know that
08:57we called the first one and menu one. And now
09:00because we automatically could break apart that
09:02group by clicking on Command B because we don't
09:04need to group anymore. And if I go to it, we
09:07have menu one, and we could go into our menu
09:10two, change the third one to be menu three, and
09:17the fourth one to be menu four.
09:21And we got our menu options all sorted out and
09:24ready. Really, the next step is actually is the
09:27easy part. We want to just define them. Now,
09:30because it's movie clips already on the stage,
09:31I'm always going to start it with the word
09:33public and then var and then the name of the
09:36movie clips. I had their menu one, which was a
09:38type of movie clip. And I'm going to duplicate
09:41the same thing over and over four times. Now,
09:44don't worry about the public, private and all
09:45these stuff, because we talk about that in the
09:47more advanced videos. Just make sure that you
09:49do it. All we're really saying, all we're
09:51really doing here is we're just basically
09:54confirming that those variables were created.
09:56We don't have to name them, but by doing that,
09:58we're going to get all the hints that we get
10:00from movie clips. And without it, we wouldn't
10:01get it as we start typing in our constructor
10:04menu one dot, it will automatically give us
10:06those hints that are really useful. And
10:08that's why we're adding these lines. We
10:10don't want to put private or anything like that
10:12because those variables are public, because they
10:14were created on the stage. Anything that was
10:16created on the stage is automatically public.
10:19And if you don't know what public private is,
10:21don't worry about it at all. All right, so I'm
10:24going to save that. Now, the next step for me
10:27is really, I want to make sure that every
10:29movie clip will have a rollover. And every
10:31movie clip will also have a specific color or
10:34a specific copy in it, because right now
10:36they just have some generic copy. To do that,
10:38I'm going to create a new function. And that
10:40new function, I'm just going to call it
10:41public function. And again, ignore the public
10:44if you don't know what that means. Or
10:46actually, I'm going to create a private one
10:47again. And again, sorry for saying it so
10:50many times. Don't know what private is.
10:52Just ignore it. You could not even use it.
10:54But private, basically for our scenario,
10:56just says this is not going to be
10:57available to the world. It's only available
10:59to this class. So a private function,
11:02we're going to call setup menu button.
11:06It's going to take in one thing. It's
11:08going to take in a menu item, which is
11:10going to be a movie clip. It's not going
11:15to return anything. All right, so what are
11:22the stuff that our button is going to be
11:24doing? All right, so first thing first
11:30things first is we want to take in the
11:31movie clip. And also second thing is we
11:33want to take in a name. So the second
11:35thing would be a ST, which would be S
11:38name, it's gonna be a string. Now let's
11:40start from that. So we have our menu
11:41item. And we know that we have inside of
11:44a text field called LBL. And text fields
11:48have a property called text, which we
11:50could then assign to it that value. So
11:52S name would get that value. And if we
11:55just run our application just for one
11:57second to test it out, we'll be able to
11:59see that if we set up our menu button
12:01and we send to it menu one, and we give
12:04it the value of menu one, we're going
12:09to do that to all four, and then we're
12:10going to run it, menu one, we just copy
12:13this, do this four times four. And this
12:22is a great place to see how we're
12:23working in with functions and how we're
12:25working with a lot of things that we
12:27haven't really covered yet in the
12:29developer basics, if you're still in the
12:31early on in the development basics. But
12:32really for this scenario, it's really
12:34about just taking it and and if you
12:36know it, then great. And if you don't
12:38know it, then just a great way of
12:39practicing it until you get to those
12:40videos. But if you have watched all the
12:43videos on the site so far, all these
12:45stuff were covered already. We talked
12:46about everything so far. Okay, so if I
12:50run my application just one more time,
12:52we're going to see that our menu copy
12:54one, one we're having here some sort of
12:56issue. So let's our issue is that we
12:58didn't change the copy here. So I need
13:00one, two, three, four. And we see that
13:04it's working, but we're missing the
13:06copy. The reason why we're missing the
13:07copy is we're it's slipping away from
13:09us. Let's make sure that we go to our
13:11text field. And by the way, by editing
13:13one text field, we're editing all four
13:15because it's the same library
13:17instance. Okay. So if I go and make
13:21sure I'm selecting my text field, I
13:24just want to make sure that in my
13:25properties of my text field, I want to
13:29make sure that it's not multi line,
13:30it's a single line, because multi
13:32line would then make my copy
13:33disappear and go underneath. So let
13:35me just save that and check if
13:36that solved my issue. So we're
13:39getting we're getting warmer. And
13:44let's see what else. Let's see if
13:45we make our button just a little bit
13:47bigger. Just to see if maybe it's
13:52just getting cut anyways. No, it's
13:54not getting cut. So what could be
13:56our issue? Well, our issue seems to
14:00be related to embedding. So what
14:02we're going to have to do is we're
14:03going to have to go to our text
14:04field, and we're going to have to
14:05kind of make sure that or we're
14:07not using a font that needs to be
14:08embedded. Right now, whole vetica
14:10is one of those fonts that need
14:11to be embedded. So if I instead
14:13pick, you know, device font,
14:15which is one of the top ones,
14:17it's a sans serif or typewriter,
14:19if I pick sans, for example, and
14:22I run it one more time, then I
14:23wouldn't get that issue. Now, if
14:25you wanted to work with
14:26little vetica, and let's say I
14:26do, what we'd have to do is we'd
14:28have to select that menu, my text
14:30field, go into embedding. And in
14:33my embed rules, I'm going to say
14:34this is the type of copy I want
14:36to know a real menu would
14:37probably have, you know,
14:38uppercase or uppercase and
14:40lowercase and numbers. In my
14:41case, because I know that it's
14:43just a sample, I'm just going
14:44to embed inside menu space 1234
14:47because these are the only
14:48characters that I'm actually
14:49using, I'm going to click
14:50okay, and save it. And if I
14:53run it now, I'm going to be
14:54able to still use a vetica and
14:55get those fonts crisp and in
14:57the font that I actually want
14:59them to be in. Great. So, so far
15:02so good. We got our menu in
15:03the next episode, we want to
15:04set up some rollovers to make
15:06up those rollovers one, we
15:07want to make sure that we can't
15:08select this copy. To do that
15:10again, we could just select
15:11the copy any one of them
15:12because it's one movie clip
15:13that's controlled, controlling
15:15all four, it's the same
15:16library instance, I could go
15:18into that text field and just
15:20deselect the text so it can't
15:21be selected. So if I save this
15:23one more time, run it one
15:25more time. We'll see that now
15:26that it's not being selected,
15:27that's exactly where I want
15:29it to be. The next step after
15:31all this is actually adding
15:32events. And the event the
15:34first event, we want to add
15:35three events are rolled over a
15:37roll out and a click. So
15:39let's do that. So first of
15:41all, I'm going to create
15:41three functions, I'm going to
15:42create those functions and
15:43those are going to be my event
15:45functions. One is going to
15:46be private function on click.
15:49It's going to be an event
15:50that accepts a mouse event.
15:56And I'm just going to copy
15:57this because my on click is
16:00going to be the same. I'm
16:01going to use the same event
16:02both around click on roll on
16:04out. So it's going to be on
16:06roll on out. We save that.
16:14And by the way, let's take a
16:15quick break and ask you guys
16:16if you have any questions,
16:17feel free to jump in and ask
16:19a question as I'm going
16:20through this. And I'm going
16:22to continue in the meantime.
16:23And if I see something that's
16:24critical, so I'll just freeze
16:25and talk about that. All
16:27right, so the next step is
16:28now that we created our new
16:30functions is actually adding
16:31those events. So I'm going to
16:33go to that menu item dot add
16:36event listener. And I'm going
16:38to add an event listener to
16:40this. So the event listener
16:42that we want to listen to is
16:43mouse event dot click, which
16:45is going to call the on
16:46click, which will basically
16:47make our menu item whenever
16:48it's click to call that
16:50event listener. And we want
16:51to do the same thing for and
16:53we could just probably copy
16:54this want to do something for
16:55rollover and roll out. So
16:57instead of click, we want to
16:58call roll over. And then
17:05we're going to call the on
17:06roll. And we want to call
17:10our mouse event, roll out
17:13and call the on out when
17:15that happens. Right. So
17:18let's see, we have your
17:19question that is popping over
17:20here. So Carol is asking
17:24external is the best
17:25practice question mark. Oh,
17:27what are you saying? When
17:30you're saying external,
17:32what are we talking about
17:33external? What specifically?
17:38Oh, you know, yeah, when
17:40we're working, we like
17:41working with classes, the
17:42more you work with classes,
17:43the easier it is to then
17:45grow your application. When
17:48sometimes we do our samples,
17:49we do all these samples
17:50directly inside of flash on
17:52the timeline. But that's
17:53just because we want to
17:54create short, small, easy
17:55digestible samples. But as
17:59applications grow, and as
18:00they become more
18:01sophisticated, it becomes
18:03easier having your files
18:04external, because as your
18:05application grows, it makes
18:06it easier to break it down
18:07into smaller classes, into
18:09smaller sections. And
18:11you'll see that after we
18:12finish the developer
18:13basics, and you start
18:14working with the more
18:15advanced topics in the
18:17action script essentials, or
18:19whatever we called it,
18:21indispensable actions,
18:22group three, you'll see
18:23that we're starting to
18:24break apart from one class
18:25to two classes, three
18:26classes, and what time
18:27we're going to be
18:28working with more and more
18:28classes. Because the more
18:30classes we have, the
18:32easier it is for us to put
18:34our content into buckets
18:35and make it easier for us to
18:36then control our code. I
18:40see that Adam also had a
18:41question. So Adam is
18:42asking, did it matter how
18:44many fonts or characters
18:46you embed? Would it slow
18:47down the build if you did?
18:49Well, that's two, it's
18:50kind of two things. It
18:51wouldn't slow the
18:51application running, but
18:53it would make the files
18:54bigger. The bigger the
18:55files are, the longer the
18:56load time. So obviously,
18:58you want to keep down file
18:59sizes as much as you can
19:01in my scenario, where the
19:02visuals don't really
19:03matter as much, but it's
19:05really about getting the
19:06education out there. So
19:07for me, most of the time,
19:08I don't embed it on the
19:09site because it's really
19:11smaller. It's cheaper for
19:12me than it's just like 4k
19:13or really small files.
19:15Contrary, if I throw in a
19:16font, then it's 40k and
19:18that stacks up. And that
19:24covers that. So it
19:25doesn't slow down your
19:26application. It just
19:27makes it bigger. It makes
19:28your compiling time
19:29probably a little bit
19:30longer. But when you're
19:31running your application,
19:31if it's embedded or not,
19:32it doesn't really matter.
19:34Embedded though enables
19:36you to create animations
19:38and it enables you to do
19:39more complex things that
19:40really Flash was born to
19:42do. So yeah, whenever you
19:43have when the visuals are
19:45important, most of the time
19:46that's why you're inside
19:46of Flash. Most of the
19:48time you're going to
19:49embed fonts, but really
19:50for educational purposes,
19:51for us, it's not as
19:52critical to embed most of
19:54the time. So for me,
19:56like for example, if I
19:57know that I only have a
19:57specific amount of fonts,
19:59if I know it's only
19:59uppercase fonts, then I'll
20:01only embed upper. I
20:02wouldn't embed upper and
20:03lower because then I'm
20:03just adding file size for
20:05no reason. Cool,
20:10excellent. I'm happy that
20:11answered that question.
20:12And Carol is asking
20:13listener is also a big
20:15thing. Can you briefly
20:16explain or we will learn
20:18it on your videos? Well,
20:19yeah, we're going to
20:20learn it in the videos,
20:21but definitely we could
20:21talk about the listener
20:22just for a second.
20:24Definitely, I can't break
20:25it down into the real,
20:26you know, the guts of
20:27it, because there's
20:27actually a few good hours
20:29of video about it. It's
20:30one of those topics that
20:31are really, really
20:32critical for the Action
20:33Script 3 world, but really
20:36what a listener is, is in
20:40the most simplistic way
20:41of saying it is an
20:43object, a complex object,
20:45such as a movie clip or
20:47a button has different
20:48things that happen to it.
20:50And what we really want
20:51to do, and if we're
20:51looking at lines 23 through
20:5326, what we are really
20:56doing was we're basically
20:57approaching that item,
20:59that specific item and
21:00saying, whenever someone
21:01clicks on you, then call
21:03this function. Whenever
21:04someone rolls those
21:05over you, call this
21:07on rolled over. Whenever
21:08someone rolls out of
21:08you, then call this
21:09function. Now, there's a
21:12lot of videos on it, and
21:13it's a quite complex
21:14topic, but the basic
21:15idea of, I have
21:17something, and I want to
21:19listen to things that
21:20happen to it, is really
21:22and why is it a listener
21:23and why don't we just
21:24write it directly inside
21:25of the menu, is one is
21:27because we might have
21:28more than one listener,
21:29might be a few things
21:30that are listening to the
21:31click, and we don't have
21:33access to the menu item
21:34class, we never created
21:35one. So it enables us
21:36from outside of an
21:37object to say, hey, I
21:39know you click on things,
21:41could you let me know
21:42when you get clicked on
21:43next time? And the way
21:44you let me know is by
21:45calling a function. And
21:46I'm telling you, okay,
21:47this is the function I
21:48want you to call. And
21:49when it's called, it
21:50sends all this extra
21:51information that we're
21:52not going to get into
21:52right now. But as you
21:55start working with, you
21:56know, events, and as
21:57Adam is saying, thank
21:58you, working with events
21:59part one and two, then
22:01really, it delves really,
22:02really deep into into
22:04that. Alright, so we
22:06have our, we have our
22:08events being listened to,
22:09but nothing's really
22:10happening right now. So if
22:12I just add here just a
22:13small trace just to see
22:16in, I am out. Okay, so
22:20I'm just just tracing the
22:21on out. And if we run
22:23our applications, when I
22:23roll over something,
22:25nothing happens. When I
22:26roll out of it, it's
22:27going to output and say
22:28on out, which is perfect.
22:30That's basically what I
22:30want to happen. So what I
22:32want is actually I want
22:33to go into my menu button
22:34item, make sure that my
22:35background is called BG,
22:37which I quite believe that
22:38I did call it that. And
22:42I can see that I did
22:43call it BG. So now that
22:44I know that inside of my
22:45menu item, whatever it
22:47is, I have a BG. Now
22:50I'm going to do
22:50something that you know,
22:51like Carol and I know
22:52this is stuff that you
22:53guys didn't really do
22:54yet. But our event
22:57dispatcher basically,
22:58lets us know also what
22:59was clicked on. I don't
23:00really want a hard code
23:01of value in here because
23:02if I hard code of value
23:03inside of my event, I'm
23:05going to have to create a
23:06separate event for every
23:07single menu item. But in
23:09this scenario, I'm
23:09actually creating the
23:11same event that is going
23:13to be used on four
23:14different items. I have
23:14to make sure that my
23:16roll over roll out are
23:18anonymous. They're not
23:19talking directly to a
23:20specific menu item. They
23:22have to be smart
23:23enough. To do that, I'm
23:24going to leverage some
23:25information that we
23:26didn't talk about yet. In
23:27the earlier videos, by
23:29approaching this event
23:30mouse, that information
23:32is coming back in one of
23:33the properties of that
23:34complex object is
23:35saying that's called
23:36target. And the target
23:37rule returned to me the
23:38thing that created that
23:40event in the most
23:40simplistic way of saying
23:42that. And now that I
23:43have my target, and I
23:45know that I'm in my
23:46target, I could tell my
23:46target.bg equals dot
23:50visible equals false. Or
23:54actually, when you roll
23:55over, we want it to be
23:56true. And when we roll
23:58out, we want it to be
23:59false. Now this might
24:01not work 100%. And we're
24:03going to see why not in a
24:04second. But before we see
24:06why not, let's make sure
24:07also that when we first
24:09instantiate our
24:10application, when we
24:11first create it, we want
24:12to make sure that our MC
24:13item bg starts off by
24:16being invisible. Now if
24:18I run my application one
24:19more time, roll over my
24:21main menu one, my roll
24:22over state appears, and
24:25so do all the rest. Now,
24:27the reason why I was
24:28thinking it might not
24:29might will might not work
24:31was really just because
24:32that there are a few
24:33elements in the stage in
24:34the same time. So I want
24:36to do a few a couple of
24:37things to sort that out.
24:38First of all, when we
24:39rolled over, we really
24:40want to have a hand
24:40there, letting us know
24:41that this button is
24:42clickable. To do that,
24:44I'm going to actually go
24:45to my menu item. And
24:46I'm going to add a few
24:47properties, menu item
24:49dot first of all, I'm
24:50going to say, I'm going
24:52to, I'm going to say
24:52button mode equals true.
24:55And basically that would
24:56tell Flash that I'm going
24:56to treat this element as
24:58a button. Now that
24:59doesn't really trigger
25:01my hand cursor. So I'm
25:02going to have to be more
25:03explicit. I'm going to
25:04be more explicit. I'm
25:05going to go to my menu
25:06item dot show use hand
25:16cursor equals true. And
25:21last but not least,
25:22I'm going to tell my
25:23movie clip that its
25:24children are not going
25:25to be selectable, only
25:26the movie clip itself. So
25:28menu item dot we just
25:35find that property. I
25:36don't remember it by
25:37heart, which is happens
25:39quite a lot of times.
25:43Where are you? Mouse
25:46children equals false.
25:50What that will do is make
25:51sure that my movie
25:51clip itself as a whole
25:52will be a clickable
25:54area, but not my
25:55children. Now, hopefully
25:56after doing all of that,
25:57our movie clip will now
25:58have a hand. All right.
26:00So first of all, we'll
26:01what we did is we set
26:02our movie clip to be a
26:03button mode to be true.
26:04We said we want to use
26:06our hand cursor. And we
26:07said that our children
26:08that was our text field
26:09and our background can't
26:11capture that motion. And
26:13instead of that, they
26:14become as one, they
26:15become only only our main
26:17movie clip will then be
26:18able to capture those
26:19movements. Now, by the
26:20way, what would happen if
26:21I would now comment
26:22outline 26, then my
26:25hand cursor would not
26:26show up. Why is that?
26:27Because we're now on
26:28the text field and that
26:29text field doesn't have a
26:31hand cursor. Okay, so if
26:34I then comment out the
26:35use hand cursor, and I
26:37leave out leave in mouse
26:39children, when I rolled
26:40over the item, I am going
26:42to get it. And the reason
26:43is because by setting the
26:44button mode, it already
26:46automatically set my hand
26:47cursor, but because my
26:49children were blocking the
26:50way we couldn't see it.
26:52Okay, so the use hand
26:53cursor wasn't really
26:54needed, but we did it
26:56anyways. All right, so
26:57we have our we have our
26:58rollover, we have our
26:59roll out, we have a mouse
27:01cursor. And really the
27:02last thing that's left is
27:03actually getting our movie
27:04clip to actually click.
27:06Now, I'm going to use a
27:07little a little trick and
27:09a little because we didn't
27:09really learn all these
27:10stuff yet. So I'm going to
27:12I'm going to add here a
27:12little bit of a of a of a
27:15cheat. Okay, not really
27:17supposed to do it. But as
27:18we as we, you know, learn
27:20more things, we're going
27:20to avoid doing that I'm
27:21going to add a third
27:22parameter. And that third
27:24parameter is really
27:25going to be the website we
27:26want to go into. So the
27:27first one will be blog at
27:29everything fla.com, because
27:30it's a great place to go
27:31to. And then the second
27:33one will be our main
27:36website, which is also
27:37great. And our third URL
27:41would be where could we go
27:45next? Google s3.com, which
27:50is going to be our new
27:51domain unless Google tells
27:53us we can't own it. I
27:54don't know if we could or
27:55but I think we could. And
27:59the third one will be our
28:02new everything nice.co,
28:07which has nothing in it
28:08right now. All right, so
28:10we have your three buttons.
28:11Now we have to add another
28:12parameter to our setup
28:13button. And that next
28:15parameter is going to be
28:17URL to end play and send
28:21it the string of the name
28:22of the frame. Now I'm
28:23just going to create one
28:24sample one, which would
28:25then make every single time
28:26you click on any menu item
28:28to move the glasses. What
28:30I want you to do is figure
28:31out a way how to create a
28:33variant in the animation
28:34and have a different
28:35animation. So each time
28:36you call a different menu
28:38item, the glasses would
28:39move. We have a two week
28:41break ahead of us. So I
28:42really recommend you guys
28:44even taking it further away
28:45from that, seeing how you
28:46add your own custom copy
28:48into the menu, and then
28:49changing the layout, you
28:51know, working with the
28:52stuff and figuring out how
28:53to make sure that the
28:53layout stays clean even as
28:55your menu changes. Okay, so
28:57that's all I have about the
28:58menu. I'm going to move
29:00it back to you guys. I
29:01know that we're down a
29:06member. Is there any
29:07questions? I know Adam is
29:09gone. Matt, Michael,
29:11Carol is, how do you guys
29:14feel about what's going
29:15on so far? Do you guys
29:16see yourself playing with
29:17this in the next two
29:18weeks and seeing what
29:19you guys come out with?
29:20I'm going to send an
29:20email out to all of you
29:21with the source files as
29:22well, by the way.

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!