Creating a Sniffer using the Flash Connection Kit and DreamWeaver Greg Shorts CIS 254.
-
Upload
bruno-norman -
Category
Documents
-
view
219 -
download
0
Transcript of Creating a Sniffer using the Flash Connection Kit and DreamWeaver Greg Shorts CIS 254.
JavaScript to Detect Flash
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
var ok=false; document.MM_returnValue = false;
with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
ok=(plugins && plugins[plgIn]);
} else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
else ok=autoGo; }
if (!ok) theURL=altURL; if (theURL) window.location=theURL;
}
//-->
</script>
Body Statement
<body onLoad="MM_checkPlugin('Shockwave Flash','page1','page2',false);return document.MM_returnValue">
Necessary VB Script
<script name="Used by MM_checkPlugin" language="javascript">
<!--with (navigator) if (appName.indexOf('Microsoft')!=-1 &&
appVersion.indexOf('Mac')==-1) document.write(''+'<scr'+'ipt language="VBScript">\nOn error resume next\n'+'MM_dir = IsObject(CreateObject("SWCtl.SWCtl.1"))\n'+'MM_flash = NOT
IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))\n</scr'+'ipt>');
//--></script>
Dreamweaver Behavior
• The previous Javascript is also available as a DreamWeaver Behavior– Default in MX– Select “plug-in from the behaviors menu– Give directions for pages with and without
Flash
What is the Connection Kit?
• The Macromedia Flash Detection Kit is a combination of software and techniques that enables web developers to deploy content created with Macromedia Flash software in such a way as to make sure the user's experience is as seamless as possible. There are four different methods to choose from, depending on the user's needs and familiarity with the different technologies being used.
Types of Connection Kits
• Dreamweaver Behavior Method
• ActionScript Method
• HTML Method
• Standalone Player Method – For devices like cell phones
Getting the Connection Kit
• Available from Macromedia Developer Site– http://www.macromedia.com/support/flash/pla
yer/flash_development_readme– Requires Registration
• For class the file is available at www.digitalfabrications.com/flashd.zip
Using DreamWeaver Method
• Flash Detector behavior must be installed on machines
• Site must be created in Dreamweaver
• Use Behavior Window to access behaviors
• Insert Macromedia Flash Detection Behavior
Behavior Description
• Applied to a web page that appears before any Flash content is displayed on your site. – Usually this is the index.html or default.html.
• Redirect the user to the appropriate page, based on decisions specified in the behavior.
• User will not see the page before they are redirected. Therefore, there is no need for graphics or text on this page.
Behavior Choices (cont.)
• Macromedia Flash Content URL– This is the URL of the web page that will
contain your Flash content.
• Alternate Non-Flash URL – This is the URL for alternate non-Flash
content or an upgrade page. The behavior will point to this page when the user doesn't have the required version of Flash.
Behavior Choices (cont.)
• Minimum Flash Player Version– This is the version of Flash that is required to
play your Flash content.– The selection allows you to include version,
major revision and minor revisions.
Behavior Choices (cont.)
• Allow Auto-Update – Check this box if you want to auto-update the
Macromedia Flash Player. – Currently only applies to Microsoft Internet
Explorer on Windows. – Rude
Deployment Instructions
• The following files should be uploaded to your server:
• flash_detection.swf - this name should not be changed.
• yourfile.html - this name is often "index.html". This is the file to which you applied the behavior.
• any HTML file specified in altContentURL • any HTML file specified in flashContentURL
Creating the Flash_detect.swf File
• Open Flash
• Open New Flash Document
• Save as Flash_detect.swf
• Open Action Development Panel
Whirlwind Tour of Action Development Panel
• Jump Menu
• Actions Tool Box
• Actions Information
• Action Parameters
• Script Pane
• Pinning
Action Script Types
• Frame– Apply to frame– Initiate when frame entered
• Object– Apply to objects– Initiate when object selected or acted upon
Flash Detector
• Frame based Action Script
• Detects Flash Version and Revision– Sends user to Flash Content URL if correct
version is present– Sends User to Alt Content URL if no flash or
wrong version
Set Variables
• URLs
• Versions– Content Requirement– Latest Versions– Require Latest Version
• Auto Install– IE only
Break the Version String into usable parts
– Must use depreciated commands to allow Flash 4.0 to use.
Check against latest Version
• Uses Latest Version Variables– Script Entered Variables– Script must be changed if Macromedia
updates Flash Player
• Only used if requireLatestVersion eq “true”