跳到主要內容

發表文章

目前顯示的是有「Flash」標籤的文章

[Web] Flash Z-index on IE / 解決在IE上 Flash會蓋住圖層的問題

用IE瀏覽有設定z-index layer跟Flash的 頁面 會有原本設定在Flash上的layer圖層 反而被Flash的蓋掉的問題 這個狀況可以在Flash的參數中加上以下的內容 在para中 <param name="wmode" value="opaque" /> 在<embed 內加入wmode="opaque" 如果有flash的js記得要多這個參數 'wmode', 'opaque',

[.net] Load and play Flash file (swf) in .net app

1. Add “COM Components”“Shockwave Flash Object” to Toolbox 2. Add axshockwaveFlash Ojbect to your form and name "MyFlash" 3. use OpenFileDialog to load .swf open = New OpenFileDialog open.Filter = "Image Files(*.swf)|*.swf" If (open.ShowDialog() = DialogResult.OK) Then MyFlash.Movie = open.FileName End If 4. use Play /Stop contorl swf MyFlash.play() MyFlash.stop()

[Flash]Color Wall : A timer sample

Use code in each Square. changeColor(); var myTimer:Timer = new Timer(1000, 0); myTimer.addEventListener(TimerEvent.TIMER, timerHandler); myTimer.start(); function timerHandler(event:TimerEvent):void { changeColor(); } function changeColor(){ var myColor:ColorTransform =square.transform.colorTransform; var r:uint=Math.random()*256; var g:uint=Math.random()*256; var b:uint=Math.random()*256; myColor.color =r*256*256+g*256+b; square.transform.colorTransform = myColor; }

[AS3] Loader vs URLLoader

Loader : use to load *.swf , all image (jpg,png,gif) URLLoader : use to load text-doc (xml,txt,php,jsp,asp) How to use: Loader: var _ldr:Loader = new Loader(); _ldr.load(new URLRequest(' $imagePaph ' )); _ldr.addEventListener(Event.COMPLETE,onURLLoaded); addChild(_ldr); function onURLLoaded (event:Event):void{ trace("URLLoader Complete"); } $imagePath: can be the file path in local or file url in Internet URLLoader: var _urlLdr:URLLoader =new URLLoader(); var request:URLRequest = new URLRequest(" $docPaph "); _urlLdr.addEventListener(Event.COMPLETE,onURLLoaded); _urlLdr.load(request) function onURLLoaded (event:Event):void{ var docData:String=event.target.data; trace("URLLoader Complete"); } $docPath: can be the file path in local or file url in Internet

[Flash] .swf ClassLoader

Flash 中很常用到loader 來讀取外部的swf檔案載入到畫面中, 但是載入進來的swf如果含還有一些函數,卻是沒辦法呼叫。 這常常會造成一些設計好的swf元件不能重複利用的問題 不過在 Adobe的官方網站 上有提供一個ClassLoader source Code 可以用來載入swf成class去呼叫swf的函數與方法 之後在網路查了一下有比較簡單的寫法大概如下 import flash.display.Sprite; import flash.display.Loader; import flash.system.ApplicationDomain; import flash.net.URLRequest; import flash.events.*; import flash.util.trace; public class Main extends Sprite { private var child1:Loader; public function Main() { var url1:URLRequest = new URLRequest('SWFName.swf'); url1.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain); child1 = new Loader(); child1.addEventListener(EventType.COMPLETE, onChild1Complete); //設定載入完成的 handler child1.load(url1); //開始載入swf檔案 } private function onChild1Complete(e:Event):Void { var c:Class = child1.loadeeInfo.applicationDomain.getClass('ClassName'); //將swf中的class抓出來成為一個class var co:Object = new c(); /將swf中的class實作 co.method(); } } 基本上就是將檔案讀取進來 然後在讀...