Take the 2-minute tour ×

i want to load another swf that i build and use it's functions. but it seems that when i use getURl('url','_mylevel') it doesn't load the flash file and i get no error. only when i use getUrl('url','_blank') it opens the browser with that url.

i want to be able to use the functions in that swf like the following example:

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

The getUrl() method is for opening other web addresses, as in getUrl( "http:google.com" ). It works just like a hyper link in HTML. If I understand your question, it seems that you want to load a swf into the existing swf and call methods on it. In that case, you should use the MovieClipLoader. The following is pseudo-code but should get you close.

var loadListener:Object = new Object();

loadListener.onLoadComplete = function(target_mc:MovieClip, httpStatus:Number):Void 
    trace( "onLoadComplete" );
    trace( "loaded content: " + target.getInstanceAtDepth(0) );

var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener( loadListener );

var mc:MovieClip = this.createEmptyMovieClip( "mc", this.getNextHighestDepth() );
mcLoader.loadClip( "nameOfTheSwfYouWantToLoad.swf", mc);
share|improve this answer
thank you, your example resolved my programming problem. –  ufk Jan 10 '10 at 14:44
add comment

Your Answer


