Gadgets.flash (v0.9)

From VZ Developer Wiki
Jump to: navigation, search

This documentation is not completed yet and will be extended by more examples in future.

gadgets.flash

Embeds Flash content in gadgets.

Methods

gadgets.flash.embedCachedFlash

<static> Boolean gadgets.flash.embedCachedFlash()
Returns
Type Description
Boolean Whether the function call completes successfully
Description
Injects a cached Flash file into the DOM tree. Accepts the same parameters as gadgets.flash.embedFlash does.

gadgets.flash.embedFlash

<static> Boolean gadgets.flash.embedFlash(swfUrl, swfContainer, swfVersion, opt_params)
Parameters
Name Type Description
swfUrl String SWF URL
swfContainer String | Object The ID or object reference of an existing HTML container element
swfVersion Number Minimum Flash Player version required
opt_params Object An optional object that may contain any valid HTML parameter; all attributes will be passed through to the Flash movie on creation
Returns
Type Description
Boolean Whether the function call completes successfully
Description
Injects a Flash file into the DOM tree.

gadgets.flash.getMajorVersion

<static> Number gadgets.flash.getMajorVersion()
Returns
Type Description
Number The major version of Flash Player or 0 if Flash is not supported
Description
Detects Flash Player and its major version.

Examples

function doTrick(trick) {
  var url = "http://doc.examples.googlepages.com/Trevor-"+trick+".swf";
  outputbox = document.getElementById("outputbox");
  gadgets.flash.embedFlash(url, outputbox, 7);
  gadgets.window.adjustHeight();
};

function renderControls() {
  var handle = document.getElementById("dom_handle");
  var controls = document.createElement("div");
  controls.appendChild(getButton("sit"));
  controls.appendChild(getButton("spin"));
  controls.appendChild(getButton("down"));
  controls.appendChild(getButton("speak"));

  var outputbox = document.createElement("div");
  outputbox.id = "outputbox";
  outputbox.style.width = "200px";
  outputbox.style.height = "200px";

  handle.innerHTML = "";
  handle.appendChild(controls);
  handle.appendChild(outputbox);

  gadgets.window.adjustHeight();
};

function getButton(action) {
  var control = document.createElement("button");
  control.onclick = function() { doTrick(action); };
  control.innerHTML = action;
  return control;
};

renderControls();


OpenSocial (v0.9)

gadgets

gadgets.io

gadgets.json

gadgets.Prefs

gadgets.util

gadgets.views

gadgets.flash

gadgets.MiniMessage

gadgets.oauth.Popup

gadgets.rpc

gadgets.skins

gadgets.pubsub

gadgets.Tab

gadgets.TabSet

gadgets.window

gadgets.i18n

opensocial

opensocial.Activity

opensocial.Address

opensocial.Album

opensocial.BodyType

opensocial.Collection

opensocial.CreateActivityPriority

opensocial.DataRequest

opensocial.DataResponse

opensocial.Email

opensocial.Enum

opensocial.Environment

opensocial.EscapeType

opensocial.IdSpec

opensocial.MediaItem

opensocial.Message

opensocial.MessageCollection

opensocial.Name

opensocial.NavigationParameters

opensocial.Organization

opensocial.Permission

opensocial.Person

opensocial.Phone

opensocial.ResponseItem

opensocial.Url

osapi.Request

osapi.BatchRequest

osapi.people

osapi.activities

osapi.appdata

osapi.messages

osapi.http