Button To Close Window?
I have a button in a flash movie, that is supposed to close the window in which the movie resides.
This is the action I have in the button:
on (release) { getURL ("javascript: window.close()"); }
This is what was automatically published in the html file:
<!-- URL's used in the movie--> <A HREF=javascript: window.close()></A> <A HREF=http:mdev.outreach.psu.edu></A> <!-- text used in the movie-->
I have two questions...
1) the button works in ie5, do I need anything else for it to work in other browsers (is <script language="javascript">.....</script> needed somewhere?)
2) When I hit the button, a warning message comes up saying that the button will close the window, and prompting the user to click 'OK'. Is there a way to make it so this won't happen?
Thanks
FlashKit > Flash Help > Flash ActionScript
Posted on: 07-26-2001, 10:43 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Close.window Script In Flash Button Quits My Browser Window Or Crashes System
Can somebody please help me?
I have a javascript attached to a button in a .swf file to close the browser window it is in.
The code which was given to me yesterday by senocular is
on(press){
getURL("javascript:window.close()")
}
__
however if you try it IE will unexpectedly quit or bomb my computer.
I tried it in Netscape and it didn't crash.
You can refer to my site http://www.valdesdesign.com
after intro go to print button and then to editorial button.
Editorial opens new window with editorial.swf inside. Click on top right button to close window and see what happens.
Is there something I'm doing wrong? Please help me.
Thanks
Button That Will Close Window?
I have a flash movie in a pop-up window.
I would like to make a button in the movie that will close this pop-up window.
Does anyone know how to do this?
Thanks
'close Window' Button?
hey ppl...
this probably isn't the right board, but i'll give it a shot anyway...
i can't find the code for a 'close window' button anywhere, the kind that will close a pop-up window opened with javascript, and i need one that will work in an HTML file, AND a flash file, or one for each... or something...
any takers?
louise
Close Window Button
I tryed many time but this javascript:self.close(); script wont work, can some one help me with this code? thanks for your time
Close Window Button - HELP
A simple one, but I never learned this.
I've got an .swf that goes full screen. I want to make an exit button to allow the user to close the screen.
Thanks much
Close Window Button
Is there a way to create a button that when pressed it closes the Flash Projector File? I would appreciate this. Thanks.
Close Window Button....
Hi...I've finally managed to create a pop-up window from within flash. Now I want to make a close window button which closes the little pop-up browser window? how do I do that? Java script? HELP!
Thanks
Close Window Button?
Hello there. I am playing about with my portfolio and i am stuck on a quit or exit button. I understand usually a quit button would not be needed in flash, but i have an option were my portfolio can be viewed as a full screen, but the user must have active X.
Anyhow, I can't seem to find the actionScript anywhere.
i know in director, it would be:
on mouseup me
end
end;
i have even tried a bit of javascript like:
on (release) {
getURL("JavaScript:window.close();");
}
I dunno tho, I have just started using flash so i am not very good.
please help!
CHEERS,
Grant
How Can I Close IE Window With The Fla Button...
Can someone plz help me with that one?
I have an IE window opened, swf in it, so i would like 2 close it with flash made button, not with red cross top left corner...
can someone plz tell me how 2 make this up?
Thank You
Close Swf-window With A Button?
is it possible to quit a swf-movie via a button (made) in flash? i mean, instead of pressing the 'x' in the top right corner of the window. what would the script be then?
/Bensa
Close Window Button
Hey.
I have a pop-up window with a 'CLOSE' button on the page.
What I want is the window to close on the click of the button.
I have been able to get it to work... but on the click it gives me a message: Do you want to close this window / yes or no.
I was wondering if anyone can fix my code so that it will force close the browser window.
Here is the code I used on the button:
on (release) {
getURL ("javascript:self.close();");
}
Any suggestions would be of help.
Cheers Werglum
Button To Close Window
How would I make a button close a flash site? Meaning that when a button is clicked, the window closes?
Close Window Button
I'm trying to make my "X" close window button make my main MC go to and specific frame and then make it play in reverse until it reaches its first frame.
Does anybody know the code or way to achieve something like this???
thanks
Button To Close Window
Hi,
I've seen web sites where a seperate window appears when a button is clicked...and in the new window a button (other than the browser button) enables you to close the window on itself. Anyone know what action in Flash is used to make a button close the window? Also trying to figure out how to make the window appear in a set size 500 pixels wide by 250 pixels high.
Thanks,
Scott
How To Close A Window With A Button
Hi there, this is my first post here, so yes a bit of a "newbie"!
I've picked up code a few times from difference sources, but none of them work. I'd like to close a window for a flash web site through a button. How do I do this??
Thanks!
How To Close A Window With A Button
Hi there, this is my first post here, so yes a bit of a "newbie"!
I've picked up code a few times from difference sources, but none of them work. I'd like to close a window for a flash web site through a button. How do I do this??
Thanks!
Close This Window Button
Seems to me way back in the 1950's when FLASH 4 was the rage, girls wore pony tails, and Elvis was crowned King of RocknRoll -- there was a button script which allowed the user to close an open swf in the player as one could close a pop up html with a java script 'close window' action. Is this possible? Or am I just dreaming?
If so refresh my memory of the action button script -- somebody please...
'close Window' Button
Hi there,
I have created a movie that opens up another swf file when a button is clicked. However I want to close this new swf with a 'close window' button!
Does anyone know how to do this, help would be much appreaceted
Cheers
Close Window Button
could someone give me the actionscript or a lead to a tutorial on how to make a button close the window it is in.
thanks
trig
Close Window Button
hello-
I have created a windowless swf file that loads up on a webpage and i have a close window button, but when i use the
getURL("javascript:window.close();") it closes out the entire window and i don't need it to do that. i just want it to close out the swf.
i've tried the fscommand("quit"); but that didn't seem to work.
any ideas???
Close Window Button
Hello:
How can i create a button in flash that close a pop up window? it is posible to do it without JavaScript?
Close Window Button?
Hello...I am creating a Flash (CS3) tour that will open in a new HTML window. I have a button that should close the window. Any idea how I can do this?
I'm assuming its pretty basic, but I can't seem to find a working solution. Thanks!
I thought this would work, but it does not:
Code:
function closeWindow(evt:Event):void{
getURL("javascript:window.close()");
}
bClose.addEventListener(MouseEvent.CLICK, closeWindow);
'close Window' Button
Hi there,
I have created a movie that opens up another swf file when a button is clicked. However I want to close this new swf with a 'close window' button!
Does anyone know how to do this, help would be much appreaceted
Cheers
Close Window Button
I created a windowless swf within my web page, but when i put the javascript to close the window, it closes the entire window, and i just want it to close the windowless flash.
i've tried the fscommand to quit, but that doesn't work.
any ideas?
Close A Browser Window Button
I need to create a button that closes the web browser window in which my flash movie is playing. The user has a decision point with two buttons. One button let's the user end the Flash movie and close the web browser down. Anyone know how to script the button for the javascript equivalent of
javascript:window.close ();
?
Thanks.
Button Code To Close A Window?
I have a pop-up window.
I also have a close window button in it.
Anyone know how to code a button to make this work?
Thanks. Pete
Can I Create A Button To Close A Window?
Ok, so my flash movie plays, all's well and good, but when I get to the end, I want a button to start the movie over (i know how to make this) and a button to close the window (I don't know how to make this).
How do I actionscript for the window to close on an onrelease?
Close Pop Up Browser Window Button
Hi there,
Hope someone can help! I have a series of pop up window in flash, these pop up from a main site and they require a close button so the browser windows close. I have created these pop up in flash and enter this code on the buttons:
on (release) {
getURL("java script:self.close(http://www.design8ed.com/digitalspirit/real4.html);");
}
Now when i publish this and press the close button it come up with an error - program doesn't understand etc...
Is this because i need to include something in the html version of the file - inbetween the head tags of something else i have missed or am doing wrong?!
Any help would be really appreciated as i gotta sort this asap!!
Cheers!
Close Window Button Action
Hi there,
hopefully an easy one, what script do I add to enable a button to close the Flash window.
thanks in advance.
Close Window With Button In Movie
Hi all,
I have made a site that has a number of buttons which opens pop-up windows. I was hoping someone would know how to create a button, inside the new window, which would close the pop-up that holds the button.
Thanks for any replies,
Tom
Window Component CLOSE BUTTON?
i am using the windows component, and settign the close button to true, but when clicked it does nothing......should i be putting code on the window or is it just another component with a fault?
Close Browser Window W/ Button
im having a problem i wanna close a browser window with this code:
getURL("javascript: self.close();");
it works but also shows me a warning window " are you sure you want to close this window?"....does any body has an idea how to shut off this warning???....thanx
Window Component Close Button
I have a Window Component. I have the closeButton Set true but how do I actually get it to close out the Window Component???
Close Button On Menu Window
I'm creating a system of flash menus and windows for a website. Basically there are 5 text links at the bottom and when each one is clicked, its own respective window opens up in the center of the page. This effect is animated, so when the button is clicked, the window "appears" from the text link and increases in size and opacity to fill the space. I want to create a button at the top right corner of each window similar to the X button on a window in Windows. Is there any way that when I click this button, it will take me to the end of the animation of the window appearing and simply play it backwards?
If that was unclear, let me see if i can simplify it:
1. Button clicked
2. Window scales up from the link and fills the page.
3. X button clicked
4. Window scales back down in the exact opposite way it appeared
I've found numerous examples of playing the timeline backwards, but all of them seem to only play in reverse starting from the frame it's on. I need both a "goto" command and a command to play in reverse.
Any help is greatly appreciated. Thanks.
Close Button In Window Not Working .
Flash Type:
Application using forms.
Flash Version:
Flash MX 2004 Professional.
Components Used:
Menu
Window
Alert
Combo Box
Label
Text Field
Radio Button
Check Box
Problem Area:
A Window Launched by the menu has a close button. The close button's Listener doesn't work.
Code Explanation with problem:
The Menu is created during run time.
The listener function in menu when clicked, calls a user defined function launchWindow();
The launchWindow(); creates the Window with content path frmCalculator and has the close button .
After calling the launchWindow(); the Window with frmCalculator is loaded.
But when the close button is clicked the myWindow.addEventListener("click" , windowListener); is not working, and hence the
windowListener.click = function() is not called at all.
But if the launchWindow(); is called directly during loading the close button event works.
I have attached the source code. Please help me.
//Source Code========================================
import mx.controls.Menu;
import mx.controls.MenuBar;
import mx.controls.Alert;
import mx.managers.PopUpManager;
import mx.containers.Window;
//launchWindow("frmCalculator","Form Calculator",771, 531.5,15,33.7); //When this is used the close button works !!!
//Message Box Function
function msgBox(msgContent,msgTitle){
Alert.show(msgContent, msgTitle, Alert.OK, this, myClickHandler, "stockIcon", Alert.OK);
}
//Window Launcher Function
//Arguments:
//dataTitle: Title for the window
//dataContent: the frmCalculator which is the second screen next to the first application created.
//closeButton: true
function launchWindow(dataContent,dataTitle,dataSX,dataSY,d ataX,dataY){
myWindow = PopUpManager.createPopUp(_root,Window,false, {title:dataTitle, contentPath:dataContent, closeButton:true });
myWindow.setSize(dataSX,dataSY);
myWindow._x=dataX;
myWindow._y=dataY;
focusManager.setFocus(myWindow);
}
//Listener function for close button
//This listener doesn't work when the launchWindow() is called from the MENU Component.
//But this listener works when the launchWindow() is called directly during load.
windowListener=new Object();
windowListener.click = function(){
trace("Close");
myWindow.deletePopUp();
}
myWindow.addEventListener("click" , windowListener);
//Run Time Menu Creation
// instances on the stage
var menuBar:MenuBar;
// variables in this script
var manager_menu:Menu;
/*=================
MANAGER MENU
=================*/
//Main Menu
manager_menu = menuBar.addMenu("Manager");
//Sub Menu
manager_menu.addMenuItem({label:"Calculator", instanceName:"calculatorInstance", icon:"new"});
manager_menu.addMenuItem({label:"Exit", instanceName:"exitInstance"});
// The listenered for the manager menu (and submenus)
var managerListener:Object = new Object();
managerListener.change = function(eventObj : Object) : Void {
//selected_ta = "Selected Application: " + eventObj.menuItem.attributes.label;
//msgBox(selected_ta,"Alert: Manager");
//statusBar.text=selected_ta;
//barProgress.setProgress(100,100);
//launchWindow(frmCalculator,"frmCalculator","Form Calculator",771, 531.5,15,33.7);
switch (eventObj.menuItem) {
//When this code calls the launchWindow(); the close button in the window doesn't work at all. The " myWindow.addEventListener("click" ,
windowListener); " is not working !!!
case eventObj.menu.calculatorInstance: launchWindow("frmCalculator","Form Calculator",771, 531.5,15,33.7); break;
case eventObj.menu.exitInstance: fscommand("quit"); break;
}
}
// register the listeners with the separate menus
manager_menu.addEventListener("change", managerListener);
Code========================================
Need Script For A Close Window Button.
Sorry guys I just started Flash 3 weeks ago so I'm a Newbie!
I made a button to load a .swf file on screen using this script:
on (release) { containerMC.loadMovie("movieTest1.swf");
}
Now I want to create a button in the movieTest1.swf file that will remove it from the screen. Basically its a close window button. Is this possible? What script do I assign to the button?
Close Pop-up Window With A Flash Button
does anyone know if you can close a pop-up window by clicking a button that's inside the flash swf?
there's tons of tutorials online regarding how to create pop up windows in flash but nothing on how the user can close the whole window.
besides clicking the "x" on the browser window, is there any other way?
one thousand thank you's to the one that can answer.
Close Button In Window Not Working .
Flash Type:
Application using forms.
Flash Version:
Flash MX 2004 Professional.
Components Used:
Menu
Window
Alert
Combo Box
Label
Text Field
Radio Button
Check Box
Problem Area:
A Window Launched by the menu has a close button. The close button's Listener doesn't work.
Code Explanation with problem:
The Menu is created during run time.
The listener function in menu when clicked, calls a user defined function launchWindow();
The launchWindow(); creates the Window with content path frmCalculator and has the close button .
After calling the launchWindow(); the Window with frmCalculator is loaded.
But when the close button is clicked the myWindow.addEventListener("click" , windowListener); is not working, and hence the
windowListener.click = function() is not called at all.
But if the launchWindow(); is called directly during loading the close button event works.
I have attached the source code. Please help me.
//Source Code========================================
import mx.controls.Menu;
import mx.controls.MenuBar;
import mx.controls.Alert;
import mx.managers.PopUpManager;
import mx.containers.Window;
//launchWindow("frmCalculator","Form Calculator",771, 531.5,15,33.7); //When this is used the close button works !!!
//Message Box Function
function msgBox(msgContent,msgTitle){
Alert.show(msgContent, msgTitle, Alert.OK, this, myClickHandler, "stockIcon", Alert.OK);
}
//Window Launcher Function
//Arguments:
//dataTitle: Title for the window
//dataContent: the frmCalculator which is the second screen next to the first application created.
//closeButton: true
function launchWindow(dataContent,dataTitle,dataSX,dataSY,d ataX,dataY){
myWindow = PopUpManager.createPopUp(_root,Window,false, {title:dataTitle, contentPath:dataContent, closeButton:true });
myWindow.setSize(dataSX,dataSY);
myWindow._x=dataX;
myWindow._y=dataY;
focusManager.setFocus(myWindow);
}
//Listener function for close button
//This listener doesn't work when the launchWindow() is called from the MENU Component.
//But this listener works when the launchWindow() is called directly during load.
windowListener=new Object();
windowListener.click = function(){
trace("Close");
myWindow.deletePopUp();
}
myWindow.addEventListener("click" , windowListener);
//Run Time Menu Creation
// instances on the stage
var menuBar:MenuBar;
// variables in this script
var manager_menu:Menu;
/*=================
MANAGER MENU
=================*/
//Main Menu
manager_menu = menuBar.addMenu("Manager");
//Sub Menu
manager_menu.addMenuItem({label:"Calculator", instanceName:"calculatorInstance", icon:"new"});
manager_menu.addMenuItem({label:"Exit", instanceName:"exitInstance"});
// The listenered for the manager menu (and submenus)
var managerListener:Object = new Object();
managerListener.change = function(eventObj : Object) : Void {
//selected_ta = "Selected Application: " + eventObj.menuItem.attributes.label;
//msgBox(selected_ta,"Alert: Manager");
//statusBar.text=selected_ta;
//barProgress.setProgress(100,100);
//launchWindow(frmCalculator,"frmCalculator","Form Calculator",771, 531.5,15,33.7);
switch (eventObj.menuItem) {
//When this code calls the launchWindow(); the close button in the window doesn't work at all. The " myWindow.addEventListener("click" ,
windowListener); " is not working !!!
case eventObj.menu.calculatorInstance: launchWindow("frmCalculator","Form Calculator",771, 531.5,15,33.7); break;
case eventObj.menu.exitInstance: fscommand("quit"); break;
}
}
// register the listeners with the separate menus
manager_menu.addEventListener("change", managerListener);
Code========================================
Need Script For A Close Window Button.
Sorry guys I just started Flash 3 weeks ago so I'm a Newbie!
I made a button to load a .swf file on screen using this script:
on (release) { containerMC.loadMovie("movieTest1.swf");
}
Now I want to create a button in the movieTest1.swf file that will remove itself from the screen. Basically its a close window button. Is this possible? What script do I assign to the button?
Is There A Way To Close The Window/browser With A Button?
I'm creating a CD for my work that will play a flash movie when the user puts it in using the .exe export.
Question is, is it possible to make it so when the user presses a button to QUIT the program, I could have Flash close the window it's in?
I figure it'd probably be the same command for having Flash close its parent browser window, but I haven't met anything like that yet.
Thanks.
|