# How to detect swf has finished playing. in this context

**URL:** https://forum.kirupa.com/t/how-to-detect-swf-has-finished-playing-in-this-context/289952
**Category:** Uncategorized
**Created:** [June 8, 2009, 1:45am UTC](https://forum.kirupa.com/t/how-to-detect-swf-has-finished-playing-in-this-context/289952 "2009-06-08T01:45:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![spiralvista](https://avatars.discourse-cdn.com/v4/letter/s/8dc957/32.png) [@spiralvista](https://forum.kirupa.com/u/spiralvista)
#### Post date: [June 8, 2009, 1:45am UTC](https://forum.kirupa.com/t/how-to-detect-swf-has-finished-playing-in-this-context/289952/1 "2009-06-08T01:45:00Z")

</div>

I am using the loader class to load an external swf “cube\_final.swf”.  
please note I am setting a movie\_clip (_set on stage_) to alpha=0 as I want it to remain invisble until the loaded swf finishes playing. I will then set alpha = 100% .

But how to i detect that the swf has finished playing? I can detect whether its loaded (_i’ll place a preloader in the loading() function_)

**I am new to action scripting, so any pointers would be welcomed.**

this.open\_cube.alpha = 0

var introLoader:Loader;

function loadIntro(url:String):void {  
// Set properties on my Loader object  
introLoader = new Loader();  
introLoader.load(new URLRequest(url));  
introLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, introLoading);  
introLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, introLoaded);  
}

loadIntro(“cube\_final.swf”);

function introLoaded(e:Event):void {  
// Load SWF file  
this.intro\_area.addChild(introLoader);  
}

function introLoading(e:ProgressEvent):void {  
}
