To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here


A Flash Developer Resource Site

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Reply
 
Thread Tools Search this Thread Display Modes
Old 10-27-2005, 04:54 PM   #1
luffmcgruff
Member
 
luffmcgruff's Avatar
 
Join Date: May 2002
Posts: 90
Lots of MCs, lots of frustration!

I'm writing a small simulation that's dealing with a large number of small MCs that are dynamically created.

I also need to run a hitTest that checks whether any clip is in contact with any other clip.

code:
function Hitdetect() {
for(i=0; i<=100; i++) {
if(this.hitdetectMC.hitTest(_root["character"+i])) {
proximity ++;
}
}
}



proximity is a variable inside each instance of the character MC.

The problem I have is that I need to create another function, Spawn, that creates another instance of the original character MC. The problem is, I don't know the best way to assign a name and depth to the newly created MC considering that some of the MCs will be deleted based on their own code.

Can someone suggest a way of storing the identity of the created movie clips?

I considered using an array to store the IDs of the instances, but everytime a new clip is created, the array will end up getting bigger and bigger, and the scanning of that array will end up slowing the whole processing down.
__________________
luffmcgruff is offline   Reply With Quote
Old 10-28-2005, 01:20 AM   #2
Q__Hybrid
Qwaizang:syntax_entity_
 
Q__Hybrid's Avatar
 
Join Date: Aug 2005
Posts: 270
I'm confused. Is a new clip created when two clips touch (hitTest)? Is an existing clip deleted when two clips touch? Are there more than 100 clips in total or is this the maximum allowed?

More details, please.
+Q__
Q__Hybrid is offline   Reply With Quote
Reply

Go Back   Flash Kit Community Forums > Flash Help > Flash ActionScript

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:36 PM.


internet.commerce
Be a Commerce Partner
 »  »  »  »  »  »  »
 »  »  »  »  »  »
 

    

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.