ActionScript 2.0 :: Call A Window.close With External Interface?
Oct 14, 2009
Currently I'm trying to call a window.close with external interface. It works fine, however, I also have a window.beforeunload call in my javascript so the close button ends up calling two windows. One is the "this page is trying to close...blah blah blah" and the other is the custom one i wrote.
Is there anyway to call onbeforeunload combined with window.close from external interface so that i only get one warning?
View 2 Replies
Similar Posts:
Sep 3, 2009
I am trying call a popup window from actionscript on a button and am having trouble I am using following: import flash.external.ExternalInterface; Then on the button in Flash: on (release) { ExternalInterface.call("myPopup.start", "#contactForm"); } but I don't know if ExternalInterface will properly call the start() method.... am a little lost The page is @ [URL] and the link at the bottom "CLICK HERE FOR FORM" is what needs to be incorporated into a flash button on the SWF.
View 0 Replies
May 28, 2008
I cant seem to find the solution to call the javascript:window.close() function.It is running locally so there may be some issues on that front.Has anybody used this type of functionality before. it is doing my head in.
View 3 Replies
Apr 17, 2012
I am using in AS3 "External Interface ". When I call the JS function that is on the same page as swf everything works fine.
I added a link in the html page to an external JS file, when I move the JS function to the external JS file the website crushes.
I would prefer to have all my JS functions on an external file so I can use them in the future in other project and it also makes it easier for me to update the site.
how to call a JS function that is on an external file from AS3?
View 6 Replies
Oct 7, 2010
Using Flash - AS 3.0: I am trying to use ExternalInterface.call to open a .pdf file - but it is not working - nothing is happening...
ExternalInterface.call ("window.open","diagrams/v1/crh.pdf", "WindowName", params);
But this line DOES work - call an .html file to open.
ExternalInterface.call ("window.open","m5_quiz/v1/quiz.html", "WindowName", params);
I can't find any information that says this should or shouldn't work - it seems to me it should open it. To get around this - I have been using 'navigateToURL' to open the pdf file - but that triggers the pop-up blocker - using the External Interface call does not.
View 4 Replies
Jul 26, 2007
I am currently just finishing a project and I am having a big time problem with an ExternalInterface call. My application runs fine but when the javascript call is being made from flash using external interface, IE is going from the "Done" message, to showing the "!" icon, with "error on page" as the message. There is no error that is showing up in Firefox.
The current error I am seeing is an 'Unterminated String Constant', which wouldn't be a problem except for that it appears on line 1... which is [URL]
View 1 Replies
Jan 28, 2010
What I have:A swf exports a function via ExternalInterfaceJavascript creates new embed object and adds it to the documentCalling flash functions works fine in other browsersCalling flash functions will fail in IE 8Example of exporting functions in swf:
flash.external.ExternalInterface.addCallback("isActive", ...
Example of creating the embed object:
var b = document.createElement('embed');
[code].....
View 4 Replies
May 30, 2010
Everytime I try to do even an
ExternalInterface.call('alert','abc');
(Which will work on every browser) I get an
object doesn't support this property or method
After the alert appears. It even happens in the HTML generated by flash without me touching it...
View 1 Replies
Jun 6, 2010
I need to call a function in JS that's expecting a JSON object. Can I do this from External Interface? The company's example (after the include file url) in HTML looks like this:
//there's an js include URL earlier//
Shopwithme.Initialize({
"id":"prod1234",
[code]...
But, I need to dictate these vars through Flash. How do I call this function using External Interface?This is my EI code, but I'm obviously off base, since it's not working:
ExternalInterface.call("Shopwithme.Initialize",[{ "id":"prod1234",
"type":"2","URL":"http://www.somelink.com"}]);
What do I need to do to call this javascript?
View 2 Replies
Sep 29, 2009
completing the code to get a return value from JavaScript to flash, but all the code was in a frame. My issue is I need to apply this code to multiple buttons, and then have them navigate to the appropriate frame. I thought I could put some of the code on the buttons themselves, or possibly I could call each button and keep all the code in frame one.....the external interface call function and the button functions....btn1, btn2; etc......I am not to verse in code and need to know what and how the best way to do this would be.
[Code].....
View 16 Replies
Apr 24, 2011
I'm hitting a brick wall here, and it's driving me mad. Used to use ExternalInterface to call Flash functions from Javascript all the time, and now under CS5 (and the way it uses object id's instead of embed in html) it's stopped working for me in certain browsers. I put together a really simple program that has the person click a link in the browser that activates a javascript function that simply sends some text in to Flash to display in a TextArea. Here's the as3 code:
[Code]....
View 9 Replies
Mar 23, 2007
*let say i have a mc called A. it can call a MC with an instance name called window_btn.window can be drag and double click.i want to put a close button in the window MC to close the window.
how to call the close button in the MC?
View 14 Replies
Jun 29, 2009
I have created a small image gallery for use in a CBT Program.What I am looking to do is, each image in the slide when clicked needs to go to a separate html page.I currently have it working as far as being able to execute a single External Call to go to a HTML Page, but it is working for the entire gallery not individual pictures.I am thinking of separating the way the MC are loading into the container, then tying External Calls Specific to the individual clips.
below is the current code.
--------------
import mx.transitions.Tween;
import mx.transitions.easing.*;[code].....
View 0 Replies
Nov 30, 2011
I created a Flash application that reads POST data from a form. A user clicks the button, and the data gets posted to the flash app in a new window (_blank). Now takes the data and then spins a wheel to give users a prize. If they don't win a message pops up letting them know they didn't win. If they don't win, clicking the OK button needs to close the browser window.
I've tried a number of solutions and it seems that the only way to get this done is to launch the window with javascript and then use ExternalInterface.call('window.close'); to close the window from within the Flash actionscript (3) because otherwise the window won't close (I've tried just using window.close and window.close() with no luck)
I understand how to launch a new window with javascript, but I don't know how to simultaneously launch and POST data to that window (the Flash application has to have the POST data. Is this the best solution? Is there a way to close a browser window easier than what I'm describing?[URL]
View 1 Replies
Sep 25, 2009
I'm trying to create a pop up window in Flash which also fades the background window to 75% black. When the user closes the pop up window, I'd like for the parent window to un-fade back to normal. Is this possible? I can do the first half of it and make the background window fade to 75% black. The difficult thing is making it fade back to normal when the user closes the pop up window.My thoughts are that I need to attach some code to the browser's built in close window button. It might require some javascript or a fscommand. I'm not sure.
View 9 Replies
Mar 4, 2006
I have an asp page that will open a new asp page in a new window that contains a swf file with a button.hen the user clicks the button i want to close that window and reload the parent window.
View 9 Replies
Feb 6, 2003
ACTUALLY i just thought of another one so now i have two. sorry. hope you don't mind. i get sidetracked rather easily. before i start, a quick nota bene. i'm a complete newcomer to flash so my questions are very simpleminded. not much of a challenge i'm afraid.
1. can i put a link in my movie that will close the window?
2. can i put a link in my movie that will open a new window of a specific size, and without the menu-buttons of explorer?
View 10 Replies
Jun 22, 2009
I'm trying to use ExternalInterface.Call to call a JavaScript function to launch a lightbox window. So far I have this:
AS3:
flash.external.ExternalInterface.call("launchLB", "" + aUrl + "");
JavaScript:
function launchLB(url) {
alert(url);
[Code]....
I get the alert but I can't get the lightbox window to display. When my as code makes the ExternalInterface call I get what looks like a page refresh and a blank browser window.
View 1 Replies
Sep 13, 2004
Does anyone know the syntax for closing a swf window using a button, similar to closing a popup window? I am creating a small game, and am giving the user the option to "play again" or "quit" at the end of the game, so i want the quit button(standard library on(press)) to close the swf file.
View 2 Replies
Aug 31, 2010
I have an .exe with a button that opens an outside .swf. I want to include a close button on that .swf that closes just that outside movie. I tried:
on (release) {
fscommand("quit");
}
But that closed the whole exe.
View 1 Replies
Apr 1, 2010
I'm currently working with a flash movie that opens up an IE browser to an external link.Since I'm working with a presentation that plays automatically after a few seconds and keeps loading new IE browsers with different links, I was wondering if there was a way with AS2, i can have flash close the IE window it opened?
View 1 Replies
Mar 7, 2011
I am using Flash builder 4 to build a flash. I 'd like to add a button that user can close the window
[Code]....
View 2 Replies
Sep 4, 2008
I have a button that when clicked, I need it to go to a url, and close down the flash swf.
Is there a simple action I can use for this?
View 5 Replies
Apr 19, 2005
there I have created pop up swf movie opening from CSS. Within this movie I have created an image in the shape of an "X" meaning close the window. Does anyone know where I can get code for the close window for this SWF?
View 1 Replies
Jul 31, 2009
What is the actionscript required to close a Flash player window? I want to run a flash movie on my computer that has a button which closes the window, but in Actionscript 3 I cannot add actions to the button.
View 4 Replies
Nov 9, 2009
I have looked around for this and haven't found a way that clearly explains how to do this. More often than not the button will close the browser window in one but not another browser.Is the a simple way of closing a browser window in all types of browser ( Or mainly Firefox, IE and safari on both Mac and PC ) with actionscript?
View 1 Replies
Oct 12, 2010
I have an animation that opens in a html page in a new browser window. Once the animation ends I would like to have the window close automatically.
View 4 Replies
Dec 23, 2010
I have a "Close Window" Flash button on the 1st web page and it works. I have the same button on a 2nd page (you get to the 2nd page via the 1st page) and the button does not work. What "close window" actionscript do I use to close these windows?
Here is the code that I am using that works to close the 1st window...
on (release) {
getURL (onclick="javascript:window.close()");
}
View 0 Replies
May 26, 2005
anyone care to post the code used in flash and the one needed in the document to close the window. can be done with javascript and fscommand or what ever its called right?
View 3 Replies
Sep 1, 2005
I've written getURL("javascript:window.close()"); to close the windowwhich runs only in IE. What should be written for Firefox?
View 1 Replies