02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

Setting Up For Multi-Level Clusters

This video is setting up the stage for working with Regexp by setting up a new naming system for the clusters.rn

Video Transcript

00:00Okay, now that we played around a bit with clustering, let's take it to the next level
00:06and start building dynamic clustering.
00:09Basically, dynamic clustering is an interesting concept, which I hope you guys will enjoy.
00:16I'm going to delete the UID and we're going to play around a little bit with the properties.
00:21Instead of looping and creating 100 movie clips, let's, instead of using our UID, we're
00:33going to put inside here, let's call it, let's say, let's call it red, red click and delete
00:43this UID.
00:44We're going to call this one red roll and we're going to call this one red out.
00:50Okay, and I just want to make sure that we're not using the UID anywhere else and we're not.
00:58We just delete the extra code here because we're working off of a new file now.
01:03Let's change the looping from looping 100 times to looping 50 times and let's duplicate
01:10that twice.
01:11We don't need to define the I again, so we're just going to do I equals zero and we're going
01:16to run through it another time and this time around, let's give it red, green, blue, so
01:21let's go for blue.
01:23Alright, so now if we run the application again, hopefully there won't be any major
01:29errors.
01:30There we go, we have to delete, let's delete all this, the remove won't do anything, just
01:36put in our trays in the meantime and that was when you click on a shortcut, you don't
01:45mean to clean up the code here a bit, get rid of some extra lines that we don't need.
01:51So let me just run through this quickly.
01:53So what I did is I went to the loop, the initial loop, now we're running only 50 times.
01:59I changed the UIDs to be kind of hard coded based on the color of the objects which
02:04is red in this round and then I created another loop which is basically a duplicate of the
02:09one that was above and on this one instead of calling it red, we're going to call it
02:13blue, blue click, blue roll.
02:24So now if we run the application again, all we change here is we just created different
02:29colors here, 50 that are blue, 50 that are red, our remove function is not doing anything
02:35right now and that's our next task.
02:38So now that we actually created 50 items that have one cluster ID and 50 items that have
02:43a different cluster ID, but if you notice, both of them share some commonalities.
02:49So some of them are called red click, some of them are called roll, sorry, some of them
02:53are going to start with the word red, some of them start with blue, but they have commonalities
02:58of you know, some of them are, both of them have click attributes, both of them
03:01have roll, both of them have out.
03:03You know what, I want to bring back that variable, the UID, because we could always
03:08append the UID, so I'm just in a UID string, I'm just giving a new project ID, let's call
03:16it on.

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!