Thank you for giving this a try.
I am seeking a more general solution.
Your code sets, for example, the sprite instance variable by referring to the instance variable name "red" -- which is selected from the dropdown list.
I seek to use the key in the dictionary as the name of the property to set, so something like this
Function createObjectFlexibtly(Object_Type_Name, aDictionary)
Current_Object = System.Create ObjectByName(Object_Type_Name)
for each aKey in aDictionary
set Current_Object.aKey = aDictionary.current_value
In the pseudo code above, the name of the object property is the key in the dictionary -- and the name of the object created is a parameter: Object_Type_Name of a function call.
This makes this code very general -- and I don't have to write code for each object type that can be created and set.
Clearly, whoever calls this will know what properties and instance variables the named object (in Param1) has, so that the code doens't try to set something that doesn't exist.
Although, in javascript -- setting an object property that doesn't exist might actually create it -- although, this might not be aligned with how C3 manages instance variables of sprites.
i hope i explained that understandably,
Dan