จับ event บน flash

Byphunsanit

จับ event บน flash

ความสัมพันธ์ระหว่างหน้าเว็บกับแฟลช เป็นอะไรที่เหมือนกับ นครรัฐวาติกัน (State of the Vatican City) ตั้งอยู่ในกรุงโรม ประเทศอิตาลี แท้ๆ แต่มีสถานะเป็นประเทศอิสระประเทศหนึ่ง การที่จะเอาอะไรเข้าหรือออกต้องได้รับฉันทามติทั้งสองฝ่ายถึงจะทำได้ (ว่าเข้านั่น)

ถ้าคุณหวังว่าจะใช้เท็ก a คร่อมแฟลชแล้วจะลิงค์ไปไหนก็ได้ตามปกติ ก็เสียใจด้วยเพราะมันจะไม่ทำงาน เช่นเดียวกับ onmouseover onclick ก็ไม่รับรู้กิจกรรมใดๆ ของคุณเช่นกัน
แต่เรากลับสามารถใช้ wmode=”transparent” onmouseup=”alert(‘on mouse up’); มาทดแทนได้ครับ

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9.0.47.0" width="720" height="400">
<param name="movie" value="../../demo.swf"/>
<param name="quality" value="high" />
<embed wmode="transparent" onmouseup="alert('on mouse up'); return true;" src="../../demo.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="720" height="400"></embed>
</object>

About the author

phunsanit administrator

Leave a Reply