zoukankan      html  css  js  c++  java
  • swfObject 使用说明

    1.Embed your SWF with JavaScript

    使用方法  swfobject.embedSWF(swfUrl, id, width, height, version, expressInstallSwfurl, flashvars, params, attributes, callbackFn) 包含5个必须参数及5个可选参数。

    1. swfUrl (String, required) specifies the URL of your SWF
    2. id (String, required) specifies the id of the HTML element (containing your alternative content) you would like to have replaced by your Flash content
    3. width (String, required) specifies the width of your SWF
    4. height (String, required) specifies the height of your SWF
    5. version (String, required) specifies the Flash player version your SWF is published for (format is: "major.minor.release" or "major")
    6. expressInstallSwfurl (String, optional) specifies the URL of your express install SWF and activates Adobe express install. Please note that express install will only fire once (the first time that it is invoked), that it is only supported by Flash Player 6.0.65 or higher on Win or Mac platforms, and that it requires a minimal SWF size of 310x137px.
    7. flashvars (Object, optional) specifies your flashvars with name:value pairs
    8. params (Object, optional) specifies your nested object element params with name:value pairs
    9. attributes (Object, optional) specifies your object's attributes with name:value pairs
    10. callbackFn (JavaScript function, optional) can be used to define a callback function that is called on both success or failure of creating a Flash plug-in <object> on the page (see API documentation)

    注意:可选的参数你可以忽略,或者给它传递false值即可,对于flashvars,params,attributes参数,你也可以传递空对象{}.

    2.How can you configure your Flash content?

    你可以为attributes 对象指定如下可选的属性:

    • id (NOTE: when undefined, the object element automatically inherits the id from the alternative content container element)
    • align
    • name
    • styleclass (see note about class)
    • class

    styleclass 与class 都是指定样式,但因为class是js中的关键字,所以如果使用class时要用引号括起来。

    Example:

    var attributes = {
       id: "myId",
       align: "left",
       styleclass: "myclass"
    };

    If you would rather use class instead of styleclass, wrap the word class in quotes like this:

    var attributes = {
       id: "myId",
       align: "left",
       "class": "myclass"
    };

    你还可以为params对象指定如下可选的属性:

    3.你可以忽略flashvars参数,而使用params对象的flashvars属性指定:

    <script type="text/javascript">
    
    var flashvars = false;
    var params = {
      menu: "false",
      flashvars: "name1=hello&name2=world&name3=foobar"
    };
    var attributes = {
      id: "myDynamicContent",
      name: "myDynamicContent"
    };
    
    swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes);
    
    </script>

    官方文档:https://code.google.com/p/swfobject/wiki/documentation

    属性参数值配置:http://helpx.adobe.com/flash/kb/flash-object-embed-tag-attributes.html

    使用flashvars参数传值到swf:http://helpx.adobe.com/flash/kb/pass-variables-swfs-flashvars.html

  • 相关阅读:
    端口被占用
    启动Windows防火墙提示“0x8007042c"
    vue创建全局组件
    vue中过度动画之列表添加删除动画实现
    vue中过渡动画(类名结合动画实现方式)
    vue中过渡动画(类名实现方式)
    this.$nextTick()方法的使用
    利用axios获取数据并渲染到视图层
    axios的简单使用
    watch深度监听
  • 原文地址:https://www.cnblogs.com/weekend001/p/3632215.html
Copyright © 2011-2022 走看看