# Mouse clicks from main.swf to external swf

**URL:** <https://forum.kirupa.com/t/mouse-clicks-from-main-swf-to-external-swf/304635>\
**Category:** Uncategorized\
**Created:** [February 11, 2010, 12:30am UTC](https://forum.kirupa.com/t/mouse-clicks-from-main-swf-to-external-swf/304635 "2010-02-11T00:30:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dvinatea](https://avatars.discourse-cdn.com/v4/letter/d/71c47a/32.png) [@dvinatea](https://forum.kirupa.com/u/dvinatea)\
**Post date:** [February 11, 2010, 12:30am UTC](https://forum.kirupa.com/t/mouse-clicks-from-main-swf-to-external-swf/304635/1 "2010-02-11T00:30:51Z")

</div>

I have to make a presentation which consists of a main.swf that loads 5 external swfs. You pass from one swf to another by doing click. The external swfs (2 of them) have a tween in which you do click to load some shapes.

How do I stop the click in the main swf and activate the click in the external swf and then return to the main.

In the function “myClick” there is a condition which when it gets to the 3.swf (num==2), it stops the clicks in the main.swf by stage.removeEventListener(MouseEvent.CLICK, myClick). It works, but I don’t know how to return the clicks to the main.swf after the last click in 3.swf.

here is my code(main.fla):

import flash.events.KeyboardEvent;  
import flash.ui.Keyboard;  
import flash.display.Loader;  
import flash.display.LoaderInfo;  
import flash.net.URLRequest;

var loader:Loader = new Loader();  
addChild(loader)  
var newSWFRequest:URLRequest = new URLRequest(“0.swf”);  
loader.load(newSWFRequest);  
stage.addEventListener(MouseEvent.CLICK, myClick);  
var num:Number=0;  
function myClick(eventObject:MouseEvent) {  
if(num==2){  
stage.removeEventListener(MouseEvent.CLICK, myClick);  
}  
var newSWFClick:URLRequest = new URLRequest(num+1 + “.swf”);  
loader.load(newSWFClick);  
num++;  
}  
/////////////  
3.fla:

import fl.transitions.Tween;  
import fl.transitions.easing._;  
import fl.transitions._;  
var it:Array=new Array(it0,it1,it2,it3,it4,it5,it6);  
var ittween:Tween;

var i:Number=0;  
function myClick(eventObject:MouseEvent) {  
ittween=new Tween(it\*, “alpha”, None.easeNone, 0.5,1, 1, true);  
i++;  
if(i\>=it.length){  
stage.removeEventListener(MouseEvent.CLICK, myClick);  
}  
}  
stage.addEventListener(MouseEvent.CLICK, myClick);

thank you
