# 2 seperate movies a&b. i need to control a from b

**URL:** <https://forum.kirupa.com/t/2-seperate-movies-a-b-i-need-to-control-a-from-b/200694>\
**Category:** flash\
**Created:** [September 14, 2006, 9:52am UTC](https://forum.kirupa.com/t/2-seperate-movies-a-b-i-need-to-control-a-from-b/200694 "2006-09-14T09:52:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![will\_roberts](https://avatars.discourse-cdn.com/v4/letter/w/4da419/32.png) [@will\_roberts](https://forum.kirupa.com/u/will_roberts)\
**Post date:** [September 14, 2006, 9:52am UTC](https://forum.kirupa.com/t/2-seperate-movies-a-b-i-need-to-control-a-from-b/200694/1 "2006-09-14T09:52:34Z")

</div>

Hey all,

Iam trying to do the following for my website.

I have a swf that fades in images at the click of a button but i want to remove the buttons from the main swf and have them on their own in a new swf but still control the fading movie.

Any ideas?

Here is the code i am using

Button Code

```auto
bt1.onRelease = function() {
 loadFade("img1.jpg", _root.destino);
};
bt2.onRelease = function() {
 loadFade("img2.jpg", _root.destino);
};
bt3.onRelease = function() {
 loadFade("img3.jpg", _root.destino);
};

```

Fader code

```auto
Stage.scaleMode = "noScale"
/ **************************************************** /
/* Criando o MovieClipLoader */
var meuMVL:MovieClipLoader = new MovieClipLoader();
var meuListener:Object = new Object();
meuListener.onLoadProgress = function(alvo:Object, bLoad:Number, bTotal:Number) {
 _root.carrega.text = Math.round(bLoad/bTotal*100)+" %";
};
meuListener.onLoadComplete = function() {
 _root.carrega.text = "";
 onEnterFrame = function () {
  _root.destino._alpha += 10;
  if (_root.destino._alpha>=100) {
   delete this.onEnterFrame;
  }
 };
};
meuMVL.addListener(meuListener);
/ **************************************************** /
/* Criando o um Protótipo para ficar + simples de usar o fade entre os swfs/imgs */
_global.MovieClip.prototype.loadFade = function(img_mc, dest_mc) {
 dest_mc._alpha = 100;
 onEnterFrame = function () {
  dest_mc._alpha -= 10;
  if (dest_mc._alpha<=0) {
   delete this.onEnterFrame;
   _root.meuMVL.loadClip(img_mc, dest_mc);
  }
 };
};

```
