[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Instance question

Posted on 2004-11-23
4
Medium Priority
?
200 Views
Last Modified: 2010-04-07
I am using Flash MX ver6.0.

I have four basic symbols:

Square
Triangle
Circle
&
Dude

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?
0
Comment
Question by:wendelina
  • 2
4 Comments
 
LVL 16

Accepted Solution

by:
vickerleung earned 1000 total points
ID: 12661194
Wendelina,

From my past experience,

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

Vicker
0
 
LVL 39

Assisted Solution

by:blue-genie
blue-genie earned 1000 total points
ID: 12662519
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.

blu.
0
 

Author Comment

by:wendelina
ID: 12665268
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.
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 12665346
i suspect if you use AS 2 and classes, you can determine the superclass.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
Suggested Courses
Course of the Month18 days, 8 hours left to enroll

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question