CheshireSoft Posted April 22, 2010 Posted April 22, 2010 I am simply trying to embed a flash movie in my application. I have pasted every single example I could find into the script editor but I can't get any of the scripts to run. Its always the same error. For instance here is an example: #include <GUIConstants.au3> Global $oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") GUICreate ("Flash", 820, 600, -1, -1) $GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 800 , 580) With $oRP .bgcolor = "#000000" .Movie = 'http://...game.swf'; .ScaleMode = 2 .Loop = True .wmode = "Opaque" .FlashVars = "" EndWith GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd $oRP = 0 GUIDelete () Exit and I get this error: Only Object-type variables allowed in a "With" statement.: With $oRP With ^ ERROR ->04:59:32 AutoIT3.exe ended.rc:1 >Exit code: 1 Time: 1.271 I get this error for every example of embedding a flash file I attempt to run.
99ojo Posted April 22, 2010 Posted April 22, 2010 (edited) Hi, try: Global $oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash") ;-)) Stefan @Edit: Sry, code works also with Global $oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") and a local swf file on Win XP SP3: #include <GUIConstants.au3> Global $oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") GUICreate ("Flash", 820, 600, -1, -1) $GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 800 , 580) With $oRP .bgcolor = "#000000" .Movie = @WindowsDir & '\Help\Tours\mmTour\intro.swf'; .ScaleMode = 2 .Loop = True .wmode = "Opaque" .FlashVars = "" EndWith GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd $oRP = 0 GUIDelete () Exit Check registry HKLM\Software\Classes\Shockwave.Shockwave entries. Edited April 22, 2010 by 99ojo
CheshireSoft Posted April 22, 2010 Author Posted April 22, 2010 Hi, try: Global $oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash") ;-)) Stefan @Edit: Sry, code works also with Global $oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") and a local swf file on Win XP SP3: #include <GUIConstants.au3> Global $oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") GUICreate ("Flash", 820, 600, -1, -1) $GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 800 , 580) With $oRP .bgcolor = "#000000" .Movie = @WindowsDir & '\Help\Tours\mmTour\intro.swf'; .ScaleMode = 2 .Loop = True .wmode = "Opaque" .FlashVars = "" EndWith GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd $oRP = 0 GUIDelete () Exit Check registry HKLM\Software\Classes\Shockwave.Shockwave entries. i dont have that in classes. maybe my error is because i dont have shockwave installed? testing now.
99ojo Posted April 22, 2010 Posted April 22, 2010 (edited) hi,i dont have shockwave installedLooks like...If your Internet Explorer plays the swf file, create an embedded IE GUI.;-))Stefan Edited April 22, 2010 by 99ojo
CheshireSoft Posted April 22, 2010 Author Posted April 22, 2010 looks like i did have shockwave installed. its still giving me this error when I try to run this code. I am running windows vista sp2. Can anyone confirm this error on vista? I am at a total loss here.
CheshireSoft Posted April 23, 2010 Author Posted April 23, 2010 heeeelp. this is a nasty bug its killing me.
99ojo Posted April 23, 2010 Posted April 23, 2010 Hi, if you don't have the registry entries HKLM\Software\Classes\Shockwave.Shockwave you have problems with creating an com object. 1) You might have only the flash player installed. Install the Shockwave Player. 2) Does your browser (IE) does play the swf files? If yes, try to create an embedded IE browser in your gui. See _IECreateEmbedded () for more info. ;-)) Stefan
CheshireSoft Posted April 23, 2010 Author Posted April 23, 2010 Hi,if you don't have the registry entries HKLM\Software\Classes\Shockwave.Shockwave you have problems with creating an com object.1) You might have only the flash player installed. Install the Shockwave Player.2) Does your browser (IE) does play the swf files? If yes, try to create an embedded IE browser in your gui.See _IECreateEmbedded () for more info.;-))Stefanhere is what my registry looks like. I am pretty sure its installed because i can view flash and shockwave in IE:also, you cannot load flash in an IE object in autoit. at least it never works for me. it always tells me there is no flash player installed but in my normal IE there is.
99ojo Posted April 23, 2010 Posted April 23, 2010 Hi, tested on WinXP SP3 and Win7 Ultimate 64 Bit as admin and normal user with AutoIt 3.3.6.1 -> no problems with generating flash object. You may try to reinstall flash player. ;-(( Stefan
CheshireSoft Posted May 18, 2010 Author Posted May 18, 2010 Hi,tested on WinXP SP3 and Win7 Ultimate 64 Bit as admin and normal user with AutoIt 3.3.6.1 -> no problems with generating flash object.You may try to reinstall flash player.;-((Stefandid you test my source or yours? can I see your source code please?
99ojo Posted May 18, 2010 Posted May 18, 2010 (edited) Hi, I can't test your code, because i don't know a http site with a direct *.swf link... Mine is listed above, but here it is again. This works on XP SP3 and Win 7 64 bit. You may have to change the filename of intro.swf on Windows 7 system to an existing swf file. #include <GUIConstants.au3> Global $oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") GUICreate ("Flash", 820, 600, -1, -1) $GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 800 , 580) With $oRP .bgcolor = "#000000" .Movie = @WindowsDir & '\Help\Tours\mmTour\intro.swf'; .ScaleMode = 2 .Loop = True .wmode = "Opaque" .FlashVars = "" EndWith GUISetState () While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd $oRP = 0 GUIDelete () Exit ;-)) Stefan Edited May 18, 2010 by 99ojo
Tvern Posted May 18, 2010 Posted May 18, 2010 (edited) The examples didn't work for me when running from Scite, but compiled it worked fine. (Win7 x64) When running from scite, no object was created. ObjCreate did work to create other objects, like IE. Adding the custom COM error handler resulted in this message: We intercepted a COM Error ! Number is: 80040154 Windescription is: Klasse is niet geregistreerd (Dutch for "Class is not registered") Hope this helps solving the issue edit: added the error info Edited May 18, 2010 by Tvern
Weasly Posted May 29, 2010 Posted May 29, 2010 Maybe you can try to re-register flash10e.ocx "regsver32 C:\Windows\System32\Macromed\Flash\flash10e.ocx"
Tvern Posted May 29, 2010 Posted May 29, 2010 Tried "regsvr32 C:\Windows\SysWOW64\Macromed\Flash\Flash10g.ocx" without success. A bit more testing reveals that: x86 run and compile both work. x64 run and compile both fail. Using Win7 Ultimate x64.
DW1 Posted May 29, 2010 Posted May 29, 2010 Tried "regsvr32 C:\Windows\SysWOW64\Macromed\Flash\Flash10g.ocx" without success.A bit more testing reveals that:x86 run and compile both work.x64 run and compile both fail.Using Win7 Ultimate x64.That makes since. Flash does not support 64-bit browsers. AutoIt3 Online Help
Tvern Posted May 29, 2010 Posted May 29, 2010 (edited) I could point out that I'm not embedding in a browser, but yeah, that'll be the problem. Not an AutoIt bug then. Thanks for the clarification. I think it's safe to assume the OP had the same problem. Edit: Didn't want to bump this up anymore as I think it's resolved, but @99ojo: I tested by running from scite (appears to use x64 by default) --- > failed Selected Run from the test.au3 file's contextmenu --- > failed Selected Run(x86) from the test.au3 file's contextmenu --- > succeeded Compiled with default settings --- > succeeded Compiled x64 --- > failed Tried the test code in this topic with local *.swf files I don't think a browser is embedded. I think the autoit GUI acts as a webbrowser. (x86, or x64) I don't think IE, or the graphic driver have anything to do with it, unless autoit embeds IE in order to embed *.swf's Edited May 30, 2010 by Tvern
99ojo Posted May 29, 2010 Posted May 29, 2010 (edited) Hi, how did you test? My example works fine on Win 7 64 Bit Ultimate (Compiled and as au3 script); but it is running as a VMWare machine. I use a local stored swf file without problems. You may post your test code if you haven't tried mine and i can test it on monday on my Win 7 machine. By the way, how do i know, which browser, 64 bit or 32 bit version, is used as embedded object? Both are available! ;-)) Stefan P.S: ?? It might be a combination of ie, flash and graphic driver ?? Edited May 29, 2010 by 99ojo
NIKHILSKYNET Posted January 17, 2014 Posted January 17, 2014 I had the same problem, it is solved when i changed Global $oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.1") to Global $oRP = ObjCreate("ShockwaveFlash.ShockwaveFlash.11") i got ShockwaveFlash.ShockwaveFlash.11 from HKLMSoftwareClassesShockwaveFlash.ShockwaveFlash.11
Moderators JLogan3o13 Posted November 20, 2017 Moderators Posted November 20, 2017 @shockwaveflash did you happen to notice this thread is 7 years old? Please don't resurrect old threads, especially when your comment really adds nothing to the original discussion. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
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