Solved

SWFObject Slowdown ?

Posted on 2009-05-03
6
922 Views
Last Modified: 2013-11-11
Hi,

I have this code in my HTML:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%" id="fullscreen_ex_8" align="middle">
  <param name="allowScriptAccess" value="sameDomain" />
  <param name="movie" value="g3.swf" />
  <param name="quality" value="high" />
  <param name="scale" value="noscale" />
  <param name="bgcolor" value="#000000" />
  <embed src="g3.swf" wmode="gpu" quality="high" scale="noscale" bgcolor="#000000" width="100%" height="100%" name="fullscreen_ex_8" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>


I converted it to use with SWFOBJECT:

<script type="text/javascript">
        // <![CDATA[
            var so = new SWFObject(g3.swf', 'g3', '100%', '100%', '8', '#000000');
            so.useExpressInstall('swfobject/expressinstall.swf');
            so.addParam('menu', 'false');
                  so.addParam('scale', 'noscale');
                  so.addParam('wmode', 'gpu');
                  so.addParam('quality', 'high');
                  so.addParam('allowScriptAccess', 'sameDomain');
                  
            so.write('content');
        // ]]>
</script>



both work, but there is a significant performance lose with the swfobject version, somehow it is passing some obscure parameters to flash player that cause things to degrade.

my SWF has a lot of screen movement and thus is sensitive to performance

thank you
0
Comment
Question by:moshem
  • 2
  • 2
  • 2
6 Comments
 
LVL 10

Expert Comment

by:bugada
Comment Utility
My be a cut&paste error, but there is a missing quote  in the first line before g3.swf.
Anyway I don't think it's related with your problem.

What i can see is that in your OBJECT there isn't the wmode parameter, whil in your EMBED or jscript is there.
May be you're testing you app in IE that uses the OBJECT...
0
 
LVL 1

Author Comment

by:moshem
Comment Utility
I need to put it in the object too ?

but it works much faster with the object version, and the swfobject version has the wmode parameter...
0
 
LVL 6

Expert Comment

by:biyik
Comment Utility
There are 3 wmode values : Window, Opaque and Transparent.
In your code you are using a "gpu" value, which is not valid.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 10

Accepted Solution

by:
bugada earned 500 total points
Comment Utility
I think you can try to remove it from the swobject, and biyik, as of version 10, this is a valid value, but the optimization in somes cases can slow down the execution of the swf.

Just my 2 cents.
0
 
LVL 1

Author Closing Comment

by:moshem
Comment Utility
thank you!
0
 
LVL 6

Expert Comment

by:biyik
Comment Utility
I didn't know, thanks bugada.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now