5 Replies Latest reply on Nov 11, 2011 8:49 AM by Ned Murphy

    Access to movie clip from an other MC AC2

    Khalil SBZ Level 1

      Hi,

       

      I wonder how can i find the place or the target of a movie clip i working in.

       

      So, i have a movie clip on  frame 50 of the root flash;=> On that movie clip 'player' i have a mediaDisplay with an instance name 'video' and in the some movie clip i have another mc 'play'

       

       

      so, how can i access to instance video from mc play.

       

      I tried : 

       

      var = '../.video'

       

      and

       

      var = _root.video.player.video ;

       

      Nothing!!

       

      Now am searching for a command or a way to know directly the place of the MC i working in (i tried " trce ( getChildByName() ) ; "  not working for me )

       

      Help me please.

       

      Sorry for my English

        • 1. Re: Access to movie clip from an other MC AC2
          Ned Murphy Adobe Community Professional & MVP

          You seem to be mixing different versions of Actionscript in your posting, so be careful to stick with just one in your design.  You need to exoplain more precisely how the different objects exist relative to each other in order to get any help determining how to target one from the other.

           

          So far you seem to say you have a movieclip with an nstance name "player" on frame 50 that conatins an object named "video".  Then you say in "some" movieclip you have a movieclip named "play".  The word that makes things very uncertain there is "some".  So if you can clarify that you will be in a better position to get help with it.

           

          One important thing to realize is that whatever code you try to use you need to be in the frame(s) where the player exists in order to be able to target it.

          1 person found this helpful
          • 2. Re: Access to movie clip from an other MC AC2
            Khalil SBZ Level 1

            I have :

             

             

            Main

                |_instance1

                |_instance2

                       |_instance2.1

                       |_instance2.2

                |_instance3

             

            In AS2 when we want to call instance1 in Main Flash we write : _root.instance1

             

            So how can we call instance2 from instance2.1 ?

             

            Thanks

            • 3. Re: Access to movie clip from an other MC AC2
              Ned Murphy Adobe Community Professional & MVP

              Many people use the _root reference unnecessarily, such as what you just now described.  To call instance1 in the Main timeline you do not need to use _root, just instance1 will suffice since it is a child of the Main timeline. 

               

              You can use _parent to to target instance 2 from inside instance2.1, or you can use _root.instance2

              1 person found this helpful
              • 4. Re: Access to movie clip from an other MC AC2
                Khalil SBZ Level 1

                Good,

                 

                 

                Thank you for answer, i know it is a bit complicate, that is why i prefer to ask in two times.

                 

                Now we have _parent (perfect), i have instance2 duplicated many time in many Frames, so, how can i go to an exact instance in correct Frame, by using AS2,

                 

                I don’t know exactly maybe we have an action that we can call Frame, for example _parent.frame20.instance2 or I don’t know …!

                 


                 

                Main

                 

                Frame1

                        |_instance1

                Frame2

                        |_instance2

                                |_instance2.1

                                |_instance2.2

                Frame3

                         |_instance2

                                |_instance2.1

                                |_instance2.2

                Frame4

                         |_instance2

                                |_instance2.1

                                |_instance2.2

                Frame5

                         |_instance2

                                |_instance2.1

                                |_instance2.2

                 

                 

                 

                         |_instance3

                 

                I need that Instance2.1 of Frame5 call Instance2 of Frame2

                 

                So any help ?


                 

                And thank you Ned Murphy.

                • 5. Re: Access to movie clip from an other MC AC2
                  Ned Murphy Adobe Community Professional & MVP

                  You cannot target an object that exists in a different frame than the one you are currently in.  So if instance2 in frame 2 is not the same instance2 in frame 5, then you cannot target it from frame 5.  But if it is the same instance (since you show it existing in all frame between, inclusively, it might be), you probably can target instance2 in frame 5 and then traqvel to frame 2 and see that instance2 is whatever you told it to do/be in frame 5.