https://github.com/webcaetano/swf-jquery
jQuery plugin that easily manipulate SWF based on SWFObject
https://github.com/webcaetano/swf-jquery
Last synced: 10 months ago
JSON representation
jQuery plugin that easily manipulate SWF based on SWFObject
- Host: GitHub
- URL: https://github.com/webcaetano/swf-jquery
- Owner: webcaetano
- License: mit
- Created: 2015-04-18T18:23:10.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-05-01T18:43:54.000Z (about 11 years ago)
- Last Synced: 2025-02-14T10:12:04.354Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://webcaetano.github.io/swf-jquery/
- Size: 430 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README

# 
jQuery plugin that easily manipulate SWF based on SWFObject.
This awesome class exist since 2009. Now on Bower.
### Demo
[http://webcaetano.github.io/swf-jquery/](http://webcaetano.github.io/swf-jquery/)
### Quickstart
Using [Bower](http://bower.io)
```
bower install swf-jquery --save
```
# Documentation
- [$(selector).flash](#selectorflash)
- [Parameters](#load-with-parameters)
- [$.flash.available](#flashavailable)
- [$.flash.version](#flashversion)
- [$.flash.hasVersion](#flashhasversion)
- [$.flash.activeX](#flashactivex)
- [$.flash.expressInstaller](#flashexpressinstaller)
- [$.flash.encodeParams](#flashencodeparams)
- [$.flash](#flash)
### $(selector).flash()
Load flash swf on the select
```javascript
$('#div1').flash('myFlash.swf');
```
### Load with Parameters
Load a flash swf with parameters.
flashvars accept *string,boolean,number*
for *object* and *array* use JSON.stringify() and JSON.parse() on actionscript
```javascript
$('#div1').flash({
swf: 'myFlash.swf',
height: 400, // stage Height
width: 600, // stage width
allowFullScreen: true,
wmode: 'transparent', // background transparent
flashvars: { // set Flash variables
players: 2,
computer: true,
foo: 'bar',
obj: JSON.stringify({name:'TheOddOne',arr:[1,2,3]})
}
});
```
### $.flash.available
Return a boolean value based on availability Flash plugin.
```javascript
return $.flash.available; // returns true if Flash plugin available
```
### $.flash.version
Return a object containing version information about the the user's Flash plugin.
```javascript
return $.flash.version
/* returns {
"original":"Shockwave Flash 17.0 r0",
"array":["17","0","0"],
"string":"17.0.0",
"major":17,
"minor":0,
"release":0
}*/
```
### $.flash.hasVersion()
A function which returns a boolean value of whether the user has installed the minimum specificed version of the Flash plugin.
```javascript
return $.flash.hasVersion(9.1); // returns true if at least Flash 9.1 or greater is detected
```
### $.flash.activeX
A boolean value of whether the browser uses Flash via activeX.
```javascript
return $.flash.activeX; // returns true or false
```
### $.flash.expressInstaller
A string that sets the filename of the express installer that will always be used.
```javascript
$.flash.expressInstaller = 'myFlashPath/expressInstall.swf'; // changes the express installer
```
### $.flash.encodeParams
A boolean value of whether the params will always be URI encoded.
```javascript
$.flash.encodeParams = false; // default is true
```
### $.flash()
A function which returns a standards-friendly jQuery'd flash object.
```javascript
var useLater = $.flash.create({
swf: 'myFlash.swf',
height: 400,
width: 600
});
$(document).ready(function(){
$.('#putFlashHere').html(userLater);
});
```
#### Project to-do list.
- [x] Setup to bower.
- [x] Create Demo in [githubPages](https://pages.github.com/)
- [x] Finish documentation.
- [ ] Create swfZepto
#### Authors
[@jonathantneal](https://github.com/jonathantneal)
[@webcaetano](https://github.com/webcaetano)