The Daily Click ::. Forums ::. Klik Coding Help ::. Parenting/assigning childs to an object in MMF2

Post Reply  Post Oekaki 

Posted By Message

Johnny Look

One Happy Dude


VIP Member
8th February, 2009 at 16:41:56 -

How do I assign childs or parents to an object in MMF2 ?
In case you don't know what I'm talking about I'll give an example:
Every time you create a new square, you might want to have a smaller square attached to that square so that you can assign events to that smaller square while selecting it's parent (the biggest square).



Cornwall UK


VIP MemberWeekly Picture Me This Round 43 Winner!Weekly Picture Me This Round 47 WinnerPicture Me This Round 49 Winner!
8th February, 2009 at 18:19:39 -

Well, Clickteam got rid of the whole parent/child concept in their recent products.

This is where you can use "spread value". There are a few articles on the subject (and also "duplicates" which are kind of related), but here's a quick example anyway:

+ always
-> spread value "1" in Alt. Value A("Big Square")
-> spread value "1" in Alt. Value A("Small Square")

+ player clicks on "Big Square"
+ Alt.Value A("Small Square") = Alt. Value A("Big Square")
-> destroy "Small Square"

Here, clicking on a big square will destroy the corresponding small square.



8th February, 2009 at 22:42:29 -

Well the destroy action has to run via a fastloop. otherwise this will only function with one object each, with two or more this wont run.


Post Reply



Worth A Click