PDA

View Full Version : Attached clip seems to float far above the rest of the movie



WobblyFork
November 20th, 2002, 11:17 AM
Hi all,

I currently am creating a game where you shoot at targets that randomly appear. I have them set to be randomly generated via an attachMovieClip object, and all works well... EXCEPT that whenever it generates the clip from the Library, the instance is WAY above the rest of movie (layer-wise)!

This means that my custom-crosshairs cursor, for instance, is always behind the target and thus the user cannot mouseDown and shoot it.

Ack... any ideas what to do?

Thanks!
- wobbly

Jubba
November 20th, 2002, 11:50 AM
when you define its depth, make it negative...

attachMovie('whatever', 'copy'+ii, ii-2000)

that should work...

WobblyFork
November 20th, 2002, 06:22 PM
Nope, I can't say that helped anything one bit :(

Thanks for trying though... any other ideas?

Sorcerer
November 20th, 2002, 06:41 PM
try using swapdepths to change the depth of your crosshairs

WobblyFork
November 20th, 2002, 06:57 PM
Change of direction: swapDepths solves the problem! Thanks Sorcerer :)

However, there is another problem... the randomly generated movie clip has no properties associated with it. Now, I have defined these properties already in a test movie clip on the stage. How do I make sure the onMouseDown, etc. properties are transferred to each clip as it is created?

I am not clear on how to use initObject but I think this is where the solution lies. Can anyone give me a quick little tutorial on how initObject is used?

Thanks all!
- your ever-grateful Wobbly

pom
November 21st, 2002, 04:22 AM
There is one :grrrr:
In the AS tricks section.

pom :cowboy:

WobblyFork
November 21st, 2002, 11:24 AM
There is one :grrrr:

Ahhhh... I'm sorry :!: