all groups > flash (macromedia) > may 2006 >
You're in the

flash (macromedia)

group:

Optimizing flash


Optimizing flash TonyDevin
5/30/2006 11:04:59 PM
flash (macromedia):
Hey all --

I've been into flash development for some time now. I've read a lot about
attempting to optimize your flash file as far as file size, processor
intensity, etc.

As I further my development, I have been running into more and more
problems/issues with speed. Some of my more recent stuff gets DESTROYED on
older machines with slower processors. I have also noticed a huge performance
decrease from OSX. I have a macbook pro with bootcamp and am able to see that
it is not hardware related. Is it usual for a mac to how much slower playback
than a PC?

The current site I have in development (as listed below) is a prime example of
not knowing why the file is running so slow. I have a ton of question I am
hoping someone can answer... If anyone with a great knowledge of flash
optimization could assist me I would be forever grateful.

Here is a site rough which is getting horrid playback on OSX/Older machine
(less than 2.0ghz):

<a target=_blank class=ftalternatingbarlinklarge
href="https://http://67.105.132.131/Expirationdatethemovie.com/dev/activeArea/in
dex_build.php">Expiration Date</a>

Our main site, <a target=_blank class=ftalternatingbarlinklarge
href="http://www.bullseyecreative.net">Bullseye Creative</a> has also
experienced some slow down depending on the client machine.

Here are some question I have:

PNGs VS JPGs: I know PNG increases file size, but does animating a PNG take a
lot from the processor? Does OSX treat PNG different than how XP might? Does
allowing a PNG to use bitmap smoothing affect it in anyway?

ActionScript: How much can you affect processing speed with AS? I try to
always minimize my code, stay away from intervals and close them whenever
possible, are there any red flags with AS?

Frame Rate: Animation looks like hell at 12FPS, it?s the truth, and unless
you are doing banner ads it just looks horrible. Is 20/24fps standard for more
intensive flash sites? What sort of affect does this have on the playback
speed?

Blending Modes: Do they decrease playback speed? I know they are restricted
to Flash 8, but if you have a BW logo would a JPG w/ Blending Mode set the
Multiply (to remove the white) save processing power rather than a transparent
PNG?

FPS: Is there a known method for displaying frames per second within the SWF?

Video: Embedded VS Progressive. I am often working with FLV for video.
Other than file size, is there a difference between embedding an FLV within the
SWF and allowing for progressive download? I am most interested in preserving
the proper FPS, though control over the playhead is important to me as well.

I know these are a lot of questions, some of them I know half the answer to,
some of them I have no idea, I would just really like to hear from the
community what solutions have been found.

Also ? are there any web resources dedicated to very specific optimization
questions? Thanks so much!

Tony DeVincenzi

Re: Optimizing flash TonyDevin
5/31/2006 3:22:09 PM
Can anyone shed some light on this?

Re: Optimizing flash 2m
5/31/2006 6:18:31 PM
To put i bluntly, you just expect too much.

I'm not an expert on all of your questions (maybe not on one of them at all)
but I try to share my understanding with you:

Flash was first and foremost a player for web-conent and it's succes depended
on two things, the plugin being very small to download, and making animated
contene possible that also was fast to download.
A third thing was probably the fact that it just worked in 99% of cases the
same regardless of browser or operating system.

Even if a lot of features have been added, it's still where flash has it's
roots.

Your problems are mostly due to the fact that you use to big images. Too much
pixels to calculate.

While most other software that plays large pictures in fast succesion (videos
or 3D games for example) make extensive use from very specialices hardware aka
videocards flash-player uses (more or less) only the processor. Even very new
processors are slow (in terms of number crunching) compared to modern video
cards.

Why doesn't Flash-player use those cards then, well several reasons, the three
probably most important are, that the player itself would ingres a lot in
download (compare the downloadsize of quicktime, realplayer or windows mwedi
player to flash Player), that there are a lot of differnt systems and cards out
ther and it would get harder to make a player that runs on evry plattform, and
browsers limit the direct access to the clients computer's hardware for
security reasons.

For the mac issues there as several reasons, one sad trouth is that most
companies spent more time optizing code for windows than for mac (90% vs. 5%
Users) an other thing is that in your example on the mbp (I do love mine too
;-) ) Under windows the player will be not only optimized but also run nativly
ont the intel-chip, while under OSX the not so optimized player will be slowed
by rossetta.

And ther seems to be an issu with safari running more than one swfs in one
page.

So what to do?

If ever possiple try to make your swfs a little smaller.
Actionscript if not badly codeed shoulnd't be a issue.
Once imported/loade into Flashes internal workuings ther should be no
significant difference in jepg vs. png and I doubt
that blending modes will be faster than transparency.

All in all I don't think that you can do very much more than hope for faster
computers, new players that will make use of GPUs.

And framerate counters are out for grabs in dozends it shouldn't be too hard
too goole them

try to
Re: Optimizing flash TonyDevin
6/1/2006 3:38:04 AM
2m, thank you for your extensive response.

I appreciate your comments, and points. I am very aware that I expect to much
out of Flash (it's my nature to expect more than what the software is capable
of ;).

I've spent a lot of time looking into this over the last few days and have
found some reasonably decent resources for optimization techniques. Many of
them relate directly to the more obvious points which you make about file size
etc, whilst some of them more specific (I had no idea wmode tranparent was
taking so much processing power!).

I've been able to significantly increase the speed of my site & assume is will
only get better as time goes on.

For anyone intrested, here is a great resource for more indepth technical
questions concerning speed optimization:

<a target=_blank class=ftalternatingbarlinklarge
href="http://www.blog.lessrain.com/?p=118

Thanks">http://www.blog.lessrain.com/?p=118

Thanks</a> again 2m.

Regards,

Tony DeVincenzi
BullseyeCreative
Re: Optimizing flash Rothrock
6/1/2006 3:54:28 AM
WMODE is Satan. Don't use it unless you want trouble.

For everything except the smallest of video, you should use external FLVs.
They allow the player to better manage the memory. Additionally you mention the
framerate. I'm not sure what your issue there is, but with externally loaded
FLV files you can have different frame rates between the video and the swf
file. That can allow you to optimize both for what you need. And there is no
tradeoff between external and controlling the playback, so I don't really know
what that is about.

A lot of folks like PNGs because they have transparency. But just because it
is invisible doesn't mean it isn't there! So pngs with transparency will be
more intensive that jpegs without.

Why would you avoid setInterval? Trying to do ridiculous things like 1
millisecond intervals should be avoided, but they are great. The best use if
for things that need to be check less often than the frame rate. Often I have
things that only need to happen at the most maybe 10 times a second. But I
don't want a frame rate that low. By using an interval I'm freeing up resources
compared to using an onEnterFrame or something like that. And yes it is good to
clear them when no longer needed.

Personally I use a framerate of 21 most of the time. Way back in the day that
was one of the "magic" rates that played better on the Mac platform. I don't
think it really matters anymore, but I"m used to it and it meets my need.

There are several different ways of displaying the FPS. There should be some
tutorials out there but I don't know any off the top of my head.
AddThis Social Bookmark Button