• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 295
  • Last Modified:

code for playing movieclips

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
1 Solution
Dushan De SilvaCommented:
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
Aneesh ChopraCommented:

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



Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now