A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [RESOLVED] Referencing a frame on a child from the parent?

  1. #1
    Member
    Join Date
    Oct 2009
    Posts
    33

    resolved [RESOLVED] Referencing a frame on a child from the parent?

    I have a frame that I want to display but the function that calls it exists on the parent. How do I call a frame that exists within a child movieclip from its parent?
    Here is my code. It is basically for a restart button.

    Here is the parent function.

    Code:
    function restart(event:Event)
    {
    	gotoAndStop("pwrframe");
    	pwrcomp.SetPwrcomp(false);
    	sifdcomp.SetSfidcomp(false);
    	answercomp.SetAnswercomp(false);
    	readypwroff.SetPwroff(false);
    	trainingcomp.SetTrainingcomp(false);
    	numsend.SetNumsend(false);
    }
    and here is the frame I need to call from the child movieclip. I bolded and increased the size of the line of code for the frame I need to reference.

    Code:
    function pwrbtn(event:Event)
    {
    	if(trainingcomp.GetTrainingcomp()==true)
    	{
    		
    	}
    	
    	else if(pwrcomp.GetPwrcomp()==false)
    	{		
    		gotoAndStop("scrnon");		
    		MovieClip(parent).pwrframedone();
    		pwrcomp.SetPwrcomp(true);
    	}
    	//this statement kills the powerbutton until the end.
    	else if(readypwroff.GetPwroff()==true)
    	{
    		gotoAndStop("scrnoff");			
    		MovieClip(parent).offframedone();
    	}	
    }
    Thanks in advance. Btw if I need to post the entire code just leave a message. I would be glad to do so if it is necessary.

  2. #2
    ___________________
    Join Date
    May 2004
    Posts
    3,174
    PHP Code:
    instanceNameOfThatChild.gotoAndStop("scrnoff"); 

  3. #3
    Member
    Join Date
    Oct 2009
    Posts
    33
    That fixed it. Turns out I didn't have an instance name for that movieclip. Thanks for the help and Happy Thanksgiving!

  4. #4
    ___________________
    Join Date
    May 2004
    Posts
    3,174

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center