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();
And giving the movieclip that has the logo fading in the "return_2" label name. THis allows it to go to that movie clip, however, it doesnt play it is just blank on the screen.
I also have tried accessing the movie clip after giving it an instance name, but it was doing the same thing.
Help PLEASE!

I actually tried a post earlier that was simplified, but I think the setup of scenes might be important....anyways, here it is.
Setup:
Scene 1 > MovieClip1 > MovieClip2 > MovieClip3 > MovieClip4
Explanation:
I am in MovieClip4, in which I have a "Close_btn" that when clicked, it takes you to label "return" (still inside MovieClip4), which then plays the movie clips in the layers below label "return." What I want it to do is....Once label "return" plays, I need the code to make it go into "MovieClip2" and play a movie clip with the "Instance" Name of "Logo_1."
I have tried this by setting a label name above the movie clip and referencing the label, however, it does access that movie clip, but it doesnt play it...It is just blank.
Hope this is understandable.

Similar Messages

  • How to access dynamic movie clips in a loaded swf

    Hello,
    I have a main movie file that loads a swf through loadclip.
    There are several dynamic movie clips in the library of the
    loaded swf (all set to export in first frame).
    I'm trying to create a popup window (using the Window
    component) by using code in the main movie to popup content that is
    in a dynamic movie clip within the swf loaded by loadclip.
    So far, I can create the popup without any problem as long as
    the contentPath refers to a linkage identifier of a library item in
    the main movie, but it won't work for a library item in the loaded
    movie. Is there a way to make this work? Is there a special way to
    reference library items in loaded movies?
    Here's my code to create the window:
    myWin = mx.managers.PopUpManager.createPopUp(this,
    mx.containers.Window, true, {title:mytitle, contentPath:myref,
    closeButton:true});
    where myref is a string containing the linkage identifier for
    the library item within the loaded swf.
    Thanks in advance for any assistance,
    Julia

    I have found out that I can access a dynamic mc from the
    loaded library (using attachMovie), but cannot use that same
    dynamic mc as the contentpath for a popup window.
    Any ideas why?

  • How do I navigate from a movie clip back to a scene?

    I am just starting with Flash. I am creating my own website
    within a single scene built up of movie clips. Within Scene1,
    frame1, I have a movie clip that is the animated introduction to my
    site. i have attempted to add a gotoAndStop command to the last
    frame within the movie clip in order for the scene to proceed to
    frame2.
    gotoAndStop("Scene1",2);
    Can anyone explain why this does not work?

    ragtoes wrote:
    > I am just starting with Flash. I am creating my own
    website within a single
    > scene built up of movie clips. Within Scene1, frame1, I
    have a movie clip that
    > is the animated introduction to my site. i have
    attempted to add a gotoAndStop
    > command to the last frame within the movie clip in order
    for the scene to
    > proceed to frame2.
    >
    > gotoAndStop("Scene1",2);
    >
    > Can anyone explain why this does not work?
    Give a frame some label name and use
    gotoAndStop("labelNameHere");
    Do not use scene names. Just labels...
    Best Regards
    Urami
    "Never play Leap-Frog with a Unicorn."
    <urami>
    If you want to mail me - DO NOT LAUGH AT MY ADDRESS
    </urami>

  • Trouble Copying and pasting a movie clip from another flash scene

    Hello,
    I have been trying to copy a movie clip from the library of one flash and paste it into the library of another.  But when I do this, it always gives me, "One or more library items already exist in the document.
    I have tried finding and renaming those items, renaming the existing movie clip, and even changing it into a graphic instead.  Still it always replaces these certain movie clips in my main flash file.
    I even tried the following:
    Creating a new movie clip in the new file.  Then going into the movie clip of the other file I wish to copy over, and trying to copy its frames and put it into the new movie clip i created in the main file.  Even then, it says I'm replacing library items!
    Can someone help me?
    Thanks

    The easiest way to be sure you are renaming everything is to probably to copy the movieclip into a new empty file's library and then rename each symbol in there.  Unless I am missing something, when you do that, each isolatable symbol inside that movieclip will appear as a separate symbol in the library, making it easier to be sure you have renamed them all.

  • Move child movie clip from one parent object to another

    Hi everyone,
    I am somewhat new to AS3, and I'm having a hard time working out the most appropriate way to move a child movieclip between parent objects.
    I'm creating a board-game type game wherein I've dynamically created an array of 'Square' movieclips, with no visual elements, which are arranged in a 10x10 rectangle on the stage. I then dynamically add the appropriate types of piece movieclips to the various squares with the addChild() method. In general, a square should only have one child piece at a time.
    All of this works well for setting up the play area, but now I'm having an issue with moving a piece from one square to another. I want to have the user click a square with a piece on it, then click the destination square to move the piece. I have the logic for determining where a user can move any given piece to, but I don't know how to actually move the piece.
    The pieces are all different class objects that extend both a base class I call Piece as well as the MovieClip class. The main issue is that when dynamically adding the various pieces to the squares, I don't provide them a unique name to access them later. I don't bother with unique names because I have no way of knowing which piece instance will be in a given square, so using getChildByName(name:String) isn't very useful.
    So I can think of two routes that I can take: Making a getter/setter for the Square class that manages a private Piece property (as well as the adding and removing of the child piece to/from the parent square), or using getChildAt(index:int) to try to access the child piece.
    I want to go with the first route as it seems to be the most maintainable to me. My problem is that I can't work out how to manage empty squares in this scenario. My instinct is to null to private _piece property of one square once I've moved the child piece instance to another square... but I'm fairly certain that the private property is a reference type, and nulling it out will null the actual piece object even after it's changed parents.
    I'm sorry for the long description. I'm hoping that my lack of experience with as3 it what's causing my trouble, and that someone more well versed will know of the best way to handle this. Maybe I'm overthinking everything.
    If something isn't clear, please feel free to ask me for clarification. I would appeciate any help that anyone may be able to offer.
    Thanks!
    - Scott

    for a square with a child, you can use:
    whateversquare.getChildAt(0);  // to reference whateversquare's only child.  although, if there are graphics in whateversquare, you may need to use getChildAt(1)
    or, if you want to use a square class getter/setter, what's the problem?  an empty square will return null.

  • Sending a movie clip to the parent screen

    I am building a flower container builder using screens.
    Is there script that will allow a _mc on a child screen to
    move to area on the parent screen?
    using a drag and drop mehtod
    Thanks

    oops I am not sure how that posted that many times

  • Problems coding a button within a movie clip to navigate scenes

    Hello there! I've got another probably noobish question to ask about CS6.
    My goal is very similar to the one mentioned in this previously discussed forum question: http://forums.adobe.com/message/837995#837995 and also in this question http://forums.adobe.com/message/4172919#4172919
    I am attempting to make a button inside a movie clip in my first scene go when clicked to the first frame of my second scene. I named the button's instance menu_button_1 and I believe Scene 1 and Scene 2 are the names of the scenes. (If they should have special names or instance names, I did not see where to type them.) Because of the similarities, I attempted to follow the suggestions on those pages. However I probably did some small thing wrong, (Or heck, maybe a huge thing.) which I what I'd like help with to find.
    stop();
    myButton.addEventListener(MouseEvent.CLICK, clickHandler);
    function clickHandler(evt:MouseEvent):void {
    gotoAndStop(1, "Scene 1");
    This seemed to be what was suggested to enter. I attempted to modify it to work for me as well. This is what I typed for the button's action.
    menu_button_1.addEventListener(MouseEvent.CLICK, clickHandler);
    function clickHandler(evt:MouseEvent):void {
    gotoAndPlay(1, "Scene 2");
    (I removed the stop function because I have music looping in the movie clip that I want to play until the mouse is clicked.) (Also, I picked gotoandplay because I wanted scene 2 to start playing immediately when clicked rather than stopping.)
    I tried variations, including "2" instead of "scene 2" and whatnot. I also tried linking it to differnet places just to see if that would work. It seems like it could link if I only asked for a frame within the movie clip itself, but it couldn't go to any other frames in scene 1 or scene 2. When I attempt, this message is displayed in the output:
    ArgumentError: Error #2108: Scene 2 was not found.
        at flash.display::MovieClip/gotoAndPlay()
        at interactivestgermant_fla::menu_1/clickHandler()
    It seems it cannot find my Scene 2. (It also cannot seem to find Scene 1 when I prompt it to do that.) I'm afraid I'm not sure of what I've entered incorrectly, though I'd imagine it involves how I typed the scene navigation. Should it have an instance name or something? I'd very muchappreciate a push in the right direction. If you need any more info I'll be happy to provide it. Thanks for the help! I very much appreciate it.

    I bet you're absolutely right. However I am not sure how I am misnaming it, as to my ametuer eyes, it seems to be entered properly into the properties box? It does show up as "menu" written in white over the keyframes and also in the properties slot. I can include some images here to help out in correcting me.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-1-395704638   This image shows my movie clip. This seems to be the problem it's having, identifying "menu." Did I do that incorrectly? It looks to be in order.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-2-395704633 This is inside of the movie clip named menu. You can see I did the same to name the button menu_button_1.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-3-395704627   This shows the action I gave to menu_button_1 in which I attempt to have it naviagte to Scene 1 frame 493.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-4-395704623  This shows where I'd like the button to go to. (It is hard to tell if that's frame 493 or 492. I figured that it should be ok either way and if this frame is 492 then it's easily changed once I get the darn thing working in general) (Also, I named the layer "peanuts." I tired entering the name "peanuts" as well but it didn't seem to work either, so I figured "493" is easier since I know that you can go to a specific frame by doing gotoandplay("scene 1" , #) and I'm not sure if it requires any additional stuff to go to a name.
    http://girlfoxgirl.deviantart.com/art/Flash-Help-5-395704687    These are the errors I get. I totally agree with you- It seems very much to be an issue of getting it to recognize the "menu." However I am unsure where I named something wrong. Is this enough info to help you perhaps point out where that is?

  • Access Movie clip inside Button

    Is there a way to access a movie clip inside a buttion?
    I have a bunch of images in a movie clip, and I want to have the same mc to change frames in different button symbols. But when try to talk to it myButton.myMovieClip.gotoAndStop(3);
    It gives me and error.
    1119: Access of possibly undefined property myMovieClip through a reference with static type flash.display:SimpleButton.

    no.
    use a movieclip button.

  • Trying to access a specific movie clip with a string

    Ok, what I am trying to do is create as many movie clips as I
    need and then access those movie clips using string values. These
    string values are stored in an array and coincide with a given
    movie clips instance name. Check out the following code:
    I think my problem is that Flash is trying to call movie clip
    methods on a string instance. I'm not sure how to type cast in
    Flash, or even if it is possible, but how would I access the
    strings as movie clips?

    DuhChamp,
    > I think my problem is that Flash is trying to call movie
    > clip methods on a string instance.
    Bingo.
    > I'm not sure how to type cast in Flash, or even if it is
    > possible, but how would I access the strings as movie
    > clips?
    Use eval() or the array access operator, []. Details here
    http://www.quip.net/blog/2006/flash/actionscript-20/reference-objects-dynamically
    David
    stiller (at) quip (dot) net
    Dev essays:
    http://www.quip.net/blog/
    "Luck is the residue of good design."

  • Buttons in movie clip won't bring up scenes

    I've created a movie clip within my main scene.
    I have 6 buttons in that clip. I would like these buttons to
    call up the appropriate scenes but it isn't. I don't know whether I
    cannot have buttons in movie clips call up new scenes or if my
    actions script is simply wrong.
    Here are some of the actions I've tried to upload the scene
    or swf files:
    thanks.
    on (release) {
    _root.gotoAndPlay("instance name");
    ----Also, named 1st frame of scenes with matching instance.
    on (release) {
    _root.gotoAndPlay("scene name");
    on (release) {
    gotoAndPlay("scenename",1);
    on (release){
    uploadMovie ("name.swf",1);
    }

    use frame labels only and use the goto methods (like your
    first 2 goto statements) and not the goto functions (like your last
    2 goto statements).
    also, there is no uploadMovie() method in actionscript. use
    loadMovieNum() if you want to load name.swf into _level1.

  • The .blueMultiplier (movie clip color property) does not take new value..?

    It seems I can not assign a new value to the .blueMultiplier (a movie clip color property) using AS3 ????!!!
    I have a basic movie clip 'mymc' in my scene, and this AS3 code:
    trace (mymci.transform.colorTransform.blueMultiplier);
    mymc.transform.colorTransform.blueMultiplier = 0;
    trace (mymc.transform.colorTransform.blueMultiplier);
    Values that are returned:
    1
    1
    What am I missing?
    Thanks.

    you can't assign transform/colorTransform properties directly.  you update a transform/colorTransform instance and assign your object's transform/colorTransofrm instance to be the updated transform/colorTransform instance:
    var ct:ColorTransform = mymc.transform.colorTransform;
    ct.blueMultiplier = 0;
    mymc.transform.colorTransform = ct;

  • Multiple Movie clips and rollovers

    Hi, I need some help. I am putting together a flash file with
    3 movieclips. I have three movie clips I made - one for each of the
    3 big circles. When they roll over the other circles are supposed
    to disappear under the circle that they have their mouse on. I
    placed all 3 movie clips on the first scene, but when they roll
    over one of the circles the other circle movie clips stay there
    while the other one runs on the mouse over. I need the other ones
    to disappear. You can view what I have so far:
    http://www.feeco.com/Portals/0/encap.swf.
    If you need to see my fla file I can email it to you. Thanks!
    Stephanie

    use:
    stop();
    yourplaybutton.addEventListener(MouseEvent.CLICK,playF);   // replace yourplaybutton with the name of your play button.
    function playF(e:MouseEvent):void{
    play();
    /* Click to Go to Frame and Play
    Clicking on the specified symbol instance moves the playhead to the specified frame in the timeline and continues playback from that frame.
    Can be used on the main timeline or on movie clip timelines.
    Instructions:
    1. Replace the number 5 in the code below with the frame number you would like the playhead to move to when the symbol instance is clicked.
    button_19.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndPlayFromFrame_15);
    function fl_ClickToGoToAndPlayFromFrame_15(event:MouseEvent):void
        gotoAndPlay(2);
    /* Click to Go to Next Frame and Stop
    Clicking on the specified symbol instance moves the playhead to the next frame and stops the movie.
    button_20.addEventListener(MouseEvent.CLICK, fl_ClickToGoToNextFrame_6);
    function fl_ClickToGoToNextFrame_6(event:MouseEvent):void
        nextFrame();
    I also have added a keyframe to the end of my actions to stop(); this does not appear here with this code but on a separte screen but under the same actions folder the stop works just as I want to the last movie clip stops at the end
    Just can not figure out how to get the play to not start over from begining but to continue.

  • *Class Project - Please help:  Why does my movie clip keep playing over and over?

    I am desperate for help on this one as its my Final Flash
    class project and I just can't get my scenes/movie clips to play in
    the order I want them to.
    I have Scene 1 (movie clip 1) that plays and then Scene 2
    (movie clip 2) plays. The problem is that Scene 2 (or movie clip 2)
    repeats itself over and over again. I can't get it to go back to
    Scene 1 (movie clip 1) to play that again.
    I want it go to to this Scene 1 and actually start at a
    certain frame to continue on with the story.
    I have named my movie clip instances.
    What am I doing wrong? I went into movie clip 2, into
    actions, and movie clip control, and I don't really see a way to
    tell it to go back and play movie clip 1. Trying to see how to
    refer back to the instance name of the movie clip and get it to
    play.
    Ideas? Please please? I would be forever greatful.
    Angie

    quote:
    Originally posted by:
    computerkitten
    I wonder if I should just take that movie clip out of the
    scene completely.... and not have the second scene at all. Maybe I
    should just have 1 scene and these 2 movie clips. Wonder if that
    would work better?
    As Nickels55 said, above, scenes add unnecessary complexity.
    So the answer to this is: YES. Scenes are awkward in Flash. Never
    use them in any final project. Put everything on a single timeline
    in a single scene, and you will have much better control of the
    project.

  • Transform on movie clips

    I am loading a bunch of movie clips dynamically. Right now,
    the movie clips undergo a color transform for the onRelease()
    action. Now, I want to be able to transform a group of movie clips
    on the onRelease() action of a single movieclip.
    What would be the recommendation to accomplish this task? I'm
    sure there are many ways to do it, but I don't know where to start.
    I tried to put the movie clips into an array to then access the
    movie clips. I can get the properties of the movieclips that I want
    to transform, but I cannot transform them.

    This is the code that I use:
    for (var j:Number = 0; j<quad.length; j++) {
    var bu_mc:MovieClip = quad[j];
    bu_mc.select();
    trace("xPos: "+bu_mc._x+" building: "+bu_mc._name);
    The correct _x and _name are displayed, but nothing happens
    to the movieclip.
    select() is a function that I've defined. It works when
    called by the movieclip itself, but is not working when called by a
    different movieclip.

  • Accessing a scene from a Movie Clip

    Hi, I'm using Flash CS3 and am writing action script inside
    of one of my movie elements and I want to access an element that's
    on my main scene, "Home". How can I reference my main form that
    hosts the element video form my movie clip?

    if "Home" is on the main timeline you can reference it from
    any timeline using:

Maybe you are looking for