dcsimg
A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: how to control one movieclip from another?

  1. #1
    Senior Member
    Join Date
    Aug 2000
    Location
    Central PA
    Posts
    120

    how to control one movieclip from another?

    I have 2 movieclips on the stage. When i get to a certain frame in one movieclip, I want it to tell the other movieclip to stop. How do I do this? Let's call them mc_1 and mc_2. On frame 10 of mc_1 I was trying to call:

    MovieClip(this.parent.mc_2).stop();

    but I get an error that says "1119: Access of possibly undefined property mc_2 through a reference with static type flash.displayisplayObjectContainer."

    Both movieclips are on the stage in the same frame. Can someone help? This should be simple but I don't know what I'm doing wrong.
    Last edited by pzb4; 07-08-2008 at 08:58 AM.
    ?:-{>

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    MovieClip(parent.getChildByName("mc_2")).stop();
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  3. #3
    Senior Member
    Join Date
    Aug 2000
    Location
    Central PA
    Posts
    120
    That worked great. Thanks, cancerinform!!!
    ?:-{>

  4. #4
    Member
    Join Date
    Apr 2008
    Posts
    65
    This is very interesting and something I have been thinking about. Can you explain this a little further? Would this work with buttons? I have about 5 buttons aligned side by side each other. Then I have a tab which is a movieclip. I would l would like the tab to slide back and forth on top of each button when the appropriate button is selected.
    Here is my inspiration. http://www.htc.com

    I've already created the buttons and the tab movieclip. I'm just not sure how to arrange this and what the actionscript would look like. I'm using AS3.

    I'd appreciate any information, advice or resources you could offer. thanks!

  5. #5
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    The way that probably works is that one button is sliding over the other buttons and the text changes. You can only use a movieclip as a button to do this.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  6. #6
    Member
    Join Date
    Apr 2008
    Posts
    65
    So are you saying that one could not control a movieclip from a button? If it is possible I guess what I'm looking for is... if the button is clicked have the separate mc go to frame x.

    I'm not too woried about the text in the example, mainly just getting the tab to move across the screen when the button is clicked. thanks!

  7. #7
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You can control a movieclip from a button of course. But the sliding button has to be a movieclip to control the textfield inside.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  8. #8
    Member
    Join Date
    Apr 2008
    Posts
    65
    good. What would the AS3 script look like to achieve this effect? I guess that the part I really need help with. I'm not sure what the code would look like. Can you post an example? When this button is clicked the movieclip goes to X frame. Thanks for replying and your assistance.

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