Skip to main content
Inspiring
Jun 11, 2024 12:38 AM UTC
Answered

2 html5 javascript questions

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 is closed to new replies. Start a new post to keep the conversation going.
kglad
kgladCorrect answer
Community Expert
Jun 11, 2024 12:52 AM UTC

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)

5 replies

nurba
Participating Frequently
Jun 11, 2024 4:11 AM UTC

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

Translate
Inspiring
Jun 11, 2024 6:45 PM UTC

And thank you as well!

Translate
kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
Jun 11, 2024 12:52 AM UTC

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)

Translate
Inspiring
Jun 11, 2024 6:44 PM UTC

Thanks so much!

Translate
kglad
Community Expert
Community Expert
Jun 11, 2024 10:07 PM UTC

you're welcome.

Translate