Graphics Reference
In-Depth Information
that was 300 pixels wide and 250 pixels high, the Profiler would cause the
player to read the height as 150 pixels. In order to force the player to read
the correct information, you would need to hide the Bandwidth Profiler
and then retest your file. This has been fixed, but I felt it was worth
mentioning in case you are working in one of those previous versions.
HTML and JavaScript
Since your banners won
t be running as standalone applications or
even by themselves in the browser, I think the container HTML and
JavaScript is worth discussing. Like I was saying earlier in this chapter,
pretty much all the ad-serving companies will have their own HTML
that you won
'
t have direct control over. However, what you do have
control over is the HTML that you
'
ll use for testing your banners before
sending them on to the ad-serving companies, and there
'
'
s no reason
you shouldn
'
t stick with standards-compliant code. Also, let
'
s not for-
get that we
'
ll need to have some kind of fallback in case the users
don
'
t have the required version of the Flash Player or
-
prepare for
shock
if they have the Flash Player disabled, blocked, or not installed.
Now, if you
-
'
ve been working in Flash for more than a couple of
years, you
ll likely remember the days of the object and embed ele-
ments and the
'
method (where the embed element
was actually inside the object element). And then one day a certain
little lawsuit came along and played great influence on the way we
had to show .swf files in Internet Explorer if we wanted a smooth
user experience. I have no scientific data to prove it, but I believe
that lawsuit also helped boost the popularity of a couple of excellent
JavaScript solutions by the names of SWFObject and Unobtrusive
Flash Objects (UFO). Since then, the authors of the two solutions
twice-cooked
-
-
Geoff Stearns and Bobby van der Sluis
decided to combine their
efforts and eventually released SWFObject 2 as a project on Google
Code. If you
'
d like to learn more about the history of SWFObject,
check out the project at http://code.google.com/p/swfobject/. Now
let
'
s discuss what SWFObject is and how to use it.
SWFObject
SWFObjectisanice,clean,simple way to not only get your Flash
content into the page but have plenty of control over it as well. As
I
m writing this, it is at version 2.2, and when you download the
swfobject_2_2 zip file, you
'
ll find several files including sample
HTML files to show you the two different implementations (static
and dynamic), files for running an express install of the Flash
Player, and the swfobject.js file itself. First, let
'
s discuss the two pub-
lishing methods and a few words about them from the project site.
'
Search WWH ::




Custom Search