Creating Our First Symbol - A Graphic
While Graphics can't be accessible to code they are our first sample of building library assets. We run through this topic quickly as its not very code oriented. Graphics are library assets that enable us to reuse a visual element multiple times without it eating into the size of our production file.
Video Transcript
00:00And in our flash file, what I want to do
00:01is I'm just going to get back F4 out of our full screen mode.
00:06And I'm just going to create something.
00:07It really doesn't matter what.
00:09And we're going to create a little button.
00:11So I'm just going to create a new grab the oval tool.
00:14I'm just going to create a select here, some sort of color.
00:17And we're just going to go right here.
00:19We're just going to create a nice purple button,
00:21nice pretty purple button.
00:23And then again, as I create stuff,
00:25I could type V to select my selection tool,
00:28highlight the whole thing, and now I
00:30have the new element that I've just created highlighted.
00:35The next step that I want to do is actually convert
00:37that visual element right now, which
00:39has no name, which can't have any name.
00:41If I go into the properties, I would not
00:43have any option of creating a name.
00:45I could define a lot of things for it.
00:48But there's nothing there that enables me to create a name.
00:51And to be able to create a name,
00:52we have to learn a new concept, which is not
00:55that far away from the concepts which you worked with before,
00:58which is basically we want to actually abstract our element
01:01and actually create, I would say, a library element,
01:06or something that could be duplicated.
01:08And only after we do that, we could actually
01:09then add a code to it.
01:12So the way I do that is I'm going to go into my Modify menu
01:16and select Convert to Symbol, because I
01:19want to convert the element I have right now into a symbol,
01:22which I could then reuse.
01:24Now, technically, this is exactly the type I want.
01:26I want to use my button.
01:28And we don't really care about the advance right now,
01:30so I'm just going to take it out of our eye.
01:34We could select between Movie Clip, Button, and Graphic.
01:38Let's look at a graphic just for one second.
01:40So I'm going to create a graphic.
01:41And as the tradition was so far,
01:43I'm going to start calling it the GR,
01:45and I'm just going to call it Oval.
01:48And I'm going to hit Enter.
01:50And now I have a visual element that could be duplicated.
01:54And if I look into my Properties panel again,
01:56I have no way to define a name for it,
01:58because graphics are not available for code.
02:02Now, although they're not available for code,
02:05we could access them in the library, which
02:07is not the two are not connected.
02:10And then I could grab as many ovals
02:12as I want after I created them and display as many ovals
02:16as I want on the stage.
02:19But we care about code.
02:20We want to be able to connect our visual elements
02:22with code, so we're not really going to work with graphics.
02:25So I'm just going to delete that oval tool, which
02:27was a graphic, just by double clicking on the eraser, which
02:30will delete everything on my stage.
02:33And I'll leave it in the library, because it doesn't hurt.
02:35We're not going to be using it right now.
