Skip to main content
Inspiring
June 11, 2024
Answered

2 html5 javascript questions

  • June 11, 2024
  • 2 replies
  • 372 views

Hi guys, haven't used flash for many years but drawn back in lately with animate. So, may I ask 2 questions please?

1) So in a movie clip, I have a nested movie clip. From this inner clip, using code on a keyFrame, can I target objects in the parent movie above me? Specifically I want to change visibllity of a object up there.

2) I have a variable, X, that counts up or down depending on which button is pressed. I would like to be able to see the variable for troubleshooting. Can I create a text field that displays X when I test the page in a browser?

Thanks for any help, I'm shocked at how hard it is to find info on java in animate 😕😕

This topic has been closed for replies.
Correct answer kglad

yes, if the object exists when your code executes,

 

this.parent.instancename.visible 

 

2. yes, but it's easier to use your browser's developer console with console.log(yourvariable)

2 replies

nurba
Participating Frequently
June 11, 2024

Hi,

created sample file, you can get it from here

https://izde.kg/test/sample.fla

should be clear accessing parent variables and using inner movieclips

Inspiring
June 11, 2024

And thank you as well!

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
June 11, 2024

yes, if the object exists when your code executes,

 

this.parent.instancename.visible 

 

2. yes, but it's easier to use your browser's developer console with console.log(yourvariable)

Inspiring
June 11, 2024

Thanks so much!

kglad
Community Expert
Community Expert
June 11, 2024

you're welcome.