0 Replies - 959 Views - Last Post: 01 December 2010 - 02:21 AM

#1 ProxyCube  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 01-December 10

AS3: Parent mc holding many *independent* child mcs

Posted 01 December 2010 - 02:21 AM

Hey there,

I'm creating a game, finished all artwork and now onto code.
Basically I have an object that I attach to the display, well I want to have many of the same object on stage at once, within a parent mc. This will mean I can manipulate all the child mcs via calling on the parent mc. Now what I need is the child mc's to act independently as in they can move in a (set) direction. So the result will be having many falling objects and having a 'hero' movieclip that reacts with all of them (hittest etc).

I thought the most logical way for one movieclip to react with many 'duplicate' movieclips was to have all those movieclips within a parent movieclip so I don't have to rename each child movieclip and instead just check hittest on the parent movieclip.

Here is what I have so far:
 var newCircle:awning = new awning();

function Main() {
	newCircle.x = 130;
	addChild(newCircle);
}


the function "main()" is called every 20 seconds.
newCircle is a variable that contains a movieclip from the library called 'awning'
in an Enter_frame event I have called the newCircle to constantly fall > .y++;

This is a very amateur approach but I am looking for a very efficient way to do this.
ALL help is welcome, Thank's in advance and congratulations if you managed to stay reading this post to the end :)

Is This A Good Question/Topic? 0
  • +

Page 1 of 1