Flash - How to get two MovieClips to communicate to each other?

Discussion in 'Web Design and Development' started by LimeiBook86, Jan 6, 2008.

  1. LimeiBook86 macrumors 604

    LimeiBook86

    Joined:
    May 4, 2002
    Location:
    Go Vegan
    #1
    Hello everyone,

    I'm trying to accomplish something similar to the first example on this page. However, instead of having the items in two different Flash movies, I want to keep both items in the same movie, just in different MovieClips.

    What I'm trying to do is have a MovieClip communicate to another item. See the image below as I try to explain. I'm trying to create a scroll menu for my Portfolio page. I use the ScrollPane component to create a scroll box around the content (which is a MovieClip), inside that content are buttons. The problem is I want the buttons to communicate to an external MovieClip or Text box, which would be the gray Description box below. :)

    So when you click on or mouse-over a button, a block of text will appear in the center describing each separate item. I'm not the best with ActionScript so I'm trying to figure out how I can get this to work. I'm using the latest version of Flash but the document is using ActionScript 2.0.

    Any help with this would be greatly appreciated, thanks! :D
     

    Attached Files:

  2. barrysfarm macrumors regular

    Joined:
    Nov 1, 2005
    #2
    If the 2 movieclips are placed on the stage at the same level, you could do something like:

    _root.descriptionArea.gotoAndPlay("specific description");

    or a safer route would be the following:

    this._parent.descriptionArea.gotoAndPlay("specific description");

    I believe that's right. I can't remember if _parent has the underscore or not in AS2. It doesn't in AS3.

    Edit:
    It doesn't have to be gotoAndPlay() either. You could trigger a custom function in actionscript, trigger a timeline action for the targeted movieclip (like play(), stop(), gotoAndPlay()). gotoAndStop()

    Edit: Added more.
     

Share This Page