Close button for swf in flash

I am creating a flash website and within the site, i am using another flash file for the calendar feature. I have the code to pop-up the calendar (swf) on the correct page, but now I am in need of a close button.

I have created a flash button with the three different states and hit area in the .fla file of the calendar, but the actionscript is the issue. It needs to be able to close the individual swf (calendar) without affecting the rest of the flash website.

I'm not even sure if creating the button on the calendar file is the right way to do this, or creating the button on the website file and pointing it to the swf of the calendar.

I hope this explains my problem. Let me know if you have any additional questions. Thanks in advance.
TCUBusiness09Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

blue-genieCommented:
how you remove the swf depends greatly on how you loaded it.
but if you put the button inside the calendar swf,
do this.
on (release) {
trace(this);//check if this references the calendar if not modify based on the trace result i.e _parent etc
unloadMovie(this);
}


0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TCUBusiness09Author Commented:
Thanks! I'll try this code out later today and get back to you on how it worked.
0
TCUBusiness09Author Commented:
That worked perfectly. Exactly what I wanted. Thanks!
0
TCUBusiness09Author Commented:
One other question that I do have is now that I have loaded the calendar using:

on(release) {
loadMovie ("calendar8_01.swf", 1);
}

How do I position the new window where I want it within my flash site. It is loacated by default in the top left corner, but I am wanting it to be in the middle of the screen both horizontally and vertically. Is this possible?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.