The Function.
Func _GuiCtrlCreateFlash($iXpos,$iYpos,$iWidth,$iHeight,$vSWFPath, $offset = 27) Local $oIE, $GUIActiveX, $tmp, $hFile $oIE = ObjCreate("Shell.Explorer.2") $GUIActiveX = GUICtrlCreateObj ($oIE, $iXpos, $iYpos, $iWidth, $iHeight) $tmp = '<object width="' & $iWidth & '" height="' & $iHeight & '">' $tmp &= '<param name="movie" value="AutoIt.swf">' $tmp &= '<embed src="' & $vSWFPath & '" width="' & $iWidth-$offset & '" height="' & $iHeight-$offset & '">' $tmp &= '</embed>' $hFile = FileOpen(@tempDir & "\AutoItFlash.html",2) FileWrite($hFile,$tmp) FileClose($hFile) $oIE.navigate(@tempDir & "\AutoItFlash.html") $oIE.document.body.scroll = "no" FileDelete(@tempDir & "\AutoItFlash.html") Return $GUIActiveX EndFunc
An Example
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> GUICreate("Embedded Flash", 640, 680, (@DesktopWidth - 640) / 2, (@DesktopHeight - 680) / 2, BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS, $WS_CLIPCHILDREN)) $Flash = _GuiCtrlCreateFlash(10,10,400,300,"<a href='http://www.2inept.co.uk/icecastleblaster.swf' class='bbc_url' title='External link' rel='nofollow external'>http://www.2inept.co.uk/icecastleblaster.swf"</a>) $Flash2 = _GuiCtrlCreateFlash(10,330,600,300,"<a href='http://www.flashgames247.com/images/logo_rhino_199x91.swf' class='bbc_url' title='External link' rel='nofollow external'>http://www.flashgames247.com/images/logo_rhino_199x91.swf"</a>) GUISetState() ;Show GUI ; Waiting for user to close the window While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete() Func _GuiCtrlCreateFlash($iXpos,$iYpos,$iWidth,$iHeight,$vSWFPath, $offset = 27) Local $oIE, $GUIActiveX, $tmp, $hFile $oIE = ObjCreate("Shell.Explorer.2") $GUIActiveX = GUICtrlCreateObj ($oIE, $iXpos, $iYpos, $iWidth, $iHeight) $tmp = '<object width="' & $iWidth & '" height="' & $iHeight & '">' $tmp &= '<param name="movie" value="AutoIt.swf">' $tmp &= '<embed src="' & $vSWFPath & '" width="' & $iWidth-$offset & '" height="' & $iHeight-$offset & '">' $tmp &= '</embed>' $hFile = FileOpen(@tempDir & "\AutoItFlash.html",2) FileWrite($hFile,$tmp) FileClose($hFile) $oIE.navigate(@tempDir & "\AutoItFlash.html") $oIE.document.body.scroll = "no" FileDelete(@tempDir & "\AutoItFlash.html") Return $GUIActiveX EndFunc
Edited by ChrisL, 03 July 2008 - 12:47 PM.




