Flex Web Application - Prevent Framerate Drop When Window Is Invisible?
Nov 20, 2011
So there's been a new "feature" in the flash player since version 10.1, which reduces the player's framerate to 2 fps when the application window is out of view. This is good news for performance, but it can break some functionality, such as the Timer class.
I have an application which uses a Timer to display a countdown. Given the nature of the application, it is required for the Timer to complete its countdown even if the user is not there to see it. Imagine that you need to give the user only 10 seconds to perform a task. If the user minimizes the window halfway through the counter, they can take as much time as they want and still have 5 seconds left when they return to the window. This apparently can not be avoided with the newer flash players.
In Air applications there is the backgroundFrameRate property which can be set to prevent this behavior, but this is part of the WindowedApplication class, so it seems that it is not available in a web application. Does anyone know a way to keep a constant frame rate even when the window is not visible?
My Flash game targets 24 fps, but slows to 10 on slower machines. This is fine, except Flash decides to throttle the queue of incoming MouseEvent and KeyboardEvents, and they stack up and the Events fall behind. Way behind. It's so bad that, at 10 fps, if I spam the Mouse and Keyboard for a few seconds not much happens, then, after I stop, the game seems to play itself for the next 5 seconds as the Events trickle in. Spooky, I know.
Does anyone know a way around this? I basically need to say to Flash, "I know you think we're falling behind, but throttling the input events won't help. Give them to me as soon as you get them, please."
I was wondering, if I have two list boxes, and I want to drag and drop between both of them, how do I prevent the user from dragging onto the same list (thus duplicating the item? I cannot have a situation where that is the case
how would you prevent dragging for some items of your List or DataGrid?
Let's say I had a list with two items: 'Tom' and 'Jerry'. Only 'Tom' should be dragable, not 'Jerry'.
Ideally I had a 'isDragEnabled(item:Object):Boolean' function, which is being queried by the drag source.
My difficulties start with the fact that the 'dragStart' event handler has a null value for the dragSource, so right from the start I find it hard to find out what the drag-start is about..
PS There have been a few discussions on preventing or canceling a drop, but I haven't seen much about preventing the drag start, hence this question.
How do I prevent a user from dropping an item outsider a folder? My dataProvider is only 1-level deep.It seems that with a DragEvent handler or DragDrop handler I can find the data of the item I'm dragging, but not where I'm dropping ( so I can prevent it ).
I have an AdvancedDataGrid with editable parameter to "true". My problem is that after a successfull drag & drop, the item is being edited and I don't want this to happen. I tried to create a custom advancedDataGrid with this:
I wish while i am draging and moving arround TitleWindow instance and a specific event occure to simulate drop of the window, and not further moving been possible for a few seconds.It is very unusual question but it will be more than handy each point to a solutionP.S: The whole idea is as follow : When i am draging a TitleWindo instace with the mouse, and if the TitleWindow hit the border of it's parent container then to drop the TitleWindow, and not further moving is possible (simulating release mouse button). If i wish to move it again, then i should click the TitleWindow title again and grag it.
From what I can gather, the resize property of a Flex application is set in the XML config file[code]...
However, if I set this attribute to true, is there a way to turn this off dynamically at runtime? For example, my application has two view modes - mini and maxi. I would like to prevent the end user from being able to resize the application when in mini mode. I tried prevent the resize using the following code but it does not seem to work[code]...
I am working on an Adobe AIR Application. The size on Application window is 800X600 and is contains border container and border container contains many controls. What I want is to if user re-sizes the application then that container should also be re-sized according to scale. i.e If user maximizes or minimizes the window then that border container should also be maximized or minimized respectively.
when I have a movieclip that gets to the end of its playhead and calls the stop() command, the framerate drops from 24 to about 16. This movieclip contains other movieclips that continue their animations. I assumed with one less timeline running the performance would actually increase. There is no other code running, just a movieclip containing other movieclips that suddenly slows when it hits stop().
I'm currently trying to make a little game but I experience now some loss of framerate while adding "bullets" in the gameI'll not enter in the full code source as it will take some time but basicallyI got a mainGame class, a Player class, and a bulletClassthe mainGame class contain the game loop working like this, main timer cecks:-loop function of the Player class, checking if space is pressed,if it's pressed a bullet is displayed with this line in the player class:Code://main_class is the MainGame class and the container is the main displaymain_class.container.addChild(new Bullet(x, y, otation,main_class));//then the bullet add itself in a _bulletArray of the Main Gam class-loop function of the bullet Class, for each bullet cointained in the _bulletArray,it moves the bullet from some X, and if it's out of view of the screen it destroying itself from the array and with a removeChild of the display list like this:
I have created one drag and drop application in flex and i am trying to load my application[swf] in flash.But i am getting error while start the drag.[code]
I am creating an application that will allow users to model system information by allowing them to Drag and Drop objects from a Flex Tree into some sort of canvas/grid ie: like a whiteboard application eg: Visio/MS Powerpoint etc. The application requires the following functionality:
Drag and drop items from a Tree to some sort of canvas/grid Move items within the canvas/grid Delete items from the canvas/grid Resize items in the canvas/grid Save the position of the items to a database Has good performance in terms of rendering components with images I am not sure which Flex component is best suited to the canvas/grid. I was thinking of using either:
Datagrid or (can't drag/drop to cells easily though) Grid or (can drop to cells via gridrow/griditems mxml tags) TileList or (problem with this is that it rearranges all items when you move 1 item) some other list? I think the grid would suite my purposes the best as it would enforce objects to be placed within a gridrow/griditem.
I'm using mx:WindowedApplication, I'm wondering how I can skin the title bar and close/minimize button for the window. I can see application like Pandora One is using it and setting transparency. Any pointer to a doc?
I want to set the default window size for a flex application that runs with a standalone player.I set width and height to 100% to be able to get the ResizeEvent and being able to adjust the layout if the user changes the window size. But I'd like to also define a default size.
I am using flex4, I am seeking the answer to create multi window web application. My application is some sort of complex, currently I only know using PopupManager to create a new window.Should I create each MXML for each window that I want to instantiate? And then load the mxml and put it into the stage? Is there any tutorial describing that? I want the program modular and easy to manager, extend.
The current way I am using is use Group to group up all the controls inside a window, and if user want to open that window, I will display the group and bring it to the front. Is it the right way to do windowing? But I can't support drag.
I want to know if there is any native support for draggable window, or dialog?
Also till now all the controls are put inside a single mxml file, is it possible to put one window(or one group) to be a separate mxml file?
I am developing flex air application.I have to implement hot-key functionality in air application.
For example whenever user press any two keys like ctr and S keys the open flex air application.and whenever user press any two keys like ctr and q keys then close flex air application.
I have an AIR application. It should be moved around the screen with the mouse. In order to achieve this I use the event: this.stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown, true,-2);
It should be activated with the lowest priority compared to inserted elements for example those that should be scrolled, clicked, etc. I tried the solution shown below with the event priority set to -1 because there might happen 2 different events and my moving application event should be the last one to be serviced or shouldn't be serviced at all.
I have a Flex application that builds and runs from Eclipse without any problems. I've created an Ant build based on the sample provided by Adobe and builds the application and packages it up into an AIR application. No errors occur during the build process and an AIR file is created.The problem is that when I install the AIR application and run it, there is no UI at all. The process is running because I can see it in Task Manager but I can't see the app window. I've commented out all of my initial code so just the first window should appear but still nothing.
Check this code onClipEvent (load) { k = .2; damp = .9; grav = .1; [Code] ...... Cos after giving the code to mc its not responding in any terms except the drag and drop to the invisible button..
I'm building an AIR application. Basically, what I'm looking to do is using navigateToUrl() to open a browser window, assign it a "name" and then, send variables to that newly opened window using the POST method.
EDIT : I need the window to be visible, this is why I absolutely need to use the navigateToUrl() function
I already know that I CAN'T DO something like this, that the AIR application will send the variables using the GET method...
var vars:URLVariables = new URLVariables(); vars.myVar = "Hello my friend"; var req:URLRequest = new URLRequest("http://example.com/my-page.php"); req.method = "POST":
I've made a scrollable window that basically scrolls some text and images. I'd like the images to link to another site but I'm having trouble getting the invisible buttons to scroll with the images.Here's the AS I'm using for the scrollable content:
stop(); scrolling = function () { var scrollHeight:Number = scrollTrack._height;
I have a flex 3 application that creates an Image from a canvas which the user draws on. I use the ImageSnapshot class to create the image
var imageSnap:ImageSnapshot=ImageSnapshot.captureImage(myCanvas); var imageByteArray:ByteArray=imageSnap.data as ByteArray;
I want the user to be able to print or save the image. I can use the following code to print the image but flex does not provide good control over printing across multiple pages
var printJob:FlexPrintJob=new FlexPrintJob(); printJob.start(); printJob.addObject(myCanvas, FlexPrintJobScaleType.SHOW_ALL);
I would like to display the image in a browser window so that the user could print it using the built in browser functionality or right click on the image and save it. Can this be done without requesting server side code to do it?
I have an Flex 4 application (not AIR) which has some floating windows that act essentially as modeless dialogs.Right now, if two of these are open at once they function as siblings which are both active and whose controls are enabled for user interaction.I now need to maintain some notion of which one is "active" in the application. I don't want to /disable/ the non-active ones so as to blur them or prevent input on their controls.
I basically want to replicate basic OS window management: when you click or type into a control in one window it comes to the front and its title bar looks "active" and the others then look "inactive". Just like with a bunch of explorers in Windows.
I often have the problem that after shifting my AS windows around some times the window becomes highter than my screenheight. The window can only be resized in height when dragging the bottom of the window. But as it is offscreen I can't resitze it. I have to load a new workspace or dock it on some small window group and then drag it away (works only with some windows).
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:
I want to send vars to one PHP page and I dont want to open restult in new win. I want only send data to PHP and store it in my dtb. How can I make it in the same window?