User Tag List

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

Thread: CORRECT way to Toggle!

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

    CORRECT way to Toggle!

    This is a common mistake that people make without realising th effect of it. They make some simple toggle code, but then find out it doesn't work because it will only show one of the two or more possibilities. It's an easy fix by adding 1 event, and one condition to each other event, and I thought I'd post both the wrong and right way for people to see and understand it better.

    Note: This method is better than toggling active objects' flags because those can only be on or off, wheras with this method, you can have unlimited toggle states.
    Attached files Attached files
    Working as fast as I can on Fusion 3

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: CORRECT way to Toggle!

    There is usually not one correct way to do it. Attached are some alternatives (use space bar to trigger the examples). The first of my examples is the one most suitable for more than two states, so if you need to do that, replace 0-Display Object( "Toggle Grey" ) with (Display Object( "Toggle Grey" )+1) mod [number of states]
    Attached files Attached files

  3. #3
    Clicker

    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,730
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)

    Re: CORRECT way to Toggle!

    Thanks Nifflas.

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

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

    Re: CORRECT way to Toggle!

    Nice examples, Nifflas!
    Working as fast as I can on Fusion 3

  5. #5
    No Products Registered

    Join Date
    Nov 2009
    Posts
    480
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: CORRECT way to Toggle!

    Quote Originally Posted by Nifflas
    There is usually not one correct way to do it. Attached are some alternatives (use space bar to trigger the examples). The first of my examples is the one most suitable for more than two states, so if you need to do that, replace 0-Display Object( "Toggle Grey" ) with (Display Object( "Toggle Grey" )+1) mod [number of states]
    You know I was thinking about using mod in a way like that. I'm always just a step behind!

    -Variant

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Posts
    1,305
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)

    Re: CORRECT way to Toggle!

    What you're talking about is "cycling" not "toggling".
    Neither is "correct" or "better" - they're just used for two different purposes.

  7. #7


    Join Date
    May 2010
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: CORRECT way to Toggle!

    We should have a separate forum for these kind of threads. I love example threads or informative threads that show common mistakes or unique ways of doing things or even complex but basic things in mmf2, without looking through tutorials, of course.

  8. #8
    No Products Registered

    Join Date
    Feb 2010
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: CORRECT way to Toggle!

    Yes, I have had trouble with toggling... I found ways around it, but they seem messy. Is there anything significantly simpler than this example?
    Attached files Attached files

  9. #9
    Clickteam Clickteam
    Jeff's Avatar
    Join Date
    Jun 2006
    Location
    Battle Ground Washington
    Posts
    11,822
    Mentioned
    7 Post(s)
    Tagged
    2 Thread(s)

    Re: CORRECT way to Toggle!

    Does this do the same thing Lego Catcher?
    Attached files Attached files

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

    Re: CORRECT way to Toggle!

    Can't you just do user clicks on object: Toggle Flag 0? Then there is just one more event Flag 0 is on: Set position of active to Mouse, which I consider signifigantly simpler.
    Working as fast as I can on Fusion 3

Page 1 of 2 1 2 LastLast

Similar Threads

  1. iOS Toggle Switch
    By JosephFTaylor in forum iOS Extensions
    Replies: 4
    Last Post: 5th April 2013, 08:33 PM
  2. iOS Toggle Switch
    By JosephFTaylor in forum iOS Specific Example Files
    Replies: 3
    Last Post: 5th April 2013, 08:32 PM
  3. Is this correct?
    By Keli in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 11th December 2008, 12:18 AM
  4. Toggle Movement
    By Keli in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 1st January 2008, 09:27 PM
  5. You can correct the problem of +2 GB
    By josemiguel in forum Install Creator and Patch Maker
    Replies: 3
    Last Post: 22nd November 2007, 03:11 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
  •