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


Similar Posts:


ActionScript 3.0 :: Multiple EventListeners, Modulus And Rotating Cubes?

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 http:[url]....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.Time for the script:

To create I create the grid like this:
public function FlowerMenu(){
var rowY:Number = 0;[code]........

this works, but after about 4 or 5 cubes have started rotating theperformance drops considerably.

View 4 Replies

3D Cubes - Event Listeners And Multiple Rotating Boxes

Feb 22, 2011

I've created a grid of 3D cubes using modulus, and the 3d cubes are were created from the Math and Flash tutorial. I have set up listeners so when the mouse hovers over a cube it starts to rotate:
private function setUpListeners():void {
spBoard.addEventListener(MouseEvent.ROLL_OUT,boardOut);
}
That works fine.

To begin the rotation of the cube when the mouse passes over it I have used:
private function boardOut(e:MouseEvent):void {
addEventListener(Event.ENTER_FRAME,rotateSquare);
var i:int = 1;
function rotateSquare(e:Event) {
renderView(curTheta+i,curPhi+i);
i++;
}}

I can see why this would be inefficient, as it is running the loop every every frame, and for so many multiple cubes it just lags (very badly). I should clarify, I'm hoping for the rotation to continue indefinitely once the mouse moves off the cube. Here is how I am creating the cubes onto the "grid":

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

View 2 Replies

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

Actionscript 3 :: Create A Flash Program With Consistent Performance Across Multiple Machines?

Jun 17, 2011

I want to create a flash program that tracks mouse and keyboard biometrics such as mouse movement speed, click rate, length of keystrokes and so forth. How can I ensure that if a user duplicates his/her actions across multiple machines with varying processor speeds I will record the same data?

View 2 Replies

ActionScript 2.0 :: Unable To Rotating Banner Adds?

Jun 6, 2003

How do I create an fla that rotates banners made in flash (external flash animations) upon refresh on the browser?

View 5 Replies

ActionScript 3.0 :: Create 3d Graphics In Flash Like Cubes, Balls?

Jun 6, 2010

I was wondering which is the best way to create 3d graphics in flash like cubes, balls, a 3d cake or anything.

View 2 Replies

ActionScript 3.0 :: Improve Performance By Using Multiple Air Apps?

Feb 17, 2012

I have a program that is decently complicated in one area and the rest is simple. The complicated stuff is data crunching, pretty much. Would I get an increased performance by doing the data crunching in a second app and just having it send the couple bits of info I want from it to my other app that would be the front end of the program? Or is this a dumb idea? I know air doesn't by default multi thread, so I was just trying to think of a "work around."

View 1 Replies

Performance :: AIR Printing Multiple Printjobs Or AddPage?

Jul 6, 2011

If I try to add ~70 High Resolution Sprites to a PrintJob using addPage() in a loop, I suffer a lot of slow down and performance issues.I am thinking I should perhaps create individual print jobs for each page, or maybe batch them together.

View 1 Replies

Performance :: Multiple Remote Objects - Best Practices

Oct 3, 2011

I have an application with about 20 models and controllers and am not using any particular framework. What is the best practice for using multiple remote objects in Flex performance-wise?

1) Method 1 - One per Component - Each component instantiates a RemoteObject for itself
2) Method 2 - Multiple in Application Root - Each controller is handled by a RemoteObject in the root
3) Method 3 - One in Application Root - Combine all controllers into one class and handle them with one RemoteObject

I'm guessing 3 will have the best performance but will be too messy to maintain and 1 would be the cleanest but would take a performance hit.

View 3 Replies

Flex :: Performance - Multiple Instances - Deploying Applications

Mar 3, 2011

I have a Flex application which has to be deployed in some server. The typical form of access would be invoking the URL. Should I have multiple instances of the applications running on the same server/ deploying the application in diff servers and using a load balancer for routing? If i must have multiple instances, how to do that? On a given day, the application is expected to get around 2000-3000 hits. What are all the factors to be kept in mind while deployment?

View 2 Replies

ActionScript 3.0 :: Performance - Masking And Scrolling Multiple Images?

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

Multiple Links In One Rotating Banner

Jul 13, 2010

I have a banner that I'm creating, it has 5 images that rotate via motion tweening. I've created an invisibile button (and also attempted to create multiple buttons) so that when you click on a specific image it will bring you to that URL. So far I have only gotten it to work for the final URL. No matter which image I click on, it only brings up that last URL.

Here is my code:

btn1.addEventListener(MouseEvent.CLICK, buttonClickHandler1);
function buttonClickHandler1(event:MouseEvent):void {
navigateToURL(new URLRequest("http://www.google.com"));
}

[Code]....

View 1 Replies

Professional :: Multiple URL Within Rotating Banner?

Jul 13, 2010

I have a banner that I'm creating, it has 5 images that rotate via motion tweening. I've created an invisibile button (and also attempted to create multiple buttons) so that when you click on a specific image it will bring you to that URL. So far I have only gotten it to work for the final URL. No matter which image I click on, it only brings up that last URL. Here is my code:
  
btn1.addEventListener(MouseEvent.CLICK, buttonClickHandler1);function buttonClickHandler1(event:MouseEvent):void {    navigateToURL(new URLRequest("http://www.google.com"));}

[Code]....

View 3 Replies

ActionScript 3.0 :: Rotating Multiple Objects And Every Circle Around It

Nov 17, 2011

I have an idea of a game in my head and I wan't to get somekind of functional demo of it done in flash (CS3). I've looked everywhere but couldn't find tutorial for it, as I'm not sure what I'm looking for. I'm not that good in Actionscript. I'm now trying to describe this problem. On screen there's 4 rectangles, 2 in a row. So it's 2 rows with 2 rectangles in each. between all of them theres 4 circles. If I activate a rectangle with mouse and use arrow keys to rotate it smoothly 90 degrees, 2 nearest circles rotate with it. And same thing happens with all of the rectangles.

So I'm looking for somekind of solution where rotating an object also rotates every circle around it. and when circle rotates 90 degrees with rectangle as it's center point, it can be also rotated with another rectangle. I think I can't explain this clearly?

View 3 Replies

ActionScript 2.0 :: Rotating Multiple Objects On Same Path

Dec 24, 2002

There is an example of what I'm trying to do [URL]. The only difference is that I'd like to use several different objects in my file...and not only one (i.e., ball or whatever) - but different objects with different shapes, colors....circulating on the same "path".

View 1 Replies

ActionScript 2.0 :: Method Of Rotating Multiple Movieclips?

Oct 14, 2008

The section in my code that does the rotating is in _root.onEnterFrame. Each movieclip is moved up/down an notch at a time within a 'for' loop. this loop is within a larger 'for' loop depending how many catagories to move up/down. I shall include this section of code for; i hope, better understanding

View 2 Replies

ActionScript 3.0 :: Using Modulus To Loop Thumbnails

Apr 7, 2009

I'm still pretty novice when it comes to as3 and am trying to use modulus to loop 14 thumbnails in an array. i have a property called firstThumb that keeps track of the first thumbnail being displayed and a forward and back function that looks like this

[Code]..

View 5 Replies

Professional :: Make An Object Look Like It's Rotating In 3D With Multiple Images?

Nov 8, 2010

I have multiple angle images of an object and I want the result to be the same as the link here. [URL] I don't know flash at all but it seems like there would be a simple program (even if I have to pay) that allows me to import the images, set the rotation speed and other settings and then hit export to .flv file or something. Does anyone know of a program to do this, or a simple method?

View 3 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

Actionscript 3 :: Exclude Repeated Modulus Values

Sep 22, 2011

I have an event firing that shows progress in a video:

[Code]....

What I'm trying to do is to send a notification to the server every five seconds, to indicate progress. I can round the seconds down to nearest integer using Math.floor. Then I can use modulus to get every fifth second. What I'm not seeing is how not to send a repeat for (e.g.) 5, since 5.02, 5.15, 5.36 etc. will all qualify.

[Code]....

View 2 Replies

ActionScript 3.0 :: True And False As Bytes Instead Of Modulus?

Sep 22, 2009

How do you find a odd or even number using bytes instead of modulus op?

View 8 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 2.0 :: Move Cubes On Stage Using Mouse?

Apr 26, 2007

My code below is used to move cubes on stage using mouse but sofar it simply isnt working. the code seems correct and ive spent days just trying to figure it out, but no luck So wondering, whether an outside view could spot the problem?

Code:
//connect, create a shared object, and connect it
stop();
user_nc = new NetConnection();

[Code].....

View 3 Replies

ActionScript 3.0 :: Odd Behavior With Modulus - Make 4 Rows And 5 Columns Of Thumbnails

Sep 22, 2010

Another thread I will hopefully resolve before someone replies. I'm making a picture gallery and putting a bunch of thumbnails in a container.

[Code]....

View 1 Replies

Actionscript 3 :: Modulus / Grid Layout With Items Of Changing Size

Mar 3, 2011

I'm trying to figure an elegant way to display a certain number of items in a grid. I have a feeling the answer lies partly with modulus, but it's a little more complicated than that. I know how to lay out items in a grid based on a set number of columns. Something like this:[code]but what I want to do is set things up such that if there is only one item (j=0), the image covers the entire available area (stage.Width and stage.Height or, for simplicity, 1000px, and 500px). If there are 2 items, there should be 2 columns, with the images taking up half the width of the stage and all of the height (500x500), 3 items - 3 columns (300x500), 4 items - 2 columns & 2 rows (500x250), and so on, keeping a balanced grid layout but decreasing the dimensions of the items and increasing the number of rows in some sort of logical and balanced manner.

View 1 Replies

ActionScript 3.0 :: Use Papervision Or Five3d For The Main Cubes Of The Menu?

Jul 24, 2010

I've seen today this website. [URL]..It's really simple but it's really great. Can you guys please tell me if the use papervision or five3d for the main cubes of the menu? also because the font optimization is really great so i don't know what library they have used...

View 8 Replies

ActionScript 2.0 :: Collision Detection - Nine 3d Cubes Floating Around The Stage?

Nov 17, 2004

At the moment I have a flash movie which consists of nine 3d cubes floating around (but confined to) the stage. Whenever they collide with each other they should bounce off in opposite directions. It DOES do this but not every time! A lot of times the cubes will interact with each other in a movement I can only describe as a "judder". I've uploaded the flash file.

View 1 Replies







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