View Full Version : Instances Rename Themselves?
nickej
08-05-2003, 04:34 AM
OK....Here's something I can't figure out....I'm using nested movie clips to do a simple planetary motion setup. A movie clip of an asteroid revolving (a frame-by-frame from Swift3D), is placed on an elliptical path and then made into another Movie Clip to handle the revolution part of the motion. I figured that way, I'd be able to address actionscripts to the individual instances so that I could offset both the revolutions and the rotations and avoid obvious duplication. So far, so good.
The problem that I'm having is that despite extreme care, I can't set instance names for my individual rotation clips. The last one entered becomes the instance name for all of them, despite their different parents. I want to emphasize that I have no problem at all with the instance names of the "higher" revolution clips--I enter them, they stay. I didn't think such a thing was possible! I don't have any scripts running that would dynamically rename them, in fact, the change occurs without the fla running or being tested, just as I'm typing in the instance name. I'm ABSOLUTELY certain that all I'm doing is affecting the instance name in the instance field. What could cause this?
silvernapalm
08-05-2003, 10:50 AM
i take a stab,
when you work with nested clips, let us say you have two clips a parent and a child, whatever you do to one will affect the other.
the solution might be to create new mc's with the names you want, then drop each of the planets or whatever into it.
the outer mc will carry the characteristics or attributes that you want to place on each mc.
you cannot create one parent child and assign attributes to the parent, it will carry over...in essence you have to create another mc. to contain the parent child...(though that becomes a parent too...but i will avoid that scenario now)
nickej
08-05-2003, 02:44 PM
Hi-Thanks for your reply! I'm not sure I'm understanding it, though. I understand about the inheritance of characteristics from parent to child clips. The child clip will inherit motion, etc. from a parent, but that is not what is happening.
As an example, say I made a spinning wheel clip to use as a car wheel. I could drag out two copies to use as a front and a rear wheel. I could make them children of the car, and they would inherit the car's motion. Additionally, by naming them "front_wheel" and "back_wheel"in the instance name panel, I could address them individually through actionscript (in the form "car.back_wheel" and "car.front_wheel") and give them different behaviors or characteristics (within reason).
What's happening to me is that when I type in "front_wheel"in the instance name field, both "front_wheel" and "back_wheel" end up being called "front_wheel", even if I never opened up the properties for the other clip.
It's very confusing.
silvernapalm
08-05-2003, 04:23 PM
upload the file. i think i know what you are talking about.
take a clip named wheel drop it on the stage.
name one wheel1 the other wheel2.
it should work. if not try rebuilding the mc from scratch.
nickej
08-06-2003, 04:13 AM
AHA! I just checked in to say that I believe I've solved the problem! (or at least, I've figured out what was going on and worked around it....)
Basically, what I was forgetting is that when working with nested clips, when you double click on an instanced clip to get access to its nested clips, you're actually taken to the library copy. There doesn''t seem to be a way to gain access to the "sub clips" as instances themselves that way.
What I did was to make duplicates of the nested clips in the Library, and drag the copies out to the Scene. This let me name the instances of the asteroid revolving as one thing, and the asteroid rotating as another, so I could offset them as independent units. The nice thing is that this seems to create instances of the library items, so the effect on file size is minimal, only about 1K or so.
Unfortunately, the fla is about 450K, even trimmed down to be a demo (the Swift3D stuff tends to be large) so I've had to make up a demo using native flash objects. There are two circles that grow and shrink while moving on circles. The clips are a movie clip and a library copy so I was able to target the subsections by name and have both the motion along the path and the phase of pulsation set independently.
Thanks again for the help! I'm sure I'm going to have lots more trouble!
nickej
08-06-2003, 04:16 AM
Hmmmm...Attachment didn't seem to come through....I'll try again.....
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.