leonidas Posted December 21, 2012 Posted December 21, 2012 Hi I'm having problems with AutoITversion 3.3.8.1. I can't receive FSCommands from my Adobe Flash .swf file. But everything works fine and without any problem with version 3.3.6.1 With oldest version I receive FSCommands from .swf I tried another version of Adobe Flash Player (older version) but the problem still exists. Only when I uninstall AutoIT version 3.3.8.1 and install 3.3.6.1 ,I can solve the problem. Please I need your help. #include 'GUIConstantsEx.au3' Global $hGUI = GUICreate("Demo Program",500,500) Global $oSW = ObjCreate('ShockwaveFlash.ShockwaveFlash') Global $Shockwave = GUICtrlCreateObj($oSW, 0, 0, 500, 500) $swfObjEvents = ObjEvent($oSW, "FSCommand") GUISetState(@SW_SHOWNOACTIVATE,$hGUI) With $oSW $oSW.LoadMovie(0, @ScriptDir & "\FlashTest.swf") EndWith While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() Func FSCommand($type, $command, $arguments) MsgBox(0,"","$command ==> " & $command & " - $Arguments ==> " & $arguments,3) EndFunc
trancexx Posted December 22, 2012 Posted December 22, 2012 That functionality was removed from the language because it caused unnecessary lag in script execution. Use proper and docummented way of event handling. ♡♡♡ . eMyvnE
leonidas Posted December 22, 2012 Author Posted December 22, 2012 Can you please help me or guide me of how to do that? I dont know from where I must start to find a solution.
trancexx Posted December 23, 2012 Posted December 23, 2012 Sure. You have to know what event(s) you want to handle, meaning you have to know the name of the sink's event function the main object uses.I have modified your code a bit to catch onreadystatechange event:#include 'GUIConstantsEx.au3' Global $hGUI = GUICreate("Demo Program", 500, 500) Global $oSW = ObjCreate('ShockwaveFlash.ShockwaveFlash') Global $Shockwave = GUICtrlCreateObj($oSW, 0, 0, 500, 500) ; Event dispatch object Global $oSwfObjEvents = ObjEvent($oSW, "MyHandler_") ; Show GUI GUISetState() ; Load swf $oSW.LoadMovie(0, "http://edmullen.net/flash/clock7.swf") While 1 If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit WEnd ; Here you define event function by using specified function prefix (MyHandler_) and appending the event name (e.g. onreadystatechange) Func MyHandler_onreadystatechange($iNewState) ConsoleWrite("!>onreadystatechange event fired, newState = " & $iNewState & @CRLF) MsgBox(0, "Fired", "onreadystatechange event fired, newState = " & $iNewState) EndFunc...I hope that helps. ♡♡♡ . eMyvnE
leonidas Posted December 23, 2012 Author Posted December 23, 2012 A big thanks for your help trancexx.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now