Saturday, May 12, 2007

Flash Tutorial : Closing a .SWF inside another .SWF

Today I ran across a big problem while coding my final for my advanced Flash class. Heres how it goes: I am creating a portfolio, and want to make it so when someone clicks on something like, "Posters" and new .SWF in the Lightbox style pops up. Whatever I did I couldn't figure out how to code a button so that when someone clicks it, the new SFW that pops up closes. After searching on the Internet I finally found out how. Simply put the following code into your button:

on (release) {

unloadMovie(this);
}

or it could go something like this in your actions layer:

button.onRelease = function () {
unloadMovie(this);
}

Since this seems to be a relative common problem with not a lot of helpful answers out there, I thought I'd post this on my blog (which no one reads anyway.)