Jump to content

scroll webpage down to flash game? or just show the flash game?


hot202
 Share

Recommended Posts

  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You could read the page source code of the flash game, and search for '*.swf' since flash games are .swf files (usually), and then redirect the IE page to the .swf's location. Mess around with the UDFs String.au3 and Array.au3. If you feel like getting fancy, INet.au3 or IE.au3 to get the page source, without visibly loading the page

We ought not to misbehave, but we should look as though we could.

Link to comment
Share on other sites

Using IE.au3 you can also get a reference to the flash object and then use the .ScrollIntoView method

Something like:

#include <IE.au3>

$oIE = _IECreate("your-site")
$oObject = _IEGetTagnameGetCollection($oIE, "object", 0)
$oObject.ScrollIntoView

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

i found this other script it works but when i change the site and the object name i keep getting a error

--> IE.au3 V2.4-0 Warning from function _IEGetObjById, $_IEStatus_NoMatch (flashapp) would some 1 be kind and tell me what im doing wrong?

#include <ie.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

$oIE = ObjCreate("Shell.Explorer.2")
$Form1 = GUICreate("Form1", 1000, 600)
$GUIActiveX = GUICtrlCreateObj($oIE, 10, 40, 745, 470)
GUISetState(@SW_SHOW)
$oIE.navigate("http://apps.facebook.com/onthefarm/index.php")
_IELoadWait($oIE)
Do
    $oObj = _IEGetObjById($oIE, "flashapp")
    Sleep(200)
Until IsObj($oObj)
$oObj.scrollIntoView()

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd
Link to comment
Share on other sites

Sorry, spend some time trying to understand the code and then as specific questions.

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

well the code works when i have a diff site there and the object id but as soon as i change it to a facebook flash game it dosnt work i searched the object id name and thats what it gave me (flashap) so im not sure how to find the object id right if im doing something wrong.

i used debugbar and this is what i got

<OBJECT id=flashapp height=594 width=760 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 name=flashapp><PARAM NAME="_cx" VALUE="20108"><PARAM NAME="_cy" VALUE="15716"><PARAM NAME="FlashVars" VALUE=""><PARAM NAME="Movie" VALUE="http://static.farmville.com/embeds/v15750/FV_Preloader.swf"><PARAM NAME="Src" VALUE="http://static.farmville.com/embeds/v15750/FV_Preloader.swf"><PARAM NAME="WMode" VALUE="Opaque"><PARAM NAME="Play" VALUE="0"><PARAM NAME="Loop" VALUE="-1"><PARAM NAME="Quality" VALUE="High"><PARAM NAME="SAlign" VALUE="LT"><PARAM NAME="Menu" VALUE="-1"><PARAM NAME="Base" VALUE=""><PARAM NAME="AllowScriptAccess" VALUE="always"><PARAM NAME="Scale" VALUE="NoScale"><PARAM NAME="DeviceFont" VALUE="0"><PARAM NAME="EmbedMovie" VALUE="0"><PARAM NAME="BGColor" VALUE=""><PARAM NAME="SWRemote" VALUE=""><PARAM NAME="MovieData" VALUE=""><PARAM NAME="SeamlessTabbing" VALUE="1"><PARAM NAME="Profile" VALUE="0"><PARAM NAME="ProfileAddress" VALUE=""><PARAM NAME="ProfilePort" VALUE="0"><PARAM NAME="AllowNetworking" VALUE="all"><PARAM NAME="AllowFullScreen" VALUE="true"></OBJECT>
Link to comment
Share on other sites

that dosnt work _IEGetTagnameGetCollection() is a undefined function.

That doesn't work because Dale misspelled it :mellow: (unless I'm missing some new, weird function). It should be _IETagNameGetCollection() without that first 'Get'. Also, read about the UDF like Dale said to know how it work, or look at other codes and see how they run, and make your own script. Chances are someone elses script is made to work for what they were going for

We ought not to misbehave, but we should look as though we could.

Link to comment
Share on other sites

Perhaps there are Frames or iFrames involved...

I'm not about to touch f'n farmville to find out

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

i used this to check if there is any frames it found 4 iframes how do i see what the iframes r?

#include <IE.au3>
$oIE = _IECreate ("http://apps.facebook.com/onthefarm/index.php")
_IELoadWait($oIE)
$oFrames = _IEFrameGetCollection ($oIE)
$iNumFrames = @extended
If $iNumFrames > 0 Then
    If _IEIsFrameSet ($oIE) Then
        MsgBox(0, "Frame Info", "Page contains " & $iNumFrames & " frames in a FrameSet")
    Else
        MsgBox(0, "Frame Info", "Page contains " & $iNumFrames & " iFrames")
    EndIf
Else
    MsgBox(0, "Frame Info", "Page contains no frames")
EndIf
Link to comment
Share on other sites

i tryed this but im getting a error

d:\Program Files\AutoIt3\Include\IE.au3 (800) : ==> The requested action with this object has failed.:

If $oFrame.name = $s_Name Then Return SetError($_IEStatus_Success, 0, $oTemp.frames($s_Name))

If $oFrame.name = $s_Name Then Return SetError($_IEStatus_Success, 0, $oTemp.frames($s_Name)^ ERROR

#include <IE.au3>
#AutoIt3Wrapper_run_debug_mode=Y
$oIE = _IECreate ("http://apps.facebook.com/onthefarm/index.php")

_IELoadWait($oIE)

$oFrame = _IEFrameGetObjByName ($oIE, "fb_iframe_4b753bf2612fa167ad569")
$oInput = _IEFrameGetObjByName ($oFrame, "flashapp")
$oInput.scrollIntoView()
Link to comment
Share on other sites

I'll guess that frame name is generated dynamically, so suggest you use _IEFrameGetCollection and get the frame by 0-based index instead of name.

Can't tell you why you get that error instead of a NOMATCH message... if you have strange problems, use _IEErrorHandlerRegister() to see more specifics of a COM error (Access is Denied would indicate a cross-domain security violation).

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

when i use that i get error

!> Starting in DebugMode..

Line: @error-@extended: Line syntax

0001: 0-0: #include <IE.au3>

0002: 0-0: #AutoIt3Wrapper_run_debug_mode=Y

0003: 0-0: $oIE = _IECreate ("http://apps.facebook.com/onthefarm/index.php")

0005: 0-0: _IELoadWait($oIE)

0006: 0-0: $oFrame = _IEFrameGetCollection($oIE, -0)

0008: 0-4: $oInput = _IEFrameGetObjByName ($oFrame, "flashapp")

d:\Program Files\AutoIt3\Include\IE.au3 (789) : ==> The requested action with this object has failed.:

$oTemp = $o_object.document.parentWindow

$oTemp = $o_object.document^ ERROR

#include <IE.au3>
#AutoIt3Wrapper_run_debug_mode=Y
$oIE = _IECreate ("http://apps.facebook.com/onthefarm/index.php")

_IELoadWait($oIE)
$oFrame = _IEFrameGetCollection($oIE, -0)
;$oFrame = _IEFrameGetObjByName ($oIE, "fb_iframe_4b753bf2612fa167ad569")
$oInput = _IEFrameGetObjByName ($oFrame, "flashapp")
$oInput.scrollIntoView()
Link to comment
Share on other sites

Sigh. 0-based index means that the frames can be referenced by a number, starting with 0, then 1, 2, 3 etc. Did you read the helpfile?

Also, you don't want _IEFrameGetObjByName ($oFrame, "flashapp") but rather _IEGetObjByName ($oFrame, "flashapp")

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

oh opps i didnt really understand what it ment by that.

i fixed the script but im still getting error.

0006: 0-0: $oFrame = _IEFrameGetCollection($oIE, 1)
0008: 0-4: $oInput = _IEGetObjByName($oFrame, "flashapp")
d:\Program Files\AutoIt3\Include\IE.au3 (2348) : ==> The requested action with this object has failed.:
If IsObj($o_object.document.GetElementsByName($s_Id).item($i_index)) Then
If IsObj($o_object.document^ ERROR

i would really like to learn how to get this to work. It sometimes takes me awhile to understand some things but once i get help and se it working i understand more and learn from it. Thanks heaps 4 your help so far Dale.

Link to comment
Share on other sites

Please add _IEErrorHandlerRegister() as suggested earlier.

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

now when i add that its saying NoMatch flashap wasnt saying that before.

!> Starting in DebugMode..
Line: @error-@extended: Line syntax
0001: 0-0: #include <IE.au3>
0002: 0-0: #AutoIt3Wrapper_run_debug_mode=Y
0003: 0-0: $oIE = _IECreate ("http://apps.facebook.com/onthefarm/index.php")
0004: 0-0: _IEErrorHandlerRegister()
0005: 0-0: _IELoadWait($oIE)
0006: 0-0: $oFrame = _IEFrameGetCollection($oIE, 2)
0008: 0-4: $oInput = _IEGetObjByName($oFrame, "flashapp")
--> COM Error Encountered in test_DebugIt.au3
----> $IEComErrorScriptline = 2348
----> $IEComErrorNumberHex = 80020009
----> $IEComErrorNumber = -2147352567
----> $IEComErrorWinDescription = Access is denied.
----> $IEComErrorDescription = Access is denied.
----> $IEComErrorSource = 
----> $IEComErrorHelpFile = C:\WINDOWS\system32\mshtml.hlp
----> $IEComErrorHelpContext = 0
----> $IEComErrorLastDllError = 0

--> IE.au3 V2.4-0 Warning from function _IEGetObjByName, $_IEStatus_NoMatch (Name: flashapp, Index: 0)
0009: 7-0: $oInput.scrollIntoView()
--> COM Error Encountered in test_DebugIt.au3
----> $IEComErrorScriptline = 34
----> $IEComErrorNumberHex = 000000A9
----> $IEComErrorNumber = 169
----> $IEComErrorWinDescription = Variable must be of type 'Object'.
----> $IEComErrorDescription = Access is denied.
----> $IEComErrorSource = 
----> $IEComErrorHelpFile = C:\WINDOWS\system32\mshtml.hlp
----> $IEComErrorHelpContext = 0
----> $IEComErrorLastDllError = 0
Link to comment
Share on other sites

Please see reply 13.

You'll need to open of the URL of that fram in a new browser window to work around browser cross domain security restrictions.

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

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...