ActionScript 2.0 :: Detecting Flash/html Window Closed?
Jan 9, 2007
is it possible for flash to detect when a user closes an html window with a swf embeded in it?
I want to record a user session time and need to be able to call a function and serverside script from within flash when a user closes the window...is there a way?
(I thought I might be able to do it with onUnload, but that will only work for unloading movieclips, not closing the main swf.)
View 1 Replies
Similar Posts:
Feb 4, 2010
I'm developing an AIR application which uses multiple windows. I'm running into an issue where I want to open new windows (toaster notifications for example) when the primary application window is not visible, but the behavior is different depending on how the window is closed.
When a user hides all application windows with CMD-H, opening a new window causes all application windows to come back to the foreground (instead of just that new window, like I would expect). If the user closed a window with CMD-W, however, that window does not become visible when I open a new window.
Is there a way to either 1) tell when the user uses cmd-h to hide all windows OR 2) tell whether a window is hidden using cmd-h vs. closed cmd-w?
View 2 Replies
Feb 7, 2010
I was wondering if you can make an eventlistener to trigger to execute a function when the window/tab viewing the swf is closed. I searched around, and there seems to be a way to do this with flash.external class and javascript, but some users have javascript disabled, so is there a way to achieve this without javascript?
View 3 Replies
Aug 27, 2009
using the javascript window.open() and getURL() i am opening a popup from flash. I want to call some flash function when i close that popup window.
View 3 Replies
May 28, 2010
I have created a simple slideshow of thirteen frames. The slideshow script starts at Frame 2. This is because I have inserted a preloader in Frame 1. When I output my SWF and upload it to the web, it pulls down without incident. However, when I "Simulate Download" locally, Flash says this in the Output window:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at AS3GallerywPreloader_fla::MainTimeline/updatePreloader()
[AS3GallerywPreloader_fla.MainTimeline::frame1:9]
And it keeps writing this error message, ad infinitum, until I close the SWF movie window!
Here is the preloader script:
stop();
loaderInfo.addEventListener (ProgressEvent.PROGRESS, updatePreloader);
function updatePreloader (evtObj: ProgressEvent): void{
var percent:Number = Math.floor((evtObj.bytesLoaded*100) /evtObj.bytesTotal);
preloader_txt.text = percent+"%";
if (percent==100) {
nextFrame ();
}}
I should note that the slideshow portion functions as it should (the Back and Forward buttons advance frame by frame). In essence, the whole movie works. But I suspect I that error code is a bad thing to have. I ran the "Debug" feature (Debug-->Debug Movie), but got no apparent indication of a bad line of code.
View 6 Replies
Sep 6, 2011
In Flex (Flash Builder 4) I am opening a new window via PopUpManager.addPopUp. I have timer code that runs in my component and I need to stop my timer when that window opens and start the timer again when the window closes.
I figure it's easy enough to stop the timer in the function that opens the window, but how can I start the timer again when the window closes?
Is there a way to tell if there is a pop-up window in front of my component, or if a specific pop-up window is still open via PopUpManager?
View 2 Replies
Jan 29, 2010
I have flash as a gui to edit some docs. I'd like to caution the user to save before they close the window (or navigate away from it).ut can it be done with a .swf ?I think this was asked awhile back in this forum but I cant seem to locate it.
View 2 Replies
Sep 30, 2009
I am having trouble finding the right keywords to find a solution to my problem. I want to make my app size dynamic according the size of the <object> tag set in HTML. Im searching for the code like: stage.width but showing me the fixed html attribute instead.
View 9 Replies
Nov 23, 2009
Now I set dragEnabled="true", dropEnabled="true" and dragMoveEnabled="true" to archive the ability to reorder my Items via Drag and Drop. But as soon as I start to Drag an Item the whole Application crashes with:
[Code]....
View 1 Replies
May 8, 2010
Is there a way to create a mini window in flash that contain an HTML web page?
View 1 Replies
Dec 4, 2003
I have a chat program built using flash for the front end tied to a J2EE back end. My program creates socket connections which must be closed appropriately when a user signs off.
When a user decides to sign off they can click the sign off button and everything is peachy. However, a less responsible user may choose to sign off by simply killing the browser window. Is there any way to implicitly call an actionscript routine on this event?
View 1 Replies
Jan 29, 2009
How to detect resolution when browser window is resized?
View 6 Replies
Dec 30, 2009
I have created an animation (.swf) with a third party software application. I tried to import it as a symbol into Flash but it is constructed in such a way that it won't work. It requires to be housed within an html environment in order to combine the animation with a separate navigation layer that exists in two separate .swf files.I can mount this animation on a web page independently as it's own page but I really want it to appear within another flash animation.Is there some way for me to create a window in a flash movie that contains a view to an external HTML page so I can embedd this animation? Perhaps similar to an iFrame?
View 3 Replies
Feb 24, 2010
Is there a way (using flash) to grab the raw html from another browser frame? I'd like the following sequence:
Launch my window from [URL]...Launch window from another site [URL]..which has content I want to grab.Let my window grab the raw html content from the other window.
I doubt this is possible because it could be used for dastardly purpii, but just wanted to check.
View 1 Replies
Jun 24, 2008
My Flash CS3 file displays HTML text, read in from an XML file (within CDATA). The HTML text contains links in the form of <a> (anchor) tags (of course).I am attempting to open a new customized browser window whenever a user clicks on a displayed link. So far, I am able to open a window, but the customizing attributes ("width=600,..." etc.) are ignored.Rather than displaying for you the one dozen variations I have (unsuccessfully) attempted, does anyone have a simple example of something that actually works?
View 1 Replies
Apr 12, 2010
How do I get an html pop-up window by clicking a button on a Flash movie?Flash CS4 and Actionscript 3
View 1 Replies
Jan 15, 2010
I'm building an as3 only web application and want to be able to include external html content within a flash 'window'. In AIR there is the flash.html.HTMLLoader class which makes this possible.
Can anyone point to an example of this being done in a flash as opposed to AIR application?
View 3 Replies
Mar 1, 2011
in the same way a UIWebView on XCode behaves, is it possible to embed a website or browser window in an Adobe Flash movie? Like an iframe, but within Flash itself.
View 2 Replies
Aug 17, 2009
What I want is to be able to insert a button into the flash document, and when someone clicks it, to have it open a new window and go to a certain url. To see what I am kind of talking about, go to my website, where I have the flash document without any kind of interactivity. It is the "Connect with TFC" flash file, on the right side of the page.
View 1 Replies
Nov 16, 2009
I am creating a flash movie that needs to be wider then the space available in the html. The html has about a 300 pixel space where I can a flash "launcher" movie (with a html menu bar beside it) and I would like to open a 600 pixel flash movie above everything else on the page (html menu bar and all) but not using a traditional popup window or browser window of any kind (so there will be no issue with popup blockers).
There are banner ads that put junk over top of html content
View 3 Replies
Oct 13, 2010
i would like to show my flash movie in a browser window so that it fills width and height as good as possible without distorting the movie. when i use the width and height attribute to the object/embed tags it only scales the width but not the height.
[Code]...
View 3 Replies
Mar 20, 2012
I'm working on a page that has some ads on it. One of them loads in an ad with wmode=window.I don't have the ability to change that flash code. I need to put a modal box on top of that flash element, but every combination of using z-indexes and iframe shims has failed (both manually and using bgiframe). Is there a way to place html content on top of a flash element with wmode=window? I'm testing this in chrome so far.
View 2 Replies
Aug 17, 2005
how do you make an image pop up in a window javascript style, from flash?
i have a variable in flash, equal to something like "images/image.jpg", and I want to make a button so when you click it it opens up a popup window thats a certain size, without menubars/scrollbars etc, to display that image, like a javascript on your standard HTML.
I read that flash has a javascript API, so there must be a way to do it huh? Is it getURL stuff, maybe with a POST of my variable?
View 3 Replies
Jul 25, 2009
I have a .swf I'm inserting at the top of a page in DW. I have a button named "aboutUs_btn" which when pressed needs to load "aboutUs.html. That part works fine, but it always loads the page into a new window. How do I make it load into the same window? I could do this in AS2 with getURL and using _self. Here is what I have:
var aboutUsLink:URLRequest = new URLRequest("aboutUs.html");
aboutUs_btn.addEventListener(MouseEvent.CLICK,aboutUsClick);
function aboutUsClick(event:MouseEvent):void{navigateToURL(aboutUsLink);}
[code].......
View 5 Replies
Aug 3, 2009
Can anyone tell me if I need to use Actionscript 3 code instead of Actionscript 2 code in the following situation: I am running a swf file which is contained in a browser window (all files are contained on a CD and I have a 'trust' file set up to let them play properly). Up until now, I have been using the following Actionscript 2 code to close the browser window (the Actionscript 2 code is on an 'Exit' button within the swf):
on (release) {getURL("javascript:window.close()");}
This Actionscript 2 code has always worked and still works in Flash player 8 and lower. However, it does nothing when played using Flash player 9. Can anyone tell me if Flash player 9 won't recognize Actionscript 2 code? Is it essential to use ONLY Actionscript 3 code if you are using Flash player 9? I am having the same problem when I try to launch another html page containing a swf (popped up from the swf contained in the main html window).I have the following code on the button to launch the popup html window.It always worked, but suddenly no longer works with Flash player 9.Here is the code I am using:
on (release) { getURL("javascript:launchWin2('webpage2.html');");
}
I have all the necessary background code to launch 'webpage2.html'.It works everywhere except in Flash player 9.
View 1 Replies
Jan 27, 2011
I have a simple HTML file which embeds a Flash file. On the page styling I have a #flashContent with width:100% and height:100%; the Flash object itself has width="100%" and height=100% and is inside a div with id="flashContent". The idea is to make the Flash object (which is a game) to fill the whole browser window even as it resizes.
This works with no problems on IE and Firefox, but there is a small problem on Chrome. About 90% of the time when the page first loads all that is shown is black (the page's background color). The game only appears if the user resizes the window; from then on out it works correctly.
I'd like to ask if there is anything I am doing wrong or if there is an workaround to ensure the Flash game appears correctly on the Chrome browser.
View 2 Replies
Feb 10, 2012
I have created a popup window in a flex website and I wanted to load a HTML page inside that popup. I tried many ways to do it but that way unsuccessful. Can someone recommend me a approach to get this done?
View 2 Replies
Aug 2, 2010
A NetStatusEvent with info.code of "NetStream.Connect.Closed" is dispatched by NetConnection when a NetStream is closed. This seems kind of weird, shouldn't the NetStream dispatch the event? how do I know which NetStream has been closed if I have more than one running (which I do)? I need to know so I can cleanup the now dead stream.
View 1 Replies
May 24, 2010
Trying to detect a browser close event and send some data to the database when the user closes the browser window...but can't seem to get it to work.[code]
View 6 Replies
Jul 2, 2011
Is there a script in AS2 that will call a function when the SWF is closed? I found solutions, but they're all in AS3.
View 1 Replies