Adding onRelease to an empty movie clip

Hello all…

I have been searching high and low in the forums, but I cannot seem to find the answer I am looking for.

I am trying to load an external swf into an empty movieclip and then add an onRelease function to that movieclip. My code looks like this, but does not seem to work :frowning:

		
_root.createEmptyMovieClip("flashad"+adpage, 250+i);
this["flashad"+adpage].loadMovie("external.swf");
this["flashad"+adpage].onRelease = function() {
	trace("hit");
};

The code is inside of a for loop where i increments by 1.
adpage is a variable with a numeric value.

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=47457&

Thanks Claudio. I swear I perused the forums forever (well, it sure seemed like a long time :slight_smile: ). I will give your code a try when I get into my office.

From what I gather in the post, my problem is that I do not wait until my external clip is fully loaded before assigning the onRelease? That would explain another problem I was having, that I had to do a workaround for.

Fantastic. It worked.

Thanks again, Claudio. As I mentioned above, your help also fixed the other problem I was having. All hail Kirupa!

Welcome trock
Glad I could help :wink: