can i use MovieClip(parent).this[“string”] to call a variable from parent movieclip
i have a var target1HP, target2HP to target6HP in the parent movieclip. i want to call target1HP
for (counter = 1; counter<=6; counter++) {
if (MovieClip(parent).this["target"+counter+"HP"] == 0) {
//do statement//
}
}
is this possible or do i have to it manually like this?
if (MovieClip(parent).target1HP == 0) {
//do statement//
}
You can use this: