I know what the error 1061 means, but have no idea how to fix it. I’ve tried to correct it a million & one ways…
1061: Call to a possibly undefined method getChildByName through a reference with static type flash.display:DisplayObject.
I’m trying to target a button named ‘mcTargetButton’ (a SimpleButton) that’s inside a movie clip called ‘mcTargetParent’ from a movie clip called ‘mcCallFromThisClip’.
Both clips are on the main timeline. Note, I am using a document class… if I trace (this.parent) from ‘mcCallFromThisClip’ it prints the name of the document class.
trace(this.parent.getChildByName("mcTargetParent")); // traces 'mcTargetParent', yea!
Trying to go one step further to reach the nested button, Flash shows no love.
trace(this.parent.getChildByName("mcTargetParent").getChildByName("mcTargetButton")); // traces 1061 above
Apparently, no matter how I try to cast the button… Object, DisplayObjectContainer, Sprite, MovieClip - I will still get the 1061.
Any ideas, how hard should it be to reach a button from a different movie clip?