• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 976
  • Last Modified:

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.
0
TCUBusiness09
Asked:
TCUBusiness09
  • 3
1 Solution
 
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
 
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now