IOS :: Drawing Images Off-Screen Results In Performance Drop
Sep 19, 2011
Im writing an IOS game using AS3. Here's the problem- I have an image on the screen that moves around. When the image's y value goes negative (the image is partly off the screen), the frame rates bottom out. I've gone over my code pretty thoroughly, even threw together a few test projects just to experiment. In all the test I do, whenever there is an object that is off screen, even partially, the frame rates drop. It's making scrolling backgrounds impossible. BTW, I'm using Packager for iPhone and a 3G (not 3GS). Frame rates are normally 24 with no problems
View 2 Replies
Similar Posts:
Mar 4, 2012
I have been making huge strides in learning Flex and I am very much enjoying it, however,one thing I cannot find is how to bind results from a query in Flex. I have managed to create lists etc no problem but when I try to bind one specific value to a variable, it does not work.First off, here is my PHP function:
public function getRepnameByUsername($itemID) {
$stmt = mysqli_prepare($this->connection, "SELECT * FROM $this->tablename where Username=?");
[code]......
View 1 Replies
Oct 22, 2010
Am currently working on a tool created by a colleague of mine and would like to improve performance. Basically, it's a tool for drawing on screen and uses a combination of Sprites and the Graphics class to draw a line segment every time the mouse is moved when the mouse button is down. Here is the drawing bit:
// on MouseMove
protected function drawLine(e:MouseEvent):void {
if (currentTool.thickness > 0){
//pen
var line:Sprite = new Sprite();
line.graphics.lineStyle(currentTool.thickness, currentColour);
[Code] .....
As you can see, it checks if the line 'thickness' property and draws if it is and erases if it isn't. I did think of using a technique similar to blotting here where it'd draw to a bitmap but I'm not sure this'd give the performance boost I want or if, indeed, there would be any way to have an eraser function. The drawing itself works nicely - this isn't the problem, it's the performance of the subsequent 'drawn' sprites.
View 3 Replies
Mar 29, 2010
I am working on a drag and drop application. I've gotten quite far despite my inexperience with AS3.
So here's the dealio...
I have a drag and drop interface that includes 6 library items. 4 of the library items have 38 instances, one of the items has 8 instances and the final one has 4 instances.
In my one and only scene there is a movie clip with an instance name of content_MC and a class assignment of MC that contains all of the above listed objects as well as the image that users drop the objects on to.
There are also 2 buttons on the stage, in the one and only scene, for resetting the drag and drop and a print button for printing the contents of the content_MC movie clip.
I'm having an issue with printing the results of the drag and drop that are contained in content_MC.
Right now when I print, the PDF output I get is only of the original state of the drag and drop; so no drag and drop results just the interface prior to drag and drop.
I of course need the final results to be printed.
Here's a link to the application in its current condition...
[URL]
Here's the code I have for everything...
ActionScript Code:
import flash.printing.PrintJob;
// Register mouse event functions
content_MC.a1.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
[Code]....
View 2 Replies
Jun 19, 2010
I am working on programming a drag and drop interaction where you drag items onto an area and can print the results.Anyone know of any examples of this already out there? It needs to be in AS2.0 and published to Flash Player 7.
View 0 Replies
May 27, 2011
I am using a custom Flex skin to create an active blur/frosted glass effect on the background of floating Panels, TitleWindows, and other containers (similar to http:url....). There is a background image in the Application skin, and potentially any number of other components above and below the active blur component. Here's some relevant code within the skin:
public static const BLUR_FILTER :BlurFilter = new BlurFilter(16, 16, BitmapFilterQuality.HIGH);
private var _bitmapFill :BitmapFill = new BitmapFill;
private var _matrix :Matrix = new Matrix;[code]....
Unfortunately, the performance of this when the component is being resized, and especially when moved, is poor. There is noticeable drag delay and overall slowdown, and this is with only one popped-up TitleWindow in the test application. There is especially poor performance when components inside the TitleWindow are changed (button hover states, etc.)I've attempted to optimized a little bit by avoiding reinstantiation of the blur filter, bitmap fill, and matrix, but this has had little or no effect. I removed the blur at one point, just drawing the Application to a bitmap, and the performance is still poor, so it's clear that it's mostly the BitmapData.draw() call.
I've read about using scrollRect and cacheAsBitmap, but I'm not sure where to apply these properties (or other optimizations I'm not aware of) within the Application or its components.
View 2 Replies
Jan 13, 2012
We have an AIR application running on an Apple iPad, that occasionally experiences sudden drop in its performance. The frame rate drops from 60fps to 2fps and it never recovers from that. this is only reproducible on iOS 4, but never on iOS 5 - we've checked that on two identical iPads (generation 1)the performance drops occasionally, but always happens when we switch between apps - from our app to another and back very rarely, the performance drop also happens on first start of the app this performance issue does not happen in renderMode=CPU, but this mode doesn't work for us, because the rendering is ugly, especially on rotated bitmaps.
View 1 Replies
Jun 8, 2011
Is there any way to turn off all special FX's and especially dropShadow's on all objects inside the application ?
View 2 Replies
Dec 15, 2006
i am building the results screen of a quiz and for some reason, my traces to these arrays are showing as undefined. Here is the code on the Results frame....
[Code]...
View 1 Replies
Mar 19, 2009
I have a little quiz, where at the end the results are calculated and the test takers are taken to a results screen which calculates their results.
I have AS3 code creating the message screen, and the score is calculating ok. I want to capture the users name on the results page, and this is not working. I have attached the code which calculates the score and where I added the instance name of the test box when they login. I get an error when I publish. The error is "Access of undefined property name name_text"
obviously this is not how to capture that information, but not sure how to do it. Again, I have a text box with the instance name of "name_txt", and I am trying to capture that data on a results screen using AS3.
Code:
feedback.text = "Congrats" +name_txt+ "on finishing the exam!
Your score is "+Math.round(score*100)+"%
You may now close the exam window.";
View 1 Replies
May 10, 2010
I have a Flash movie that runs full screen, but with StageScaleMode.NO_SCALE so that the actual movie size is the same as it would be if I ran it not full screen.
There is a huge difference in performance between full screen and no full screen. This is despite the movie taking up the same screen space.
how I could improve performance at full screen?
View 8 Replies
Sep 20, 2011
Any Info about using the new Twitter API's to search images with a hashtag and display the results?
View 2 Replies
Jan 14, 2010
We are using Adobe Flash to produce software for an interactive touch screen kiosk.I have 55 1024x768 24 bit PNG images.I want to play them (fairly regularly...once every 5 minutes or so) without them stuttering but can't find a good dependable way, main problem is I think Flash GC's them after an arbitrary idle period.Reason I'm doing this is because the FLV attempts we have made aren't sufficiently high quality.I also looked at using a H.264 but that obscures any other assets placed over it.I have a number of text fields sitting over this animation. The machine in question is a Core2 Duo, 4GB Ram, GeForce 9500GT.
View 1 Replies
Oct 29, 2009
I have a comic book style game where you have to complete the story by dragging the right frame to the right place, but when I drag the frames pieces of the frames left behind and sucked on the screen. The frames are loaded swf files.
View 2 Replies
Oct 27, 2011
Basically I'm building an image gallery. Rather than thumbnails, it just loads the full size images and masks them, so they can all be scrolled through. (I made an intuative preloader for this). It all works fine. The only problem I see there being is performance, when there's quite a few images.Could anyone suggest a way to reduce the load, and make it a bit more memory friendly? I (stupidly) thought that masked out images wouldn't render. I think I'm wrong though? I thought maybe I could make the images off the screen set to 'visible = false'?
View 4 Replies
Jul 18, 2010
I am writing a program in AS3 that gradually draws a line following some points on a bitmap. Firstly I draw the bitmap on the screen ( load into a sprite, add the loader to the sprite and the sprite to the screen) Then I draw the line on it segment by segment.( add an empty Sprite to the screen and then do lots of lineTos)Sometimes my line drawing process goes wrong and I was hoping to see where this happens, but Flash Player 10 seems to have some clever optimisation, so that it waits to put the display on the screen until after it has calculated all of the sections of the lines. This means that if it goes wrong it never displays the picture, and I cannot see what is going on. This is very frustrating when I use the debugger in Flash as it does not even refresh the screen when it reaches a break point how to turn this optimisation off and force it to draw stuff onto the screen as it is calculated.
View 12 Replies
Jun 13, 2010
The game involves HP (health points) and i made it decrease everytime i am hit by a bullet. The problem is: How can i draw the Health points (a string) on screen?
View 9 Replies
Oct 5, 2010
I'm trying to debug AS3 code on production. I have no access to trace(), can't write to disk or open a socket. What I want is to display something on screen.
With AS2 I could just access _root and create a text field with my trace data.
how I can pull this off with AS3? My class extends Object, it is not a sprite and is never added to a parent display object.
View 1 Replies
Jun 23, 2009
Basically, I have a BitmapData object which is acting as a virtual screen.
I have a MovieClip which I want to render to the bitmap using the same transformation as though the bitmap were the screen. However, the MovieClip is not attached directly to the root
The BitmapData.draw() method takes a Matrix as an optional parameter, which I think I need to set as the MovieClip's localToGlobal transformation matrix. However, I don't know how to obtain or construct this!
View 2 Replies
Apr 11, 2011
I am very new to flash, and don't fully understand the drawing system yet. I want the user to be able to draw boxes on the screen. This is the code I am using:
Code:
Select all//Declare boxes
var boxes:Array = new Array();
var num:Number = 0;
//Drawer
var drawer = new Sprite();
drawer.graphics.lineStyle(1,0x00ff00);
this.addChild(drawer);
[Code] .....
How can I have the user see the box as they are drawing it, moving with the mouse, rather than just drawn at the end? Are flash's drawings just one time, or can they be dynamically drawn and refreshed?
View 1 Replies
Jan 10, 2011
I am drawing a rectangle at 0,0 with a line-style-thickness of 4px. It has height 100% and width 50%. The right-hand edge has a border 4px wide, but all 3 other sides are only 2px, suggesting the mid-point of the edge is classed as the border. Why isn't the edge drawn 'inside' the rectangle?
View 1 Replies
Mar 13, 2010
In my Flex application, using a custom control, I am making a JSON request to grab some data from the server. My rendering depends on this data such as knowing how many boxes to draw. How can I either force the rendering to wait until I've got the data before drawing to screen or have the boxes draw once we receive the data? I have an event listener for Event.COMPLETE for my JSON request and in there, I call methods that add to the control. I've tried invalidateDisplayList but that doesn't seem to do anything for me?
View 1 Replies
Oct 13, 2009
What I'm trying to do is to get the mc to drop from the top of the screen and go all the way down and disappear.
private var Firefox_mc:mcFirefox;
Firefox_mc = new mcFirefox;
Firefox_mc.x = Math.random()*800;
Firefox_mc.y = 10;
addChild(Firefox_mc);
I tried to make a for loop and just increase the y axis but for some reason it didn't work.
View 6 Replies
Sep 12, 2011
this is what i'm trying to accomplish; With a click on a movieclip (cannon_mc)a shot is being fired (ball_mc)
The longer mouse is down, the speed of wich the ball is fired with should increase.My question to you is;
What is the most efficient way to accomplish this? With a timer or something like this;
[Code]...
View 2 Replies
Jan 11, 2011
I'm devloping some library classes for flocking/steering behaviours on large numbers of objects (2000+). I'm finding that at < 500 instances, performance is reasonable. As the numbers increase, framerate bogs down.
I've seen remarkable performance with libraries such as Flint or Box2D with ridiculous #'s of particles / objects, so it should be possible to optimize / refactor my code to be a bit better.
I'm aware of the basic optimizations, such as bitwise operations and optimized for loops. Are there any more fundamental approaches I should be considering? For example, currently each instance is a vector-based MovieClip. Would working with BitmapData be more efficient?
View 1 Replies
Nov 4, 2011
Will I take a big hit in performance using nested ViewStacks? Should I strive to handle all navigation in one ViewStack and push children manually or will the affected performance be negligible?
eg.
<viewstack>
<tabnavigator />
<tabnavigator />
<tabnavigator />
</viewstack>
View 2 Replies
Mar 19, 2012
We have a medium size Flex 3.6 application that contains around 20 different page views (managed via a single lazy ViewStack) each having multiple components. Most use custom renderers.All model data is loaded at startup and changes to model instances are communicated via binding and/or collection change events.Once the user has viewed each page at least once, all page views are instantiated and happily listen to update events.Which in effect means that each time a model instance changes, all interested views receive that event and compute derived data or trigger item-renderers.I have tested and confirmed this behaviour in a proof-of-concept application. Even when setting a list to being invisible, it still listens to collection change events and invalidates any renderer affected.What would you do?
View 1 Replies
Sep 26, 2011
As the heading dictates, i want to place bitmap files on the faces of the 3D object that i have created.Basically i found this tutorial code on a 3D rotating cube that is able to be rotated by the mouse. I have modified it to change its shape from a cube to a 'plane' or rectangular style object.
Code:
var vertsArray:Array = [];
var facesArray:Array = [];
[code].....
View 0 Replies
Jul 20, 2011
what kind of scripts / AS3 he used to draw line images on flash header?[URL]
View 2 Replies
Apr 6, 2012
nevermind guys, got it sorted
View 2 Replies