
Page 1 of 1
Jesse Stratford
Jesse was born and raised in Australia, and now lives in London. He is one of the original founders of http://ActionScript.org, and was formerly a Flash developer, teacher, author and speaker. While Jesse no longer works as a full-time Flash professional, he still enjoys actively participating in the http://ActionScript.org community as time permits.
Time: 5 minutes
Difficulty Level: Beginner
Requirements: Flash 5 or higher.
Topics Covered: Instance Names.
Assumed knowledge: Basically nothing.
Download the source for the above movie here. (Zipped, PC Flash 5 file).
This tutorial outlines, just briefly, what Instance Names are since we will make reference to them all through this site, in all levels of tutorials and open source.
An instance is a copy of any symbol from your Flash file's library which resides on the stage. So any graphic, button or movie clip you put on the stage is an instance. All instances have Instance Names, which by default are "instance1", "instance2", etc.
Instance names become important and useful when you begin using Actionscript at any level. Say you want to look up John Smith in the phone book. You grab the book or jump online and do your search for John Smith. Then when you find his details you can call him and tell him/ask him stuff. It's the same with objects on your stage. You can't tell them or ask them stuff until you know what they're called and where they "live". For the moment we're just working out their names. Where they live is covered in the Paths tutorial.
Up to Flash 5 instance names were only really applicable for Movie Clips, but in MX we can address buttons using their instance names and do all sorts of fancy stuff, so they've become even more important! So let's just quickly run through how to make a clip with an instance name. Go File > New. Now Ctrl F8 will create a new symbol. Name it anything you like, select Movie Clip and hit OK. Now draw a small graphic within this movie clip and press Ctrl E to return to the main stage. Ctrl L will bring up your library. From here, drag one copy of your movie clip on to the stage. Select your movie clip and fire up the Instance Properties Panel (Flash MX), Instance Inspector (Flash 5) or right click and go to Properties (Flash 4).
Now in the "<Instance Name>" field type a name for the instance you've just created (I'll do "Joey", without the quotes of course). Save your file and then Test it using Ctrl Enter. While in the test environment press Ctrl L to bring up the Layers and Objects debugging window. You should now have one copy of clip "Joey" on your stage. The debugging window shows this as Movie Clip: Frame=1 Target="_level0.Joey" which means that Joey is a Movie Clip element, on Frame 1 and its full path is _level0.Joey.
And that's it! I would now recommend you read the Paths tutorial as a quick follow up to this one. Remember to post questions on the Forums rather than emailing me.
| Jesse Stratford is the Co-Master of ActionScript.org and a freelance Flash developer and teacher. He is based in Australia and enjoys all things Flash. NB: If you have comments or feedback please feel free to email me, but please do not email me Flash questions; the forums are provided for that purpose and you will get a faster answer by posting you question there. |
If you have found this tutorial helpful, I hope that you will take 30 seconds to visit The Hunger Site where, with just one click you can make a free donation of food to a starving person in a third-world country. We do not benefit financially from this action; it is purely an act of charity. |
| This tutorial is protected by International Intellectual Property Rights laws and may not be reproduced or redistributed in full or part, without the prior written consent of the author. Unauthorized reproduction of this tutorial or its contents may result in prosecution. I've worked hard on this tutorial, please don't steal it. |
Spread The Word
Related Articles
17 Responses to "Instance Names" 
|
said this on 14 Jun 2007 4:17:15 AM CST
The tutorial explains ins
|
|
said this on 03 Oct 2011 3:03:30 AM CST
I assume actionscript mak
|
|
said this on 19 Jul 2007 6:41:53 PM CST
this was fun! I just wish
Thank you |
|
said this on 25 Sep 2007 4:21:45 AM CST
The AS code is found in t
on (relea /:name = _nam /:target = _target; } |
|
said this on 24 Jan 2008 1:01:00 AM CST
on(release){
thi this.tar } this |
|
said this on 03 Apr 2010 11:21:40 AM CST
this site..is lil good...
|
|
said this on 05 Apr 2010 8:52:28 PM CST
@Leanne
I found the acti |
|
said this on 30 Apr 2010 3:05:47 AM CST
hi there! hi there! how c
|
|
said this on 30 Apr 2010 2:36:16 AM CST
hi there! how can I make
|
|
said this on 30 Apr 2010 11:57:13 AM CST
Great tutorial. It is ve
|
|
said this on 31 Oct 2010 2:37:00 PM CST
alright I feel like an id
|
|
said this on 02 Mar 2011 3:27:57 AM CST
Thanks for Jesse Stratfor
|
|
said this on 10 Jun 2011 4:44:20 AM CST
I like flash very much be
|
|
said this on 18 Aug 2011 2:56:07 AM CST
I think this is very grea
|
|
said this on 03 Oct 2011 3:02:40 AM CST
I've been studying flash
|
|
said this on 24 Nov 2011 1:18:08 AM CST
The scene that Justin ref
|
|
said this on 01 Dec 2011 8:39:17 AM CST
Great tutorial. It is ver
|




Author/Admin)