How to concatenate a "name.target" with string?
Hello, how are you?
I have this issue:
I have a function -let's call this function "dad", that receives a parameter -let's call it "parameter". Inside dad function, I need to concatenate parameter with a string, to call a function outside function dad. Example:
function dad (parameter) {
parameter.target.onPress = trace (parameter.target + "_animation") --> this returns "_level0.button1_animation" which is the same as "button1_animation" right?
but when i use it to call a function outside it doesnt work:
parameter.target.onPress = parameter.target + "_animation" ; --> doesn't work.
parameter.target.onPress = [parameter.target + "_animation"] ; --> doesn't work.
but this does work:
parameter.target.onPress = button1_animation
}
function button1_animation {
here i have a tween
}
All i wanna do, is concatenate parameter.target with a string, to call a function outside! is it possible ?
thanks in advance
