User Tag List

Results 1 to 4 of 4

Thread: Toggle button events

  1. #1
    Clicker Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)Mac Export Module (Steam)

    Join Date
    May 2007
    Posts
    549
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Toggle button events

    I have two events:

    1) Condition

    Button (btConnect) clicked
    +(btConnect) internal flag 0 is off

    1) Action

    (btConnect)
    Change Text to "&Disconnect"
    Set internal flag 0 ON


    2) Condition


    1) Condition

    Button (btConnect) clicked
    +(btConnect) internal flag 0 is on

    1) Action

    (btConnect)
    Change Text to "&Connect"
    Set internal flag 0 OFF


    Why is this not working? It was two different clicks on the button. The "Only one action when event loops" condition will not make it work properly and it doesn't matter what I do.

    How can I simulate a toggle button event like the one above?
    Thanks.





  2. #2
    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: Toggle button events

    All you have to do is make a counter and when they clik the button to turn the flag on, keep adding to the counter until it's like 5. And if the counter is five and they click to turn the flag off, keep subtracting from the counter until it's 0, and then they can press the button again. That's all I can think of right now. Sorry if I'm not very clear.
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Toggle button events

    It's not working because MMF2 reads the events from top to bottom. As soon as the condition (flag is 0) has triggered, the flag is now 1 and the condition (flag is 1) will trigger

    I made the "Condition ID restriction" object to tackle this problem- you can find it in the Released extensions forum.

  4. #4
    Clicker Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)Mac Export Module (Steam)

    Join Date
    May 2007
    Posts
    549
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Toggle button events

    Thank you. It may work.
    As a workaround, I made a Disconnect button at the same position of the Connect button and when I click on one of them I hide the other.

    But I wonder if the problem I mention won't affect event-driven applications rather than games. Sometimes, depending on the order of the conditions I get different results. If I have an event with 4 or 5 conditions, sometimes MMF will evaluate only the first.

    Are there any docs about the inner working or condition priority rules of the MMF2 engine? I'd really like to be familiarised with the engine.

Similar Threads

  1. Having difficulty getting a sound toggle button working
    By ElectricMaster in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 15th December 2013, 08:52 PM
  2. [Idea] Legacy Menu Button Toggle!
    By Bipolar_Games in forum Android Export Module Version 2.0
    Replies: 3
    Last Post: 31st July 2013, 01:40 PM
  3. Global Events Button request
    By Boba Fonts in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 10th August 2010, 05:52 PM
  4. One-event toggle button (just for grins)
    By Saml in forum Widgets
    Replies: 1
    Last Post: 4th January 2009, 10:07 PM
  5. Button object crash---no events
    By Blizna in forum File Archive
    Replies: 10
    Last Post: 28th November 2006, 09:15 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
  •