User Tag List

Results 1 to 7 of 7

Thread: Simple way to apply actions to "All other" objects ?

  1. #1
    No Products Registered

    Join Date
    Dec 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple way to apply actions to "All other" objects ?

    I have some event like this:

    <> Create 9 red squares at start of frame
    <> When users clicks with left button on a square
    -> change color of that square to green

    And here is my trouble. I want some additions action like this:

    <> When users clicks with left button on a square:
    -> change color of that square to green
    -> change color of all other squares to red

    I want final result always is 8 red square and 1 green squares on screen, no matter which square i clicked.
    Please help me a example

    Here is my mfa
    Attached files Attached files

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Chrille's Avatar
    Join Date
    Jul 2006
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The easiest way to do it in your case would be to create an event before "User Clicks with Left Button on Square" that looks like this:

    + User Clicks with Left Button
    = Change Animation Sequence to Red


    Updated Example: Select Square Update.mfa

  3. #3
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You can achieve what you want with two actions.

    The first action resets the values of all objects. In this case, you want the default color to be red.
    The second action sets the values of a few (in this case one) object. In this case, you want the specific color to be green.

    You would construct you events something like this:

    Code:
    Event 1
    + User Clicks
    - Set animation sequence to red
    Code:
    Event 2
    + User Clicks on Object
    - Set animation sequence to green
    The trick is to use a generic object scoping event which can affect all objects (Event 1) and a specific object scoping event which can capture individual objects (Event 2). You'll also need to ensure the generic event executes before the specific event.

  4. #4
    No Products Registered

    Join Date
    Dec 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks you all i never thought it can be this simple

  5. #5
    No Products Registered

    Join Date
    Dec 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can we make it more accuracy ? With this trick, when user clicks at "anywhere" except squares, all squares will reset to red color.
    Can we make all squares will reset only when user clicks at any square ?

  6. #6
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,197
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Here is a little trick which should work.

    Code:
    Event 1
    + User clicks on Square
    - Run fastloop "DummyLoop" 1 time
    - Set animation sequence to red
    Code:
    Event 2
    + User clicks on Square
    - Set animation sequence to green
    Code:
    Event 3
    + On fastloop "DummyLoop"
    (You do need to add any actions to this event)
    If this works like I think it should, it is because the object scope of an event is lost after a fastloop executes. You can exploit this to have an action execute when something acts on an specific object and apply the action to all object. You do need to have Event 3 somewhere in the code otherwise this exploit will not work.

  7. #7
    No Products Registered

    Join Date
    Dec 2013
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This way work perfectly as i want, thanks you very much

Similar Threads

  1. Replies: 6
    Last Post: 18th August 2015, 02:23 AM
  2. Hide ios keyword + actions on "return"
    By assentec in forum iOS Export Module 2.5
    Replies: 2
    Last Post: 30th June 2015, 07:48 PM
  3. Physics "Apply Impulse..." Action
    By BaconUk in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 10th December 2013, 04:47 AM
  4. Fastloop to apply actions to all objects created by an event.
    By Crash86 in forum Multimedia Fusion 2 - Technical Support
    Replies: 20
    Last Post: 22nd November 2011, 01:46 PM
  5. "Restrict actions" is BROKEN!
    By Pkeod in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 26th August 2008, 12:41 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
  •