Aşağıda sayfanızdaki flash dosyasının boyutlarını değiştiren javascript dosyası bulunmakta. IE5.5, IE6, IE7, IE8, Firefox 3, Opera 10, Safari 4, Chrome 3 programlarında test edildi.
Kullanım
Düzgün çalışması için flash’ı sayfanıza yerleÅŸtirirken kullanıdığınız html <object> etiketine id vermeniz gerekiyor. Daha sonra fonksiyonları çağırırken kullanacağımız ‘id’ bu olacak. Örnek:
<object id=”flashid” height=”500″ width=”650″
classid=”CLSID:D27CDB6E-AE6D-11cf-96B8-444553540000″
codebase=”http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0″>
…
</object>
- Boyut deÄŸiÅŸtirme:
flashResizer.resize(genislik, yukseklik,’flashid‘); - Büyütme:
flashResizer.zoomin(’flashid‘); - Küçültme:
flashResizer.zoomout(’flashid‘;
Kod
var flashResizer = { ZOOM_IN:1,ZOOM_OUT:-1, fo:null,ZOOM_FACTOR:0.1, findObj:function(_foid){if(_foid==undefined || _foid==null){return this.fo;} this.fo=null;if (window.document[_foid]) this.fo=window.document[_foid];else if (navigator.appName.indexOf("Microsoft Internet")==-1){if (document.embeds && document.embeds[_foid]) this.fo = document.embeds[_foid];}else this.fo = document.getElementById(_foid);return this.fo;}, resize:function(_w,_h,_foid){if(this.findObj(_foid)){this.fo.width=_w;this.fo.height=_h;}return this;}, zoom:function(_d,_f){if(this.findObj(_f)){var zf=1+_d*this.ZOOM_FACTOR;this.resize(this.fo.width*zf,this.fo.height*zf);}return this;}, zoomin:function(_f){this.zoom(this.ZOOM_IN,_f);}, zoomout:function(_f){this.zoom(this.ZOOM_OUT, _f);} }
