Jump to content

All-Purpose IE Event Handler


lod3n
 Share

Recommended Posts

Thanks again Dale for your response.

In my case, calling AutoIt from Flash, the small event delay should never be an issue. Most communications with Flash are asynchronous anyway. Here, I can have synchronous communications with javascript, a built-in event delay and then synchronous communications back with Flash from the AutoIt script. By synchronous here I mean direct function calls with return values. Given that Flash movie's have a central "heartbeat" I do not expect this to even be noticed. But when I get some time I will perform some timing test.

As far as generalization, I agree with your comment"...I'm not keen on enforcing a specific document namespace, so I'd like to find a more flexible implementation before doing more with it." I totally agree, but in this one use I find it workable.

I was hoping someone would find a way to enable direct calls to the AutoIt script from the Flash object using it's "ExternalInterface" as using that to expose a Flash function AutoIt can directly call Flash. ...just not the other way around yet; Flash calling an AutoIt function or even a javascript function.

Thanks for your time and response.

gsb

"Did you ever stop to think? ...and forget to restart!"
Link to comment
Share on other sites

Dale,

Here is a flexible implementation that does not require a specific document namespace, and could be hooked up to any web page:

#include <GUIConstants.au3>

$sFilename = @scriptDir&"ÌLÓÙÛÑ][Ñ[[ÌI][ÝÂÌÍÜÒSH   ÌÎNÉÒS  ÝÉÒPQ    ݲfÇC²ôTBfwC²fÇC¶&öGfwC²b33°¢b33c·4DÔÂf׳ÒgV÷C²fÇC¶'WGFöâöæ6Æ6³ÅÕ½ÐìÅÕ½ÐíÔÍ
±±¬¡Ñ¡¥Ì°Ìäí9½Ñ¥ä¥Ð°äÌÌìÌäì¤ÅÕ½ÐìÅÕ½ÐìÐDo it!</button>"
$sHTML &= "</body></S   ÝÉ][ÝÂ[Q[]J ÌÍÜÑ[[[YJB[UÜ]J    ÌÍÜÑ[[[YK   ÌÍÜDÔ ¢b33c¶ôRÒö&¤7&VFRgV÷Cµ6VÆÂäWÆ÷&W"ã"gV÷C²¤uT7&VFRgV÷íµ]½¹Ñɽ°QÍÐÅÕ½Ðì°ØÐÀ°ÐàÀ°´Ä°´Ä°ÀÌØí]M}=YI1AA]%9W + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX = GUICtrlCre]SØ    ÌÍÛÒQK


BÕRTÙ]Ý]JÕ×ÔÒÕÊBÌÍÛÒQK]YØFRb33c·4fÆVæÖR¦ç7FÆÄ6ÆÆ&6²b33c¶ôR ¥vÆR¢b33c¶×6rÒuTÑ5Í ¤(¥ÀÌØíµÍôÀÌØíU%}Y9Q}
1=MÑ¡¸á¥Ñ1½½À)]¹()Õ¹¥stallCallback($o_object)
    Local $o_body = $o_object.document[YÜÈ
    ][ÝØÙI][ÝÊK][J
BØØ[  ÌÍÛ×ØYÙHH ÌÍÛ×ÛØ7BæFö7VÖVçBæ7&VFTVÆVÖVçBgV÷C¶çWBgV÷C² b33c¶õö'&FvRæBÒgV÷C¶S6É¥ÅÕ½Ðì($ÀÌØí½}É¥¹ÑåÁôÅÕ½Ðí¡¥¸ÅÕ½Ðì($ÀÌØí½}É¥¹ÍÑÑribute("params",1)
    $o_body.appendChild ($o_bridge)
    Ob][
    ÌÍÛ×ØYÙK  ][ÝÒYPYÙWÉ][ÝÊBBØØ[ ÌÍÜØÜÛÙHHgV÷C¶gVæ7FöâS46ÆÆ&6²ö&¢Æ×6r²gV÷C°¢b33c·67&D6öFRf׳ÒgVÐíÙÈÑÉÑ=¨ô½Õµ¹Ð¹Ñ±µ¹Ñ å% ÅÕ½ÐìÅÕ½ÐíÔÍÉ¥ÅÕ½ÐìÅÕ½Ð);"
    $scriptCode &= " targetObj.params = new function
^ÝËØ[ØÝËÙÏ[ÙÎßI][Ý    ÌÍÜØÜÛÙH [ÏH    ][ÝÈI]÷C°¢Æö6Âb33c¶õöVBÒb33c¶õöö&¦V7BæFö7VÖVçBæÆÂçFw2gV÷C´TBg½Ð줹%Ñ´ À¤(1½°ÀÌØí½}ÍÉ¥ÁÐôÀÌØí½}½©Ð¹½Õµ¹Ð¹Éѱµt ("script")
    With $o_script
        .defer = True
      [ÝXYÙHH ][ÝÚØÜ  ][ÝÂHH    ][ÝÝ^Ú]ØÜ  ][Ý°¢çFWBÒb33c·67&D6öFP¢VæEvF¢b33c¶õöVBæVæD6ÆB ÀÌØí½}ÍÉ¥ÁФ$)¹Õ¹()Õ¹%   É¥}½¹ÁɽÁÉÑ塹 ¤(ÀÌØí½±µnt = @COM_EventObj
    if isobj($oElement.params) then
       
        ÌÍÛÑ[[Y[[ËØÝ[KXÚÙÜÝ[I][ÝÜY ][ÝÂÙØÞ
BÂgV÷C´ÖW76vRg&öÒ§2WfVçBb333²gV÷C²Âb33c¶ôVÆVÖVçBç&×2æ×6rfײ7±¤((ÀÌØí½±µ¹Ð¹ÁɵÌôÄì©ÕÍÐ¥¸Í¹åÑ¡¥¹±Íriggers onpropertychange
    EndIf
EndFunc
Edited by lod3n

[font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]

Link to comment
Share on other sites

That's reasonable... I want to be careful however not to screw someone up who is deoing something that relies on element indexes -- that's one reason I really liked your first approach. This would be low risk as it appends to the end of the body however.

It'll be a bit before I implement anything, but I'll be sure to give you credit in the sources when I implement something based on this approach.

thanks,

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

This works great!

Thanks again lod3n.

I retro-fitted my flash application with this as my "standard."

One comment though.

As an event it is important to sequence the changes in javascript less you have data transfer collisions.

This is a common problem in flash but others may be left scratching their heads.

Nice, and thanks again.

gsb

"Did you ever stop to think? ...and forget to restart!"
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...