SlideShare ist ein Scribd-Unternehmen logo
1 von 75
Downloaden Sie, um offline zu lesen
Bobby van der Sluis
Embed SWF files into a Web page
Why SWFObject 2?

   Web standards
   Alternative content
   Flash Player detection
   Adobe Express Install
   JavaScript API
   Easy to use
Officially supported by Adobe
SWFObject 2 ZIP file
SWFObject 2 Generator


    Publishing tool
    HTML page
    Adobe AIR 1.0 application
One solution for everybody
Static publishing


HTML to embed SWF content
and alternative content
Unobtrusive JavaScript to resolve
issues
Dynamic publishing


HTML to define alternative content
Unobtrusive JavaScript to replace this
with a SWF when the required Flash Player
and JavaScript support is available
Static publishing


Embed mechanism doesn’t rely
on JavaScript
Click to activate active content
Dynamic publishing

No click-to-activate
Easy to integrate with scripted
applications
6% of your visitors will not have
the required JavaScript support
Example 1: Hello World
Ingredients


swfobject.js
expressInstall.swf
SWFObject 2 Generator AIR 1.0
test.swf
test.swf



                  300 x 120 px
                  Flash Player 6

                v = $version;
http://code.google.com/p/swfobject/wiki/test_suite
Static publishing
Dynamic publishing
Configuring SWF content
Adobe Express Install


Mechanism built into Flash Player
Prompt to update outdated plug-in
Required: Win/Mac and FP6r65+
Optional in SWFObject
Alternative content
#1:
  Translate SWF content into HTML content
that is accessible for people without the required
       Flash Player or JavaScript support
#2:
Unobtrusive method to point visitors to
   the Flash Player download page
#3:
Create search engine-friendly content
Doesn't Google index SWFs?

   Google indexes both alternative and
   SWF content
   Not all search engines index SWF
   content
   SWF indexing is still limited: text
   and links only
The power of HTML content


       1. Descriptive
       2. Hierarchy
       3. Semantics
Make sure that your alternative content
   truly reflects your Flash content
Example 2:
Full Browser Flash
Summarizing


1. 100% width and height
2. Add CSS to get rid of default
   margin/padding and set the height
   of all parent containers for Firefox
Scaling and alignment
Manage from within SWF
Always use a resize handler
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;

stage.addEventListener(Event.RESIZE, resizeHandler);

function resizeHandler(event:Event):void {
  // e.g. center stuff
}
Example 3:
JS to AS communication
using External Interface
External Interface


    Allows two-way communication
   between SWF and an HTML page
               Flash Player 8+
                ActionScript 2
http://livedocs.adobe.com/flash/8/main/00002200.html
The example


JavaScript to ActionScript
To register an AS method as
callable from JS:
addCallback(methodName:String, instance:Object,
method:Function):Boolean
Upload your files
Summarizing


1. Register an AS method as callable
   from JS
2. Add an ID to your object element
3. Call your AS method from JS
Static publishing

Uses nested objects
Add an ID to your outer object
element only
To reference your active object
element use:
swfobject.getObjectById(objectIdStr)
Using the JavaScript API
SWFObject JavaScript API

  Focuses on publishing SWFs and
      detecting Flash Player
 Lets developers reuse SWFObject's
          internal functions
  http://code.google.com/p/swfobject/wiki/api
10 methods
swfobject.registerObject(...)
swfobject.getObjectById(...)


swfobject.embedSWF(...)
swfobject.createSWF(...)

swfobject.getFlashPlayerVersion()
swfobject.hasFlashPlayerVersion(...)


swfobject.addLoadEvent(...)
swfobject.addDomLoadEvent(...)


swfobject.createCSS(...)


swfobject.getQueryParamValue(...)
Example 4:
Getting Flash Player version
getFlashPlayerVersion


 Returns a JavaScript object that
 contains the major, minor and
 release version numbers
 MAC 9,0,124,0
The JavaScript code
<script type=quot;text/javascriptquot; src=quot;swfobject.jsquot;></script>

<script type=quot;text/javascriptquot;>

var playerVersion = swfobject.getFlashPlayerVersion();

var output = quot;You have Flash player quot; +

  playerVersion.major + quot;.quot; +

  playerVersion.minor + quot;.quot; +

  playerVersion.release + quot; installedquot;;

alert(output);

</script>
The result
Thank you!
http://www.bobbyvandersluis.com/presentations/

     http://code.google.com/p/swfobject/

Weitere ähnliche Inhalte

Andere mochten auch

Deakin University Presentation - Talis Aspire User Group February 2015
Deakin University Presentation - Talis Aspire User Group February 2015Deakin University Presentation - Talis Aspire User Group February 2015
Deakin University Presentation - Talis Aspire User Group February 2015
Talis
 
Distance Learning and Scale - Rod Rizzi, Monash University
Distance Learning and Scale - Rod Rizzi, Monash UniversityDistance Learning and Scale - Rod Rizzi, Monash University
Distance Learning and Scale - Rod Rizzi, Monash University
Talis
 
Talis Insight Asia-Pacific 2017: Reading lists: academic adoption at Griffith
Talis Insight Asia-Pacific 2017: Reading lists: academic adoption at GriffithTalis Insight Asia-Pacific 2017: Reading lists: academic adoption at Griffith
Talis Insight Asia-Pacific 2017: Reading lists: academic adoption at Griffith
Talis
 
Talis Insight Asia-Pacific 2017: Nicole Healy, QUT
Talis Insight Asia-Pacific 2017: Nicole Healy, QUTTalis Insight Asia-Pacific 2017: Nicole Healy, QUT
Talis Insight Asia-Pacific 2017: Nicole Healy, QUT
Talis
 
Monash - Talis Aspire User Group presentation
Monash - Talis Aspire User Group presentationMonash - Talis Aspire User Group presentation
Monash - Talis Aspire User Group presentation
Talis
 
Talis Academic Adoption Presentation February 2015
Talis Academic Adoption Presentation February 2015Talis Academic Adoption Presentation February 2015
Talis Academic Adoption Presentation February 2015
Talis
 
Talis Insight Asia-Pacific 2017: Anne Kealley CEO, Caudit
Talis Insight Asia-Pacific 2017: Anne Kealley CEO, CauditTalis Insight Asia-Pacific 2017: Anne Kealley CEO, Caudit
Talis Insight Asia-Pacific 2017: Anne Kealley CEO, Caudit
Talis
 
Talis Insight Asia-Pacific 2017: Victoria University of Wellington
Talis Insight Asia-Pacific 2017: Victoria University of WellingtonTalis Insight Asia-Pacific 2017: Victoria University of Wellington
Talis Insight Asia-Pacific 2017: Victoria University of Wellington
Talis
 
Talis Insight Asia-Pacific 2017: Craig Milne, Griffith University
Talis Insight Asia-Pacific 2017: Craig Milne, Griffith UniversityTalis Insight Asia-Pacific 2017: Craig Milne, Griffith University
Talis Insight Asia-Pacific 2017: Craig Milne, Griffith University
Talis
 
Insight Asia-Pacific 2017: Talis Keynote
Insight Asia-Pacific 2017: Talis KeynoteInsight Asia-Pacific 2017: Talis Keynote
Insight Asia-Pacific 2017: Talis Keynote
Talis
 
Talis Insight Asia-Pacific 2017: Rodney Tamblyn, Talis
Talis Insight Asia-Pacific 2017: Rodney Tamblyn, TalisTalis Insight Asia-Pacific 2017: Rodney Tamblyn, Talis
Talis Insight Asia-Pacific 2017: Rodney Tamblyn, Talis
Talis
 
Talis Insight Asia-Pacific 2017: Kim Tairi, AUT
Talis Insight Asia-Pacific 2017: Kim Tairi, AUTTalis Insight Asia-Pacific 2017: Kim Tairi, AUT
Talis Insight Asia-Pacific 2017: Kim Tairi, AUT
Talis
 

Andere mochten auch (17)

Deakin University Presentation - Talis Aspire User Group February 2015
Deakin University Presentation - Talis Aspire User Group February 2015Deakin University Presentation - Talis Aspire User Group February 2015
Deakin University Presentation - Talis Aspire User Group February 2015
 
Distance Learning and Scale - Rod Rizzi, Monash University
Distance Learning and Scale - Rod Rizzi, Monash UniversityDistance Learning and Scale - Rod Rizzi, Monash University
Distance Learning and Scale - Rod Rizzi, Monash University
 
Talis Insight Asia-Pacific 2017: Reading lists: academic adoption at Griffith
Talis Insight Asia-Pacific 2017: Reading lists: academic adoption at GriffithTalis Insight Asia-Pacific 2017: Reading lists: academic adoption at Griffith
Talis Insight Asia-Pacific 2017: Reading lists: academic adoption at Griffith
 
Talis Insight Asia-Pacific 2017: Nicole Healy, QUT
Talis Insight Asia-Pacific 2017: Nicole Healy, QUTTalis Insight Asia-Pacific 2017: Nicole Healy, QUT
Talis Insight Asia-Pacific 2017: Nicole Healy, QUT
 
Monash - Talis Aspire User Group presentation
Monash - Talis Aspire User Group presentationMonash - Talis Aspire User Group presentation
Monash - Talis Aspire User Group presentation
 
Talis Academic Adoption Presentation February 2015
Talis Academic Adoption Presentation February 2015Talis Academic Adoption Presentation February 2015
Talis Academic Adoption Presentation February 2015
 
Talis Insight Asia-Pacific 2017: Anne Kealley CEO, Caudit
Talis Insight Asia-Pacific 2017: Anne Kealley CEO, CauditTalis Insight Asia-Pacific 2017: Anne Kealley CEO, Caudit
Talis Insight Asia-Pacific 2017: Anne Kealley CEO, Caudit
 
Talis Insight Asia-Pacific 2017: Victoria University of Wellington
Talis Insight Asia-Pacific 2017: Victoria University of WellingtonTalis Insight Asia-Pacific 2017: Victoria University of Wellington
Talis Insight Asia-Pacific 2017: Victoria University of Wellington
 
Talis Insight Asia-Pacific 2017: Craig Milne, Griffith University
Talis Insight Asia-Pacific 2017: Craig Milne, Griffith UniversityTalis Insight Asia-Pacific 2017: Craig Milne, Griffith University
Talis Insight Asia-Pacific 2017: Craig Milne, Griffith University
 
Insight Asia-Pacific 2017: Talis Keynote
Insight Asia-Pacific 2017: Talis KeynoteInsight Asia-Pacific 2017: Talis Keynote
Insight Asia-Pacific 2017: Talis Keynote
 
Talis Insight Asia-Pacific 2017: Rodney Tamblyn, Talis
Talis Insight Asia-Pacific 2017: Rodney Tamblyn, TalisTalis Insight Asia-Pacific 2017: Rodney Tamblyn, Talis
Talis Insight Asia-Pacific 2017: Rodney Tamblyn, Talis
 
Talis Insight Asia-Pacific 2017: Kim Tairi, AUT
Talis Insight Asia-Pacific 2017: Kim Tairi, AUTTalis Insight Asia-Pacific 2017: Kim Tairi, AUT
Talis Insight Asia-Pacific 2017: Kim Tairi, AUT
 
The Desirability of Connected Products
The Desirability of Connected ProductsThe Desirability of Connected Products
The Desirability of Connected Products
 
SNPデータ解析入門
SNPデータ解析入門SNPデータ解析入門
SNPデータ解析入門
 
Open Source - Hip not Hype
Open Source - Hip not HypeOpen Source - Hip not Hype
Open Source - Hip not Hype
 
Advances in schizophrenia
Advances in schizophreniaAdvances in schizophrenia
Advances in schizophrenia
 
Molecular Marker-assisted Breeding in Rice
Molecular Marker-assisted Breeding in RiceMolecular Marker-assisted Breeding in Rice
Molecular Marker-assisted Breeding in Rice
 

Kürzlich hochgeladen

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

SWFObject 2 masterclass