Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Flash's ActionScript - expensive operations and optimization.

Flash's ActionScript - expensive operations and optimization.
Thread Tools
Junior Member
Join Date: Oct 2001
Location: Los Angeles
Status: Offline
Reply With Quote
Oct 19, 2002, 05:52 PM
 
I am new to programming in Flash's ActionScript and have a question about the speed of Flash's operations.

I've written a 3D object renderer (to see if it could be done) and it works great! It's just really slow on objects with more than 150 verticies. I want to try to optimize my algorithms. Here are some of the intensive operations I do. I'm hoping someone could tell me where to focus.

1. Reading XML files of about 50 - 400k. -- does parsing take quite a lot of time?
2. Many 2D array operations. (especially matrix multiplication)
3. Creating of temporary variables (some are 2D arrays) happens quite often in recursive functions. Am I slowing Flash down with heavy allocation? Would it be better to have global variables used for swapping?
4. Heavy function calling.
5. Drawing many lines to the screen.
     
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Oct 19, 2002, 06:28 PM
 
Have you visited the forums of Flashkit?

http://www.flashkit.com/board/index.php
     
Junior Member
Join Date: Oct 2001
Location: Los Angeles
Status: Offline
Reply With Quote
Oct 19, 2002, 06:53 PM
 
Hey thanks. I'll try that place out.
     
Senior User
Join Date: May 2001
Location: Nottingham, UK
Status: Offline
Reply With Quote
Oct 21, 2002, 06:49 AM
 
i think you'll probably find ultrashock.com more useful
     
Junior Member
Join Date: Sep 2002
Status: Offline
Reply With Quote
Oct 21, 2002, 09:15 AM
 
A quick question; are you using Flash MX?

Don't change the temp variables in the function calls unless you use them extensively throughout the movie. I've found that flash handles math and function call very well. The area that seems to give Flash a problem is movement of multiple movie clips. No matter how small the movie clips are Flash seems to hit a performance wall. It has to do with the memory allocaton it uses. Macromedia has a document that goes into a little detail on data sizes of various elements http://www.macromedia.com/desdev/mx/..._standards.pdf
     
Junior Member
Join Date: Oct 2001
Location: Los Angeles
Status: Offline
Reply With Quote
Oct 21, 2002, 02:39 PM
 
I am working in FlashMX.

As for anoetic's advice on movieclips, I actually only have one frame. I just need it a space to draw my lines into. Nearly everything is data driven by the XML file.

You can check out the working concept at:
http://www-scf.usc.edu/~gelliott/test.html

-- make sure you click on the flash image so your key strokes are noticed. The only way to interact with it right now is with the keypad. I know the cube is kind of basic. It can run with the standard teapot (sort of the "hello world" of graphics)-- but it takes about a minute to do the math and display (the model has over 1000 verticies).

Anyhow, I think I am going to add some trace functions displaying the time so I can track down where most of my code is spending time. I may end up dropping the perspective calculations.

Another question: anyone know any good resources on VRML?
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 06:14 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2