i have a movieclip within a movieclip within a movieclip… i want to simply tell flash to play that movieclip once i click on it… however, i get an error saying “1120: Access of undefined property tl_character” when i try to publish the file…
this is my code on the main timeline:
// add the "tl_holder" movieclip inside "stageholder" movieclip
var tl_holder:MovieClip;
tl_holder = new CharacterHolder();
stageholder.addChild(tl_holder);
tl_holder.x = 116
tl_holder.y = 69
// timer countdown for adding character
var tl_timer:Timer = new Timer(3000, 1);
tl_timer.addEventListener(TimerEvent.TIMER, ac_TL);
tl_timer.start();
// add character
function ac_TL(event:TimerEvent):void
{
var tl_character = new police1();
tl_holder.addChild(tl_character);
tl_character.addEventListener(MouseEvent.MOUSE_DOWN, handleTarget);
}
function handleTarget(event:MouseEvent):void
{
tl_character.gotoAndPlay(2);
trace("hit successful");
}
i know there might be a solution by using a custom class for “police1” but i’d like to know how i could play that movieclip using a function thats written on the main timeline…