User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Button index?

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Iceland
    Posts
    478
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Button index?

    I have a button object. I used duplicate and have 10 columns and 10 rows.
    This button seems to be an array as I use at start of frame:
    Set Alterable Value A Random(10)+1
    Change Text to Str$(Alterable Value A( "Button" ))
    This gives my a 100 buttons with a lot of different numbers. I use this for a simple Math game.

    The grid could be like this:

    1 2 3 4 6 5 6 5 4 3
    5 6 7 5 4 9 8 7 4 3
    9 8 9 8 9 2 3 4 5 2
    4 5 6 7 5 1 3 4 5 6
    1 2 3 4 6 5 6 5 4 3
    5 6 7 5 4 9 8 7 4 3
    9 8 9 8 9 2 3 4 5 2
    4 5 6 7 5 1 3 4 5 6
    1 2 3 4 6 5 6 5 4 3
    5 6 7 5 4 9 8 7 4 3

    Then a sum appears in a text box and you click on a button(s) and get the right sum. If the sum is 4 then you could click on 1 and 3! Those two buttons then disappear. ( This idea is not mine) I´m just trying to implement this using MMF2.

    Now I want to add an extra bit - if all the numbers in a row or column are cleared then you get a bonus. In Visual Basic I would use index of the button array. Which is the best way of addressing an individual button?

    Keli



  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Eliyahu's Avatar
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Button index?

    You would Spread Value 0 in an Alterable Value of the buttons, so each has a unique ID. Then you can loop through them in a fast loop. On loop AND Alterable Value of Button = Loop Index AND whatever other conditions.

    However, someone will come on here and say use the ForEach object. I guess try out ForEach, it might be able to do what you want.

  3. #3
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Button index?

    Well, seeing as the ForEach object is exponentially faster than the other method, and that it can support looping through buttons, I think it would definitely be the better option.
    Working as fast as I can on Fusion 3

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module

    Join Date
    Jul 2006
    Location
    Iceland
    Posts
    478
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Button index?

    Hi

    Thanks both for your good help. Do you know of any examples?

    Keli

  5. #5
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Button index?

    Examples come with the For Each object...
    Working as fast as I can on Fusion 3

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Eliyahu's Avatar
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Button index?

    ForEach is also buggy and unreliable.

  7. #7
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Button index?

    It is? I didn't know that. Can you explain what and how it is buggy. I would appreciate it.

    Thanks

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Eliyahu's Avatar
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Button index?

    I had problem putting it into my games because it runs the ForEach action last, so you cannot do it mid-event. After finally getting it to work in EXE, it ended up being SLOWER than if I had done it with alterable values and fast loops. I kept the ForEach loop there, it was all working, and I exported to flash, and my whole game just was a mess. Actives were spawning randomly, nothing was working, I couldn't even identify what was wrong because of how messed it was.

    Overall I've had terrible experiences with ForEach every time I've used it, about 3 times. I will not be using it again.

  9. #9
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Button index?

    Oh, ok and thanks Eliyahu.

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  10. #10
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Jun 2007
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Button index?

    Hi Keli,

    I've added an example mfa file in thefile archive for your reference, hopefully it will help you!

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=217461#Post2174 61

    It works out once a full row of boxes has been destroyed.
    Any problems let me know.

    I just realised you wanted columns AND rows! You can use the same principal for columns also, I'm sure you can figure it out

    Have fun!

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Button is clicked condition works even when button disabled - Beta9
    By AyreGuitar in forum iOS Export Module Version 2.0
    Replies: 0
    Last Post: 29th May 2012, 02:29 PM
  2. An example for Keli reference button index questio
    By BaconUk in forum File Archive
    Replies: 0
    Last Post: 31st December 2010, 09:12 AM
  3. AltValue Index Bug
    By Clubsoft in forum SWF/Flash Export Module Version 2.0
    Replies: 1
    Last Post: 10th March 2010, 06:32 AM
  4. Loop Index?
    By Leric in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 25th July 2006, 08:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •