Instance question

I am using Flash MX ver6.0.

I have four basic symbols:


Dude is controllable with the cursor keys. When dude performs a HitTest, a Trace displays which symbol he touches. (i.e. Square,Circle,Triangle)
(This is purely a test of Flash capabilities)

This is where it gets a little confusing and I may word this wrong.

I can display the "instance name" of the symbol, provided I have supplied one.
However, I want to get the "symbol name" as it appears on the Properties pane next to "Instance of:".

For example, if I make 5 copies of Circle but do not provide an "instance name", I would still like to have all copies of Circle display "Circle" when Dude detects a hit.

Is there a way to do this?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


From my past experience,

You can only use the "instance of" name but not outputting it


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I'll stick my head out on this one ans say, no you cannot access the instance of property.

Your 2 options, use linkageID - which you have to assign, or use the instance name.

Why would you want to anyway?
 just curious.

wendelinaAuthor Commented:
This test was really to find an easier way to handle game programming. I also posted on Macromedia's board and found the same answer.

My goal is to create a working test of a single screen game similar to "Super Mario Bros."

The tutorials I found suggested ways to make a game in this vein, but I found some of the techniques a little suspect.

My first goal was to create limitations on the character's movement around the play area. When the player character hit an object, I wanted to find out what type of object the character had come in contact with. This way the player character would react properly to that type of object no matter what the instance.

This would allow me to drag & drop symbols where I want them to be placed and quickly create limitations on the character's movement. The two most successful tuts I've seen on how to do this use two methods which I find unbelievably inefficient.

The first was plotting XY coordinates to block out the limitations. Unbeleivably time consuming, but very cool and it makes for some interesting capabilities as far as hit detection.

The second was creating a hidden layer/symbol/mask or something that lays out the limitations. This just seems messy and time consuming if you plan to have more than a few simple screens. (Bubble Bobble was used as an example, and would probably be relatively easy to build this way.)

A user on Macromedia's forums suggested the following:

"You can create classes for you symbols, so that you have a class 'Circle'
derived from 'Movieclip' (say), then you can test if the type of the object
you hit with is Circle.

Another thing you can do is give you instance a property, call it (say)
'type' eg.

mycircle.type = "Circle";

then, when you get your hit test, you can look at the 'type' property of the
object you hit."

I think both of these suggestions could make it pretty easy to accomplish my goal.

My ultimate goal is to be able to create Flash projects where I can treat them like a rapid development environment so I can pump out "sequels" by dragging and dropping symbols and letting the code take care of itself.

This may just be a dream, but I want to at least test out the possibility.
i suspect if you use AS 2 and classes, you can determine the superclass.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.