Flex :: Programmatically Close An AIR Application?

Feb 17, 2011

I would like to know the correct way to close an AIR application programmatically. In my Spark WindowedApplication I have:this.addEventListener( Event.CLOSING, shutdownApp );and of course an implementation of the shutdownApp method (which basically tidies up temporary files).his works fine for the top-right close button of the window. However I also have functionality which needs to shutdown the application. Within the code I have called:NativeApplication.nativeApplication.exit();However this doesn't trigger the Event.CLOSING method, and so my temporary files are not cleared up. Should I not be calling nativeApplication.exit ? If so, what should I call instead? I'd rather not have to call my shutdownApp method before the NativeApplication.exit() as this doesn't feel quite so elegant.

View 2 Replies


Similar Posts:


Flex :: Flex - Programmatically Close A DateField Component?

Oct 17, 2010

I'm using a dateField component (with editable = true) as an itemEditor in a dataGrid. Interestingly, when editing the textInput part of the dateField it doesn't seem to react to an ESC keydown as I would expect, i.e. reload old dateField value and give up focus. This seems to be standard for most other components, but not for as most other components do.

How would you go about implementing such behavior? I can listen to keydown == escape on the TextInput portion, but just realized that I don't know how to tell dateField to give up focus and politely close - in fact I'm not even sure that's the right strategy (maybe I should work at the DataGrid level?

View 1 Replies

Actionscript 3 :: Programmatically Close The File "save" Window In Flex?

Dec 9, 2011

I am using alivePDF to generate pdfs from my flex application. When I click on the save pdf button on my flex application, a "save as" window pops up which allows me to browse to the location where I want to save the pdf file. Its the same window that pops up when we try to save any file in notepad, word, etc. I want to programatically close this window if the user is idle for a given amount of time. The code that I am using for saving the pdf is as follows.

var file:FileReference = new FileReference();
var genPdf:PDF = new PDF();
genPdf = generatePDF(target, generateXML,str);
file.save(genPdf.save(Method.LOCAL), 'graph.pdf');

View 1 Replies

Flex :: Programmatically Enter Edit Mode In Tree Control Inside Application

Jan 17, 2010

I have a Tree Control inside my Flex Application which I want to edit on a doubleclick on a tree item. I found the properties doubleClickEnabled= "true", doubleClick="startEditMode()", and editable="true". With these functions I can detect a double click and I can change the editable property to true based on a double click. The problem is that after I double clicked on a Item i have to click once more to really enter the edit mode. That doesn't seem to be intuitive at all..

View 3 Replies

Actionscript 3 :: Programmatically Close A Specific Window?

Jul 6, 2011

I am using a HTMLloader class in my application and would like to close the window programmatically when certain events occur.[code]...

View 1 Replies

Actionscript 3 :: Remove/close Multiple Popup In Flex Application?

Mar 15, 2012

if we open lot of popup during browsing(web) or in an AIR application, how remove them at once?

View 2 Replies

ActionScript 3.0 :: Programmatically Close An Open File Dialog?

Nov 4, 2010

Is there a way to programmatically close an open file dialog?

My current problem is this: I have a small file download program. When the user clicks a button, it will pop-up the Save As dialog. The problem is, if the user closes the Firefox window, the dialog stays open. And when the user wants to close that dialog, he or she can't anymore. It won't respond. The only way is to kill the plugin process (on Linux anyway).

So is there a way to monitor opened file dialogs?

I've tried to get the browser to notify the Flash app that it's closing, which works great. The problem is even if the app knows it should close the file dialog, it can't...I've tried setting the FileReference to null, using delete on it, calling the garbage collector, etc., nothing seems to have any control on that dialog.

View 3 Replies

ActionScript 3.0 :: Event For Application Close?

Oct 27, 2009

I need to save some settings files before the application closes. What event should I listen on? I have tried to listen to Event.EXITING but from the code below I only see "exit" in the output window like 1 out of 5 times. It is thus not working

[Code]...

View 3 Replies

ActionScript 3.0 :: Close A Pop-up Window Without Closing The Whole Application?

Jun 1, 2011

i've used this code but it turns out that it closes the whole application:
 
import flash.system.fscommand;btn_exit.addEventListener(MouseEvent.CLICK, goExit);function goExit(evt:MouseEvent) {fscommand("quit");}

View 22 Replies

Flex :: 4 - Scroll Flex Spark Datagroup To Maximum Amount Programmatically

Jul 6, 2011

I have a spark skinnable component which contains a datagroup with images. The datagroup is scrolled by hovering the mouse over it. Everything works fine except one thing: after I change the datagroup provider, I need to scroll down automatically. The problem is the images are not loaded immediately after I set the provider so (contentHeight - height) does not yet represent the actual maximum scrolling position. Is there an easy way of telling the datagroup to scroll down as its content loads? Because the workaround seems to be not so straightforward. This is the code for scrolling(thumbnailStrip is my datagroup):

[Code]...

View 1 Replies

Flex :: Programmatically Load Images In It?

Dec 7, 2009

I need to load several images as Bitmap or BitmapData objects. The images are hosted outside the Flex project, and they're referenced by an external configuration file, so I can't embed them. Because the images won't be displayed directly to the user (they're being added to a PDF that is generated for download), creating a grouping of Image objects, attaching them to the application, and waiting for their LoadComplete handler to fire seems inefficient.

What is the best way to load these images into an application? Programatically load images in it?

View 1 Replies

Flex :: Multiple Selection Programmatically?

Mar 17, 2010

I have I datagrid, on which I want to select multiple rows on a other user interaction than the one intended by the Programm. I'm wondering, whether I can programmatically select some rows depending only on code?

View 1 Replies

Actionscript :: FLEX Add Stroke Programmatically

May 4, 2010

how can I assign the stroke to my LineSeries, programmatically in Actionscript ?<mx:LineSeries stroke="{new Stroke(0xCC33CC, 2)}"/>How is it in Actionscript? LineSeries.stroke doesn't exist

View 2 Replies

Flex :: Programmatically Add Views To A Viewstack

Jun 10, 2010

I'm trying to figure out how to in as3 (not mxml) add views to a view stack.For example I have a view component like so[code]I've being trying to add it to a viewstack in the following way.[code]I'm aware I have to assign ID's but for now I just want to get the view in there

View 2 Replies

Flex :: Write A DataGrid Programmatically?

Aug 10, 2011

I have this code but I am trying to convert this to actionscript so I render this programaticaly but I failed. how do i write this on AS?

<mx:DataGrid allowMultipleSelection="true" id="dg_disk" dataProvider="{people}" height="100%" width="100%" selectedIndex="0" x="50" y="50">
<mx:columns>
<mx:DataGridColumn dataField="name"

[Code]...

View 5 Replies

Actionscript 3 :: Add A Flex Skin Programmatically?

Sep 2, 2011

I have various components that are skinned through a programmatic skin. The skin class references a singleton class that holds various colors to be applied to different aspects of the component. The singleton class has default colors set to variations of black/grey etc. I'm loading in custom colors from an XML file that are then loaded into the singleton. I'm applying the custom skin through a css stylesheet that is included in the main Application mxml.

The problem is that when the swf initially loads, the components that are drawn on screen are black and don't reflect the changes in color loaded from the XML file. I have some dropdown windows that show on button clicks and those dropdowns do reflect the correct colors from the XML file. Therefore, the system is working correctly, but the initial drawing of components obviously happens before the XML is loaded and applied to the singleton.

My question is, is there a way to apply a skin to an element programmatically by calling the constructor?

I have this in my css file:

.PanControlsBackground {
borderSkin:ClassReference('skins.buttons.PanControlsBackground');
}

[Code]....

or something to that effect? This way, I can remove the loading of the skins in the css file and control when they are instantiated to ensure that the correct colors are applied before displaying the various components.

View 1 Replies

ActionScript 2.0 :: Close Browser By Clicking On Close Button Embedded Swf?

Jul 27, 2009

i want to close browser by clicking on close button embedded swf. I have tried fscommand("quit"), but which is not working on browser.

View 9 Replies

Flex :: Programmatically Add A Set Of Controls With Some Amount Of Pixels Between Them?

Nov 8, 2009

I need to programmatically add a set of controls with some amount of pixels between them. I can't seem to find how to do this in the Flex docs.

View 4 Replies

Flex :: Programmatically Stream Audio With NetStream?

Dec 31, 2009

In Flex you can stream microphone audio to an FMS/Red5 server using NetStream.attachAudio, which requires a Microphone object. Is it possible to stream audio through the NetStream from somewhere other than a Microphone? For example, from a file/embedded resource?

The reason I'm asking is that I'd like to be able to run automated tests that don't require using an actual microphone.

View 1 Replies

Flex :: Blue Selection Of Datagrid Row Programmatically?

Jan 28, 2010

I have a question I came up with 3 days ago about how to do the blue underlining of a datagrid row programmatically. I thought to have found the solution, with just adding the column and row Indexes to the datagrids editedItemPosition Property.It turned out, that this is just practical if you want to be able to edit the grids row right away. But what if I just want to underline it with the blue color?Additionally how to detect that a list based Item got this kind of selection? es there a event to detect that? whats the name of this kind of selection?

View 1 Replies

Flex ::remove Validation Programmatically From Component?

Feb 11, 2010

How to remove validation programmatically from flex componentThis is my method

public static function validateRequired(txt:TextInput, errorMessage:String="This field is required"):Boolean
{

[code]....

View 3 Replies

Asp.net :: Programmatically Upload Larger Files In Flex?

Mar 10, 2010

I created an application as part of an ASP.NET site. I would like to receive error notifications in my inbox whenever something goes wrong with that flash application.As I do not have control over our mail server (which has a different domain name), I cannot establish a cross domain policy allowing me to send error emails to my inbox.Instead, thought I'd send a request to an ASP.NET handler that sends an email on behalf of the flash app.Now the problem: the error report should include a screenshot of the flash application at the time the error occurred. The FileReference class however only allows file uploads with user interaction (browse dialog) and cannot be used programmatically to send the screenshot to my ASP.NET handler. The plain old POST back only allows files up to ~200K.

View 1 Replies

Flex :: Programmatically Scroll To The Bottom Of A Mx:TextArea?

Jun 22, 2010

Consider the following mx:TextArea <mx:TextArea id="textArea"/>

periodically being updated with new lines of text using ..
textArea.text += newLineBeingAdded + "
";

how do I make sure the textarea is scrolled down to the bottom so that the last line added is visible to the user?

View 4 Replies

Flex :: How To Programmatically Enlarge Buttons HitArea

Aug 13, 2010

How to programmatically enlarge a flex 3 button's hitArea. Is there some function that I can override? There is no function in the button class called hitArea. What I have done is, I have created a programmaticskin for a button. The form of the skin consists out four arrows. In between the arrows there is nothing (meaning transparent). Because of the way the skin is shaped, it's difficult to click on the button. The skin has alter the buttons hitArea. What I'm looking for is a way to enlarge the hitArea and alter the hitArea shape in to an square. (the hit area must ofcourse still be invisible).

View 4 Replies

Flex :: Programmatically Show Tooltip Chart?

Aug 18, 2010

I have a chart with 2 line series in it.So, "Jan" (x-axis point) will have 2 Y-axis pointsThe problem :Is there anyway to force flex to show tooltip on both series simultaneously?

View 1 Replies

Flex :: AdvancedDataGrid Set Highlighted Element Programmatically?

Dec 3, 2010

I'd like to be able to tell my ADG to set a specific row to be highlighted and update the adg rendering to match such new value. Note: highlight != selected.
I thought perhaps setting highlightUID would do the trick, but I can't seem to get the ADG rendering to update.

View 1 Replies

Flex :: Make Strikethrough Text Programmatically In It?

Oct 19, 2011

Make strikethrough text programmatically in it? I know I can do this in MXML[code]....

View 1 Replies

Xml :: Programmatically Remove An Attribute Completely In Flex?

Oct 24, 2011

I am experimenting with e4x. I could programmatically add an attribute to an Xml by doing something like this :

[Code]...

now i have added a name attribute to it programmatically because even though the xml had no attribute called name, after the statement above, it automatically has one now. My difficulty now is how do i , as well, remove the name attribute i have inserted programmatically again?

View 1 Replies

Flex :: Programmatically Firing Event Listeners

Nov 10, 2011

I would like to programatically fire an event on a spark checkbox. I have a tab bar which has tabs enabled according to various checkboxes. I am loading data into these tabs. Sometimes tabs 1 and 2 will be enabled. Other times tabs 2 and 3. Other times tab 4 by itself (and all the other combinations). I have tried to enable the VBox (in action script) which is in my view stack but it seems to freeze the application. The VBox enables correctly upon user input on the check box. If I set the checkbox to be selected it does not fire the event and so does not enable the tab.

Is it possible to manually fire an event in Flex. I have tried to see if I can take the checkbox and get the event and fire it. Unfortunately I can only see addEventListener, hasEventLister and removeEventListener. There is no way of getting the events that are already on the checkbox

View 1 Replies

Actionscript 3 :: Programmatically Drag And Drop A Sprite In Flex?

Jul 23, 2009

I need some actionscript code to simulate the dragging and dropping of a Sprite, I was wondering if it is possible to do so? if it is how?

For example to simulate a click on a Sprite I can achieve with the following line of code.

sprite.dispatchEvent(new MouseEvent(MouseEvent.CLICK));

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved