User Tag List

Results 1 to 6 of 6

Thread: Array and "on each" loop

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    Tiny's Avatar
    Join Date
    Jul 2006
    Location
    Sweden
    Posts
    652
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Array and "on each" loop

    How do I use the condition "on each" which arrays have?

    I want to search and find an emptly "slot" if available, and it seems this condition would be it. But how? There is no info in the help files (or I am looking in the wrong place).
    Images attachées Images attachées

  2. #2
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    346
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    The 'on each' condition is for the regular 'for each' loop, i.e. If you have multiple array objects and you wanted to loop through each instance of array objects themself and scope them individually

    A regular fast loop should let you loop through an array, then you can stop the loop when it finds an empty slot. Something like this might be what you're after:

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    Tiny's Avatar
    Join Date
    Jul 2006
    Location
    Sweden
    Posts
    652
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by marbenx View Post
    The 'on each' condition is for the regular 'for each' loop, i.e. If you have multiple array objects and you wanted to loop through each instance of array objects themself and scope them individually

    A regular fast loop should let you loop through an array, then you can stop the loop when it finds an empty slot. Something like this might be what you're after:
    Thank you so much for explaining it. I appreciate it a lot.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    Tiny's Avatar
    Join Date
    Jul 2006
    Location
    Sweden
    Posts
    652
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have tested the loop solution but am still doing something wrong because I can not "catch" which loop the loop stopped at. I need the number so I can place object at the correct place and save to that slot in the array.

    Tried so far.
    1. Added it to my own project with the condition but could not retrieve the loop number.
    2. Made a new test app where I did it exactly as your example but still no go.
    3. Tested with no condition and then I would get the end loop number. So at least the loop is looping.

    Here is the test app. Load slots in the array with the button first to fill slots. Slot #3 is 0.
    Attached files Attached files

  5. #5
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jan 2015
    Location
    Australia
    Posts
    346
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Ah, sorry I assumed index 0 for the array and not index 1 - the loop would have been terminating early since it was trying to find a value that didn't exist and would return 0

    changing every instance of 'loopindex("check_empty")' to 'loopindex("check_empty")+1' should fix it

    Test_loop2.mfa

    (I had to remove the binary data for it to work on my computer since I didn't have the local file)

  6. #6
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export Module
    Tiny's Avatar
    Join Date
    Jul 2006
    Location
    Sweden
    Posts
    652
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by marbenx View Post
    Ah, sorry I assumed index 0 for the array and not index 1 - the loop would have been terminating early since it was trying to find a value that didn't exist and would return 0

    changing every instance of 'loopindex("check_empty")' to 'loopindex("check_empty")+1' should fix it

    Test_loop2.mfa

    (I had to remove the binary data for it to work on my computer since I didn't have the local file)
    Thank you! Works perfectly now.
    I should have been able to figure that one out myself but brain is not what it used to be.

Similar Threads

  1. "Has sample finished playing" during loop? (fixed)
    By Ambidextroid in forum Fusion 2.5
    Replies: 0
    Last Post: 19th November 2016, 01:47 AM
  2. Replies: 6
    Last Post: 18th August 2015, 02:23 AM
  3. question about "odd" ForEach loop behaviour
    By Jorum in forum Fusion 2.5
    Replies: 5
    Last Post: 12th August 2014, 10:25 PM
  4. "Caret" problems with the Rich Edit Object/Fast Loop Question
    By Gullyking in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 4th June 2012, 04:41 AM
  5. Start loop "loop" 'Alterable Value A' times
    By Dynamite in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 9th May 2009, 07:26 AM

Posting Permissions

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