Hi,
Alright, I have been trying for over 10 hours to fix this problem.
My setup is as follows.
On the Main Timeline, I have 2 layers. One has a mc instance called “Main” and the other has a mc instance “CMS”. The first frame inside the “Main” mc has a trace (“Frame 1”). Inside the CMS mc , I have 15 frames and on frame 15 I have the following code.
- stop();
- var temp:MovieClip=new MovieClip();
- temp=this.parent[“Main”];
- trace(temp.name);
- temp.gotoAndStop(1);
What I’m trying to achieve is , I want to gotoAndPlay frame 1 of the Main mc from frame 15 of the CMS mc.
Unfortunately, I’m not being able to.
If you look at the code above. Line 4, traces out “Main” which I believe means that the temp points to the “Main” mc instance on the main timeline. But still temp.gotoAndStop(1) doesn’t work. There isn’t any error message. It just doesn’t navigate to frame 1 of th Main timeline and thus I don’t see “Frame1” traced twice (due to the trace on the 1st frame of Main).
Another thing is happening, If I add a dynamic text field to the “Main” mc and try to change my code above to do
- stop();
- var temp:MovieClip=new MovieClip();
- temp=this.parent[“Main”];
- temp.testTextField.visible=false;
The text field on the Main mc disappears which again proves that the variable “temp” is pointing to the correct MC and the referencing seem alright.
But for some weird UNKNOWN reason the gotoAndPlay function for temp is not working.
Please help!! I’m absolutely saturated with this problem. I am attaching my FLA with this post. It’s really simple.
Thanks a bunch! :sen:
Sameer