ActionScript 3.0 :: Is There A Time When Removing EventListeners Slows Performance?

Mar 13, 2012

I am trying to improve the performance of a mobile application and I am trying to trouble shot what part of my code/application is causing a performance problem on some mobile/tablet devices. The application has several frames, with anywhere from 3 to 15 event listeners in a frame. At first I was not removing an event listeners. Now I am removing the event listeners as the user leaves the page.[code]I was wondering could removing too many event listeners cause performance issues? Also, is there a an easier, more efficient way to remove event listeners?

View 1 Replies


Similar Posts:


Performance :: Flash - Application Slows Down [removeChild]?

Jul 30, 2010

I have a problem with my flash application because after a while that it is running, it eventually starts to slow down. My application involves something that needs to be replicated with the addChild() method. I've read some info on the internet which states that the cause of the slowing down or the lag in the application is that the removeChild() does not remove the child from the memory

View 2 Replies

ActionScript 3.0 :: Flash Multiple EventListeners, Modulus And Rotating Cubes - Unable To Get Performance

Feb 23, 2011

I've created a grid of 3D cubes using modulus, and the 3d cubes are were created from the Math and Flash Tutorial, if you are interested it is here.What I am trying to accomplish (and it works, just the performance is lousy). All the cubes in the grid are inactive until the mouse hovers over them, then they start to rotate, and once the mouse moves off them they continue to rotate...

So to create the grid of cubes:

Code:
public function FlowerMenu(){
var rowY:Number = 0;
for (var i:int = 0; i < 190; i++) {

[code]....

So, this works, but after about 4 or 5 cubes have started rotating the performance drops considerably. I can imagine creating that many EventListeners isn't a good idea, but I can't see any other way of doing it.

View 3 Replies

ActionScript 3.0 :: Removing EventListeners When Unloading?

Aug 19, 2009

I have main.swf and content.swf. I load content into main. When I try to unload it gives me error, due to the fact that in my content.swf I have MouseMove event and this event is causing this error:

ActionScript Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at content_fla::MainTimeline/onLoop()

How to properly kill all eventListeners?

My main.swf code:

ActionScript Code:
var holder:Sprite = new Sprite();
addChild(holder);

[Code].....

I did some research and it seems quite an issue - especially when trying to remove, enterFrame, mouseMove or stage listeners. Im using CS3.

View 2 Replies

ActionScript 3.0 :: Removing Active EventListeners At Runtime

Mar 4, 2009

Is there anyway through which we can know that which event listeners are currently active and we can remove them at runtime? I am trying to create drawing board which have different shapes to draw. But I have to add event listener with for every shape and have to remove previous listeners. I want to remove the all active listeners in one go. Is it possible.??

View 3 Replies

AS3 :: Removing EventListeners Without Knowing Amount Or Names?

Apr 28, 2010

First shortly about how my site works: When a link is clicked it checks if something is already displayed in either the Left or Right side of the screen (the website looks like a book, so I have a left page I want to display information on and a right page). If there is already something showing it hides it and displays the new object, together with this it enables all the buttons within that object (I have separate functions to set up each object).

An example of such an EventListener would be:

pathTo.Button1.addEventListener(MouseEvent.CLICK, function():void {showText(side, object)});

What I'm trying to do is to remove all the previous set EventListeners without having to create separate functions for removing the links inside every object as well.

How do I remove all EventListeners on all objects inside another object? The only variable I want to store is the object containing everything. There are however not always EventListeners within the objects.

View 3 Replies

ActionScript 3.0 :: Flash - Removing EventListeners Using A For Loop?

Jan 16, 2012

I have 20 buttons on my stage, and rather then have 'removeEventListener' for each button, i wanted to use a loop to do so. Heres what i have done.

Code:
//array containing the buttons instance names.
var soundArray:Array = new Array();

[code].....

View 14 Replies

ActionScript 1/2 :: Run Time MovieClip EventListeners?

Jun 6, 2009

I'm working on an image gallery which builds dynamically at runtime, simple enough.imageList is an array loaded with the images to display.

var imageList:Array = _root.images.split(",");var imageArray = new Array();var count = 0;for( var i = 0; i < imageList.length; i++ ){  _root.createEmptyMovieClip("myMC"+i, (i + 1)); _root["tmpMCL"+i] = new MovieClipLoader();  imageArray[i] = new Array();  ima

[code].....

View 6 Replies

ActionScript 3.0 :: Does Removing Listeners Make Much Difference To Performance

Feb 19, 2012

almost every single one of my classes, starts with the same method. An event listener in the constructor for EVENT_ADDED_TO_STAGE. Then i do all my actual intialising in a beginclass function that listener runs.I've not generally been removing these listeners though. i never thought it would make a difference since i'm only adding these objects once, but i wonder if there's a performance element. it could be for example, that all of these listeners add an extra check each, ehenever any object is added to the display list.

View 1 Replies

ActionScript 3.0 :: Improve Real Time Graph Performance?

Mar 20, 2011

I'm working on a simple real time graph. The data is polled every 50ms, and each poll translates to a line one pixel wide, (data_point) pixels high. The graph scrolls such that new data is on the right, and the oldest values eventually fall off the left.

My solution is embarassingly brute-force, in that I just use theMC.graphics.clear() and a loop of lineTo()s for every graph refresh. While this displays correctly (and I can control the refresh rate to mitigate the CPU burn), it should be painfully evident why I want to move away from this method.

I want to programatically scroll or pan the entire graph one pixel to the left (and drop the leftmost line), and then just draw one new line on the right, but I can't figure out where to start. Assuming such a thing is possible in AS3, would someone be so kind as to point me in the right direction?

View 2 Replies

Performance :: Measure Flex/Java App Response And Rendering Time?

Sep 19, 2011

We have Flex/Java app with a typical scenario:

Clicking the button
Preparing request
Sending request to the backend
Receiving a response from the backend
Rendering the response

How can I measure time from the start of step 1 to end of step 5?

View 1 Replies

Flex :: Check The Performance & Memory Usage Of Flash Application At Run Time?

Aug 17, 2010

I have a flash application which consist of Grid Components, Button, Label, and Combo-box Components. All these components are used more than 70 times(simultaneously) with in the application. So Its takes too much of memory. So How can I test the memory usage of each component at the time of running. Is there any plug-in available for browsers to find the memory usage. I'm using flash CS3 and ActionScript 3.0. The application suppose to run in browsers.

View 4 Replies

Removing Object From Stage After A Period Of Time?

Jul 28, 2011

I have an item that I want to appear on stage (see code below); but only for 5 seconds. After 5 seconds I want the object to disappear. I know that I can use removeChild to remove the object, but I don't know how to keep the object on the stage for a specific amount of time.

Here's the code:

stop();
//Add a movie clip to stage
var sample_mc:LibrarySymbol = new LibrarySymbol();

[Code].....

View 2 Replies

Removing A Movieclip From Stage After A Set Amount Of Time

Jun 26, 2009

I've got a movieclip animation which is added to the stage at the start of the .swf.Its an introduction to the game, and the user is encouraged to click on the movieclip to start the animation.Once the animation is finished I'd like the movieclip to be removed from the stage.Do I need to setup some sort of event handler which listens out if the movieclip has finished then start a function once its finished to remove it from the stage?  Which methods look out for movieclips finishing?

View 1 Replies

Performance :: Performance - Hold MouseDown To Increase Speed/power?

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

Performance :: Optimization - Improving Performance With Large #'s Of Objects

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

Performance :: Flex - Using Nested ViewStacks Cause Performance To Decrease?

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

Performance :: Improve Flex Performance For Invisible Views?

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

Actionscript 3 :: Removing An Event Listener As Well As A Sprite At The Same Time?

Apr 4, 2011

I'm having trouble removing the an event listener as well as the sprite at the same time. I currently get an error:

TypeError: Error #1009: Cannot access a property or method of a null object reference.

And if I comment out removeChild, I have no error but, obviously, the sprite remains on the screen. how I can rid myself of that error?

//Bullet extends Sprite Class
bullet:Bullet = new Bullet();
mc.addChild(bullet);

[Code]....

View 3 Replies

ActionScript 3.0 :: Removing A Movieclip From The Stage After A Set Amount Of Time?

Jun 26, 2009

I've got a movieclip animation which is added to the stage at the start of the .swf. Its an introduction to the game, and the user is encouraged to click on the movieclip to start the animation.Once the animation is finished I'd like the movieclip to be removed from the stage.How do I go about doing this? Do I need to setup some sort of event handler which listens out if the movieclip has finished then start a function once its finished to remove it from the stage?

View 3 Replies

ActionScript 2.0 :: Removing Multple Movie Clips At The Same Time?

Jul 22, 2009

I have a small, hidden button that runs the following code.

Code:
on (rollOver) {
for (k=0; k<50; k++) {
duplicateMovieClip(this.snow, "snow"+k, k);
}
inside my movie clip, I have this

[Code]...

View 6 Replies

Android :: Performance - Taking Too Much Time To Finish The Activity In Android?

Jul 20, 2011

I have loading the webview in my Activity. the Web content is having some flash content. when i try to finish the Activity. Its taking too much time. the screen goes to blank screen for little time and resuming to the app.

View 1 Replies

ActionScript 3.0 :: Focus Events - Removing Text One Character At A Time

Oct 26, 2009

I'm trying to put the text back into a text field on FOCUS_OUT one character at a time. On FOCUS_IN, I want to remove the text one character at a time.

Here's the basic code:
major.text = "ActionScript 3.0";
major.addEventListener(FocusEvent.FOCUS_IN, inFocus);
major.addEventListener(FocusEvent.FOCUS_OUT, outFocus);
function inFocus(event:FocusEvent):void {
major.text="";// want to clear the text one character at a time
} function outFocus(event:FocusEvent):void {
major.text="ActionScript 3.0"; // want to put the text back in one character at a time
}

I attached a fla. that does this in ActionScript 2.0, but I'm trying to do this in ActionScript 3.0.

View 6 Replies

ActionScript 3.0 :: Dynamically Adding And Removing Multiple Instances Of Same MCs After Certain Time

Dec 14, 2009

After a little break in AS3 I'm back... and facing a problem. For a school project I'm trying to make a side scroller game in which the player automatically moves right and has to avoid branches.Basically, depending on how well you do your speed (var) gets updated. After certain 'distance' (fake of course, as the player stays centered) I would like a n instance of Branch_MC to appear. Also, when that instance's x property reaches -20 I would like it removed.I'd need approximately 135 branches so creating variables isn't really an option.

View 8 Replies

ActionScript 2.0 :: Removing A Dynamically Created Movieclip After Time Interval?

Jul 13, 2011

every so often a movieclip is dynamically created using actionscript from the main timeline. It has the instance name of

Code:
["spark" + i]

each time one is created "i" goes up 1. so I end up with spark1, spark2, spark3, spark4 etc. etc.What they need to do is play through an animation (about 4 frames) and then destroy themselves.

View 1 Replies

Professional :: Touchscreen TV App Slows Down?

Sep 5, 2010

We have created an interactive Touchscreen using flash CS4 - [URL]
 
The Touchscreen is already in the showroom. Every morning it is restarted. By midday the whole application slows down to the point were it becomes very slow. I presume this is a caching problem. In order to resolve this we close down IE and restart it (playing the SWF file through Internet Explore on full screen mode). Once it has restarted it plays at the correct speed.
 
I have thought about setting up windows 7 to reboot IE and have the flash file restart every few hours however a client may be navigating through the display when it reboots it self. I would prefer to avoid this if possible.

View 3 Replies

ActionScript 3.0 :: My Website Slows Down

May 10, 2010

Working on my website - I notice it works on the first run, But if i go back into my menus and gallerys it slows down and down.[url]...

View 4 Replies

Flash 10 :: App Slows Down Substantially?

Oct 21, 2010

I have a setup where I'm handling the enterFrame event of my application. In the handler, I draw two rectangles (one fullscreen, one small orbiting one) using the graphics member of an mx.containers.Canvas object.

After a few minutes of execution, the app slows down substantially. Given enough time, it will come to a lowly crawl. I get the same result regardless of release/debug build on chrome, IE, and Firefox using Flash Player 10.1. Presented below is the Flex project in question:


ActionScript Code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="..." [code].....

I had to replace namespace URIs (with "...") since i can't post URLs yet.

View 3 Replies

IDE :: SWF Slows Down When Key Get Pressed And Hold

May 28, 2009

My actual project I need a event configuration wherein I can hold a keyboard key down and move mouse. While trying to implement this, I recognized that the flashplayer begins to lag, saving actions in buffer and playback them when the KEY_DOWN event is already over...

For example I have a
PHP Code:
stage.addEventListener(KeyboardEvent.KEY_DOWN, keyDownHandler, false, 0, true);

And in the handler I got only this:
PHP Code:
private function keyDownHandler(event:KeyboardEvent):void {
if (event.keyCode == 88) manoverDrive = true;


I also do have a
PHP Code:
stage.addEventListener(Event.ENTER_FRAME, enterFrameHandler);

In this enterFrame I do animation for a movieclip that is animated regarding the mouse and keyboard action and events. Now when I hold down any kind of key the animation of this moviclip gets slown down if I hold down the key for 10 seconds and then lift the keyboard key the mouse movements I made before gets somehow saved and the animation got a playback of the mouse movements. I removed the keyboard eventlistener and the behaviour stays. Is that an official flash player Bug?

View 3 Replies

ActionScript 3.0 :: Repeated LineTo Slows Down

Sep 19, 2009

I am making a demo where an object is moved around the screen with a line tracing its movement. The speed of this noticeably slows down over time. I tried it both with an enterFrame and by setting an interval. I imagine it has something to do with the graphics class vector drawing and garbage collection. Here is a simplified version for demo/testing. If you run it you will see the line drawing slow down over time. Is there a way to achieve it without the slow down?

I read somewhere of a technique where you use the bitmap data class to draw on a stage-sized bitmap.(I've never programmed the bitmap data class before).

Here is the code:

code: var lineX:Number = 100; var lineY:Number = 100;
var deltaX:Number = 10; var deltaY:Number = 10;
var lineDrawing:MovieClip = new MovieClip();
this.addChild(lineDrawing);

[Code].....

View 4 Replies







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