How to target a Class inside symbol with JS?


(Stephen G) #1

Hi I know this is a relatively easy task but cant work out the correct code. Can anyone help?? Here is my current code snippet. I am trying to target the feedback Class inside the correctAnsModal symbol. The only possible problematic part to the function is that the symbol is inside a different timeline which plays before this code fires.

Should I be targeting the timeline first then the Class then the child symbol?

Thanks in advance, Stephen.

	var scroeTextContainer  =  hypeDocument.getSymbolInstanceById('correctAnsModal');
	
	var scroeText  = scroeTextContainer.getElementsByClassName('feedbackText');
	
	scroeText.innerHTML = quizScore + ' out of ' + totalQuestionsVar + ' correct ';

#2

You can use this function to target a class within a symbol.


(Stephen G) #3

cheers @Daniel appreciate the help. Stephen