Jump to content

Error with Flash and ObjEvent with version 3.3.8.1


leonidas
 Share

Recommended Posts

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...