User Tag List

Results 1 to 2 of 2

Thread: Treating a variable as an object name inside a calculator expression

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

    Question Treating a variable as an object name inside a calculator expression

    Hello

    I am trying to use a Global (or active, doesn't matter) Value to determine which object is called in an expression. Here is an example of what I want to do :

    I have 9 objects named "1" to "9". This is an example of what I want to do :
    Code:
    GetRed(RGBCoef("anchor"))
    Anchor is the value which can range from 1 to 9, given the right conditions. Now, I know that this expression will ask the application to search for an object named "anchor", which doesn't exist, so I tried a few silly combinations like Str$(Val(anchor)) and even desperately tried Str$("""+(Val(anchor))+""") but you can guess the result.

    What I want to do here is use the value of this "anchor" value and make the calculator target the object with this name and extract few values from it.


    Thank you

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Unfortunately you can't,
    but you can work around this in many ways,
    I'm going to suggest two

    prerequisite for both versions:
    apply same qualifier to all of your objects


    longer version

    (on triggering condition)
    >>> start loop for each (qualifier)

    on each one of "qualifier"
    + (compare two general values) OName$( "Group.Good" ) = anchor
    >>> set value to GetRed(RGBCoef("qualifier"))

    NOTE: make sure you have latest builds, OName$ function has been added very recently


    shorter version


    prerequisite:
    enter your objects name in alt string "my_name" of your objects

    (on triggering condition)
    + My_name( "Group.Good" ) = anchor
    >>> set value to GetRed(RGBCoef("qualifier"))

    NOTE: make sure you use unique names for each object

Similar Threads

  1. Replies: 2
    Last Post: 24th January 2017, 01:41 AM
  2. Treating actives as individuals
    By natrey in forum Fusion 2.5
    Replies: 1
    Last Post: 14th December 2016, 06:13 PM
  3. Exponential in expression calculator
    By Ahiru in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 6th February 2013, 09:24 PM
  4. Variable Strings inside variables
    By DisneyBoy in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 21st December 2009, 08:03 AM
  5. Help with SDK-using sqrt() inside expression??????
    By jayklik in forum Extension Development
    Replies: 11
    Last Post: 10th September 2006, 04:53 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
  •