User Tag List

Results 1 to 3 of 3

Thread: Extracting value from an object based on the numbers in their name

  1. #1
    Clicker Multimedia Fusion 2
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Aug 2013
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Extracting value from an object based on the numbers in their name

    Howdy

    I'm trying to run a fast loop 81 times and, during each loop, set a global value (loops index - 1 to 81) to an alterable value of active objects which are all named "field 1" to "field 81".

    This is the first half : Chose value : LoopIndex("name of the loop")
    What I would like to do not, in the expression calculator is select a value of an object that has the current loop index in it's name : value1("field" + "LoopIndex(name of the loop").

    I tried using the Str$ in front of the bracket :
    Str$("field" + "LoopIndex(name of the loop")
    and, just in case, in front of all brackets :
    Str$("field"+Str$(LoopIndex("name of the loop"))
    , but it just doesn't seem to work that way.

    Could anyone help me out here?

    The result should be : Set "Value 1" to value1("field 1"), Set "Value 2" to value2("field 2") etc. until the final loop (81 in this case) ends.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,367
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    I'm afraid you are doing the classic mistake of trying to do something impossible, and keep gluing yourself in a corner, instead of finding other solutions.
    You can't call an object by an expression in Fusion 2.5. I am sure you will be able to find an alternative solution once you let go of your current approach. The most straightforward method would be to run a For Each loop on all the objects. If they need to be different objects, you could give them all the same qualifier and run a For Each loop on the qualifier.

  3. #3
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    825
    Mentioned
    19 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Filip View Post
    Howdy

    I'm trying to run a fast loop 81 times and, during each loop, set a global value (loops index - 1 to 81) to an alterable value of active objects which are all named "field 1" to "field 81".

    This is the first half : Chose value : LoopIndex("name of the loop")
    What I would like to do not, in the expression calculator is select a value of an object that has the current loop index in it's name : value1("field" + "LoopIndex(name of the loop").

    I tried using the Str$ in front of the bracket :
    Str$("field" + "LoopIndex(name of the loop")
    and, just in case, in front of all brackets :
    Str$("field"+Str$(LoopIndex("name of the loop"))
    , but it just doesn't seem to work that way.

    Could anyone help me out here?

    The result should be : Set "Value 1" to value1("field 1"), Set "Value 2" to value2("field 2") etc. until the final loop (81 in this case) ends.
    Not sure what Popcorn was talking about, but you can give each object an ID value and reference this instead of the object name: globalexample.mfa

Similar Threads

  1. Replies: 3
    Last Post: 18th October 2016, 10:09 AM
  2. Possibility of doing Math calculations based on numbers input like excel?
    By Worick in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th November 2013, 04:29 AM
  3. Extracting an MFA?
    By Eutherin in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 2nd February 2009, 05:27 AM
  4. Extracting a line from Rich Edit Object or Edit Ob
    By Tiles in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 8th March 2008, 05:16 PM
  5. Binary Object - Extracting files help
    By Paul_Boland in forum Multimedia Fusion 2 - Technical Support
    Replies: 16
    Last Post: 7th June 2007, 05:35 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
  •