/javascripts/lib/docs/source/FlashComponent.html

https://bitbucket.org/ksokmesa/sina-asian · HTML · 147 lines · 127 code · 20 blank · 0 comment · 0 complexity · 1395193215fcb64ebde990479b83a6eb MD5 · raw file

  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.2.1
  11. * Copyright(c) 2006-2010 Ext JS, Inc.
  12. * licensing@extjs.com
  13. * http://www.extjs.com/license
  14. */
  15. <div id="cls-Ext.FlashComponent"></div>/**
  16. * @class Ext.FlashComponent
  17. * @extends Ext.BoxComponent
  18. * @constructor
  19. * @xtype flash
  20. */
  21. Ext.FlashComponent = Ext.extend(Ext.BoxComponent, {
  22. <div id="cfg-Ext.FlashComponent-flashVersion"></div>/**
  23. * @cfg {String} flashVersion
  24. * Indicates the version the flash content was published for. Defaults to <tt>'9.0.115'</tt>.
  25. */
  26. flashVersion : '9.0.115',
  27. <div id="cfg-Ext.FlashComponent-backgroundColor"></div>/**
  28. * @cfg {String} backgroundColor
  29. * The background color of the chart. Defaults to <tt>'#ffffff'</tt>.
  30. */
  31. backgroundColor: '#ffffff',
  32. <div id="cfg-Ext.FlashComponent-wmode"></div>/**
  33. * @cfg {String} wmode
  34. * The wmode of the flash object. This can be used to control layering. Defaults to <tt>'opaque'</tt>.
  35. */
  36. wmode: 'opaque',
  37. <div id="cfg-Ext.FlashComponent-flashVars"></div>/**
  38. * @cfg {Object} flashVars
  39. * A set of key value pairs to be passed to the flash object as flash variables. Defaults to <tt>undefined</tt>.
  40. */
  41. flashVars: undefined,
  42. <div id="cfg-Ext.FlashComponent-flashParams"></div>/**
  43. * @cfg {Object} flashParams
  44. * A set of key value pairs to be passed to the flash object as parameters. Possible parameters can be found here:
  45. * http://kb2.adobe.com/cps/127/tn_12701.html Defaults to <tt>undefined</tt>.
  46. */
  47. flashParams: undefined,
  48. <div id="cfg-Ext.FlashComponent-url"></div>/**
  49. * @cfg {String} url
  50. * The URL of the chart to include. Defaults to <tt>undefined</tt>.
  51. */
  52. url: undefined,
  53. swfId : undefined,
  54. swfWidth: '100%',
  55. swfHeight: '100%',
  56. <div id="cfg-Ext.FlashComponent-expressInstall"></div>/**
  57. * @cfg {Boolean} expressInstall
  58. * True to prompt the user to install flash if not installed. Note that this uses
  59. * Ext.FlashComponent.EXPRESS_INSTALL_URL, which should be set to the local resource. Defaults to <tt>false</tt>.
  60. */
  61. expressInstall: false,
  62. initComponent : function(){
  63. Ext.FlashComponent.superclass.initComponent.call(this);
  64. this.addEvents(
  65. <div id="event-Ext.FlashComponent-initialize"></div>/**
  66. * @event initialize
  67. *
  68. * @param {Chart} this
  69. */
  70. 'initialize'
  71. );
  72. },
  73. onRender : function(){
  74. Ext.FlashComponent.superclass.onRender.apply(this, arguments);
  75. var params = Ext.apply({
  76. allowScriptAccess: 'always',
  77. bgcolor: this.backgroundColor,
  78. wmode: this.wmode
  79. }, this.flashParams), vars = Ext.apply({
  80. allowedDomain: document.location.hostname,
  81. YUISwfId: this.getId(),
  82. YUIBridgeCallback: 'Ext.FlashEventProxy.onEvent'
  83. }, this.flashVars);
  84. new swfobject.embedSWF(this.url, this.id, this.swfWidth, this.swfHeight, this.flashVersion,
  85. this.expressInstall ? Ext.FlashComponent.EXPRESS_INSTALL_URL : undefined, vars, params);
  86. this.swf = Ext.getDom(this.id);
  87. this.el = Ext.get(this.swf);
  88. },
  89. getSwfId : function(){
  90. return this.swfId || (this.swfId = "extswf" + (++Ext.Component.AUTO_ID));
  91. },
  92. getId : function(){
  93. return this.id || (this.id = "extflashcmp" + (++Ext.Component.AUTO_ID));
  94. },
  95. onFlashEvent : function(e){
  96. switch(e.type){
  97. case "swfReady":
  98. this.initSwf();
  99. return;
  100. case "log":
  101. return;
  102. }
  103. e.component = this;
  104. this.fireEvent(e.type.toLowerCase().replace(/event$/, ''), e);
  105. },
  106. initSwf : function(){
  107. this.onSwfReady(!!this.isInitialized);
  108. this.isInitialized = true;
  109. this.fireEvent('initialize', this);
  110. },
  111. beforeDestroy: function(){
  112. if(this.rendered){
  113. swfobject.removeSWF(this.swf.id);
  114. }
  115. Ext.FlashComponent.superclass.beforeDestroy.call(this);
  116. },
  117. onSwfReady : Ext.emptyFn
  118. });
  119. <div id="prop-Ext.FlashComponent-EXPRESS_INSTALL_URL"></div>/**
  120. * Sets the url for installing flash if it doesn't exist. This should be set to a local resource.
  121. * @static
  122. * @type String
  123. */
  124. Ext.FlashComponent.EXPRESS_INSTALL_URL = 'http:/' + '/swfobject.googlecode.com/svn/trunk/swfobject/expressInstall.swf';
  125. Ext.reg('flash', Ext.FlashComponent);</pre>
  126. </body>
  127. </html>