YUI recommends YUI3.
YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.
This documentation is no longer maintained.
This example has been deprecated and will no longer be supported. YUI 2 is now in maintenance mode, so no future updates are planned and only critical fixes will be considered. For more information, please refer to the following blog posts:
This is a simple example of the YUI SWF Utility's features.
Note: This example of the YUI SWF Utility usage requires Flash Player 9.0.115 or higher. The latest version of Flash Player is available at the Adobe Flash Player Download Center.
In this example, we demonstrate how to embed a SWF on a page and pass it some configuration parameters.
First, include the following JS source files:
Next, create a container where the SWF will be placed. The size of the container will be the size of the SWF (in this case, we set it to 400 by 200 pixels). The current (HTML) content of the container is what will be displayed if there is no Flash installed on the user's machine, or if the version of the Flash player installed does not match the minimum required.
Now, create an object with the necessary parameters to pass to the SWF. In this case, we specify the minimum version of Flash player required, whether to use the ExpressInstall capability of the Flash player, and a few SWF-specific fixed attributes, namely the scale
attribute (which specifies whether to shrink or stretch the Flash content to fit the viewport; in this case, no shrinking or stretching is allowed), and the salign
attribute (which specifies how to align the content in the viewport; in this case, we align it to top left):
Finally, create an instance of the SWF, passing the name of the container in which to embed it, the URL of the SWF, and the parameter object created above:
All YUI 2.x users should review the YUI 2.8.2 security bulletin, which discusses a vulnerability present in YUI 2.4.0-2.8.1.
Copyright © 2013 Yahoo! Inc. All rights reserved.