0
votes

I have the following Flash structure.

Main Timeline
---test_menu (Movie Clip)
------test_menu_sub (Movie Clip)
---------submenu_item (Button) 

On Main Timeline (2nd frame), I added this code:

test_menu.test_menu_sub.submenu_item.onPress = function () {
     trace("clicked");
}

However, this doesn't work. How do you access a child element or movie clip in actionscript 2? Please see the following files for reference.

1

1 Answers

1
votes

this is known issue, especially when creating As2 banners. In As2 you can not have a button event like onPress work on a movie clip as well as for a movie clip nested within it.

There is very good explanation about buttons in As2 here: http://www.senocular.com/flash/tutorials/buttoncapturing/

However I decided to solve this fully. Here is your modified source file using functionality from the article above: http://www.baruckis.com/my-files/stackoverflow/11542639/test.fla

I hope it will help! ;)