code for playing movieclips

Posted on 2006-04-20
Last Modified: 2010-04-03
OK, here is the problem: I have done a small movieclip called "clip_a10". After I have created a new flash document. In the library of this document I have included the clip_a10 movieclip. I want to "insert" the clip_a10 movieclip into the interface, but instead of dragging and dropping it into this interface i want to do it by code, because of programming issues. i have tried to use loadMovie(), playMovie() and other methods but for some reason none of these works. can someone give me an help on this?
many many thanks
Question by:kugo
    LVL 17

    Expert Comment

    loadMovie() is to load external flash movie files (swf files).
    You try attcheMoive command.

     this.attachMovie(_backgroundMCName, "background_mc", -1,{_x:0, _y:0,_xscale:0,_yscale:0});

    BR Dushan
    LVL 34

    Accepted Solution


    you can use "attachMovie"

    1. To use attachMovie, first of all, right click in library and click "Linkage..."

    2. Now check the "Export for Actionscript" checkbox, you will notice as you click, identifier textbox become enable and "clip_a10" have been filled automatically.

    3. click Ok.

    4. now you are ready to use this movieClip as attachMovie.

    5. Write the following code to the first frame.
    _root.attachMovie("clip_a10","mc", _root.getNextHighestDepth());

    6. compile to test it.

    more details on "attachMovie" is here



    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
    This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
    The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
    This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now