">mixi Developer Center (mDC)

mixi Apps

mixi Apps (English) » Technical Specification » PC » Flash Integration

Flash Integration

In the mixi App, the developer can easily embed Flash content by utilizing Flash-related functionality provided by the Gadgets Feature-Specific JavaScript API. Flash can be supported by expressing in the Gadgets XML file.

<ModulePrefs>
  <Require feature="flash" />
</ModulePrefs>

Embedding Flash

The following list is a code example for embedding Flash content in a mixi App.

gadgets.flash.embedFlash(
      "http://your.server.host/flash/content.swf",
      document.getElementById("target"),
      6);

The gadgets.flash.embedFlash() is available to embed Flash content. This function has the following arguments:

  • URL of a swf file
  • DOM element or the ID string where Flash content is embedded
  • Flash Player’s version required by the embedded Flash content
  • Object having the parameters to be specified when Flash content is embedded

Since a DOM element is specified as the second argument, it is required to write a certain div element within the CDATA section of Content elements or to be dynamically generated in advance. If a Flash Player installed on the Web browser is older than the required version stated in the third argument, Flash content is not embedded.

How to Specify Parameters

Some mixi Apps require adjusting the size of embedded Flash content and other attributes. With the gadgets.flash.embedFlash(), an object with the parameters can be specified in the fourth argument to reflect them to the embedded Flash content. For example, in the list below, property is created to set the height 300 x width 150 by the params object.

var params = {
    width: 300,
    height: 150
};
gadgets.flash.embedFlash(
      "http://your.server.host/flash/content.swf",
      document.getElementById("target"),
      6,
      params);

As a result, the following embed element is generated when the Flash content is embedded.

<div id="target">
  <embed width="300" height="150" src="http://your.server.host/flash/content.swf"
      type="application/x-shockwave-flash" wmode="opaque"
      base="http://your.server.host/flash/"/>
</div>

The property defined in the params object is reflected as the attribute of the embed element.

Invitation features and Flash

There can be some display issues regarding Flash components usage in the mixi App with the invitation features to recommend the application to friends.

[Let’s Invite Friends]
http://developer.mixi.co.jp/en/appli/spec/pc/invite_appli

Flash component is displayed in the foreground over most other DOM elements. Therefore, pop-up windows generated by the invitation feature are hidden by the Flash object.

In order to avoid this issue, the wmode attribute for the embed tag, can be specified as “transparent” or “opaque”.

<embed ... wmode="opaque" ... />

With the wmode attribute setting, the pop-up window can be displayed above the Flash components.

Nevertheless, the following issues may occur, depending on Web browser/Flash version combinations:

  • the wmode attribute has no effect.
  • Double byte characters cannot be entered in the Flash component.
  • Mouse wheel event cannot be detected in the Flash component.
  • Focusing for input is unavailable or focusing position is misaligned.

In order to avoid these issue, hiding any of the Flash components temporarily is recommended while using the invitation feature.

TOP OF THIS PAGE