Skip to content

Indronil/angular-swfobject

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Angular SWFObject

Usage

Minimal usage:

<swf-object swf-url="my-swf.swf"></swf-object>

Width, height and version are required parameters for SWFObject. If these are not provided then angular-swfobject defaults to: 800x600, version 10. You can override these.

<swf-object
  swf-url="my-swf.swf"
  swf-width="100%"
  swf-height="100%"
  swf-version="10.2"></swf-object>

You can also add additional parameters:

<swf-object
  swf-url="my-swf.swf"
  swf-params="{
    wmode: 'opaque'
  }"></swf-object>

Specify flash vars:

<swf-object
  swf-url="my-swf.swf"
  swf-vars="{
    user: 'alice'
  }"></swf-object>

Register a callback for swf load complete:

<swf-object
  swf-url="my-swf.swf"
  swf-load="onLoadHandler()"
  ></swf-object>

Also supports defining controller level callbacks if using ExternalInterface for example:

View

<swf-object 
    swf-url="my-swf.swf"
    swf-id="my-swf-id"
    swf-callbacks="{'externalCallback': myCallback}"></swf-object>

Controller

angular.controller('MyCtrl', function ($scope) {
  $scope.myCallback = function () {
    console.log('Called from Flash');
  }
});

ActionScript

ExternalInterface.call('externalCallback');

About

SWFObject directive for AngularJS

Resources

License

Stars

Watchers

Forks

Packages

No packages published