Accessing a Movie Clip in a parent Scene.
Setup:
*Scene 1:
- MovieClip1
*Inside MovieClip1:
- Actions:
stop();
next_btn.addEventListener(MouseEvent.CLICK, onNextButtonClicked);
previous_btn.addEventListener(MouseEvent.CLICK, onPreviousButtonClicked);
function onNextButtonClicked(e:MouseEvent):void {
if (currentFrame == totalFrames) {
gotoAndStop(1);
} else {
nextFrame();
}
}
function onPreviousButtonClicked(e:MouseEvent):void {
if (currentFrame == 1) {
gotoAndStop(totalFrames);
} else {
prevFrame();
}
}
(THIS CODE IS FOR MY NEXT AND PREV BUTTON TO CYCLE THROUGH MY PIECES OF WORK)
Then I have...
- Pieces of work Layer:
This includes each piece on a single frame, with a label name. (5 total frames on this layer)
Then I have....
- Next and Prev buttons on a layer
And Finally....
- The last layer in this scene has a background frame.
***** Now inside each frame containing each piece of work there is:
1st Layer = Actions
Containing this code: stop();
2nd Layer = This is the movie Clip that Fades my pieces of work in.
****** Inside this movie Clip of the piece of work fading in will contain:
1st Layer = Actions
Containing this code:
stop();
function openLabel(event:MouseEvent):void {
switch (event.currentTarget) {
case identity_cplogo_btn :
gotoAndPlay("cplogo_lv");
break;
}
}
identity_cplogo_btn.addEventListener(MouseEvent.CLICK, openLabel);
2nd Layer = 1st frame blank, then frame 2-10 contains a movieclip with a label of cplogo_lv. This movie clip is the clip that has a large view of the image popup and darken the background. (Like a lightbox effect)
3rd layer = the logo which is a BUTTON. THis is located on the first frame and is called "identity_cplogo_btn." So when this is clicked it opens the large view.
*****Now....
When I click inside the movieclip that is the lightbox effect and go inside of it there is.....
1st Layer = Actions with the code of:
stop();
function openLabel(event:MouseEvent):void {
switch (event.currentTarget) {
case lv_close_btn :
gotoAndPlay("return");
}
}
lv_close_btn.addEventListener(MouseEvent.CLICK, openLabel);
****After the actions keyframe, which is locate on frame 10, there is a label called "return" from frame 11-24. It is a blank label meaning there is nothing on it but the label name.
2nd Layer = the "Close" button which appears when the large view is opened and is located on frame 10 right underneath the action code.
3rd Layer = This contains the Large view of the logo, which I have made a movie clip for making it fade in then I paste reverse frames after right underneath the "return" label making it fade out.
4th Layer = Contains the Dark background that pops up which also fades in then underneath the "return" label it has its' reverse frames which are making it fade out.
SO... I have the code making it so that when the "Close" button is clicked it is going to the "return" label which is making everything fade out.
***************************** NOW WHAT I NEED TO FIGURE OUT *************************************
I need to know the code to be in the last movie clip I just explained and when I click the close button and it plays everything underneath the "return" label, THEN i need it to access the movie clip with the logo fading in so that it appears to go back to BEFORE clicking on the logo and expanding the view.
I understand that this code will be places right after the "return" label so that when the return phase plays it will then play the code making it go to this movie clip then it will stop.
I have tried
MovieClip(parent.parent).gotoAndPlay("return_2");
stop();