cyanidemonkey Posted July 15, 2009 Posted July 15, 2009 (edited) has anybody tried using the activeX flash embed to play flash files that use external xml (pretty common when externalising data in flash development) we are finding it works well when it's plain flash files, but if the .swf references external xml file for text or data it errors out saying the xml file can not be found (flash debug error, not au3 error), however the flash file runs fine in the exact same directory when not ran within AutoIt wrapper. relevent code below as example (my attempt to set base commented out, made zero difference to error): expandcollapse popup;External SWF File Name (assumed in same folder) $swffile = "FrameworkV2.swf" $winTitle = "METAL INDUSTRY GUIDELINES Module Launcher" ;Create the Shockwave Flash Object - this can contain Flex as well as Flash SWF Files $oFlash = ObjCreate("ShockwaveFlash.ShockwaveFlash") If @error Then ;no flash player error here. MsgBox(48, "Error", "Unable to launch course." & @LF & "Adobe Flash Player not on this system." & @LF & "Contact your IT Department.") Exit EndIf ;Create the AutoIT GUI Window $hModWnd = GuiCreate($winTitle, 1024, 768, -1, -1, $WS_POPUP ) ;Create the ActiveX Container $GUIActiveX = GUICtrlCreateObj( $oFlash, 0, 0 , 1024, 768 ) ;Set up event handling for Flex externalAPI calls $SinkObject=ObjEvent($oFlash, "Flash_") ; ;Set up COM error handling $oMyError = ObjEvent("AutoIt.Error","COMErrFunc") ;Initialize the Flash ActiveX With $oFlash; Object tag pool .Movie = FileGetShortName(@scriptdir & '\' & $swffile) .ScaleMode = 3; 0 showall, 1 noborder, 2 exactFit, 3 noscale .bgcolor = "#000000" .Loop = False .wmode = "transparent"; Opaque / transparent .allowScriptAccess = "Always" ; .base = "." ; .base = @scriptdir & '\.' ; .base = @scriptdir & "\" ; .src = FileGetShortName(@scriptdir & '\' & $swffile) ; .id = "FrameworkV2" ; .name = "FrameworkV2" EndWith Edited July 15, 2009 by cyanidemonkey My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator
Authenticity Posted July 15, 2009 Posted July 15, 2009 Maybe it's because of a security sandbox exception that prevent the content to be loaded because of security design? Try to load the SWF file from another SWF file and load the loader file using AutoIt. You may want to look in the Loader class, especially the second parameter of the constructor. If it's AS3 AVM2 loading AVM1 code then I guess there won't be any issues but the opposite is not true. ...and I might be totally wrong because of lacking of a few cells.
cyanidemonkey Posted July 16, 2009 Author Posted July 16, 2009 i don't think it's security sandbox related. the flash debug error is always the same, no matter what is put in the base of the activeX flash embed code. Error: Could not load course definition from 'file://course/course.xml': Error #2032: Stream Error. URL: file://course/course.xml ran as a .swf, or flash compiled .exe, no issue, just using activeX object this comes up. i believe it is an ActiveX/shockwaveflash player issue, just thought someone may have already had an au3 work around. My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator
Authenticity Posted July 16, 2009 Posted July 16, 2009 Can you post the link to the site hosting the SWF file?
cyanidemonkey Posted July 16, 2009 Author Posted July 16, 2009 (edited) Can you post the link to the site hosting the SWF file?It's not internet based it's local for CDrom. I can not post it due to comercial sensitivity and all that blah.Our geekiest programmer has got around it by not using ActiveX, but calling the Flash.ocx and a bunch of other stuff to make flash not change the base path in C. Sorry, I can not post the C work around to be emulated in au3, I'd get in trouble with work. I know it was not an easy fix, it took him about 4 days on it.He did say he got around it by setting a URLmonica or something like that, changing foward slashes to back slashes and that it had to be a URLmonica not a file monica, and that Flash is very fussy about it.All over my head, but if it stears anyone in the right direction I hope it helps. Edited July 16, 2009 by cyanidemonkey My AutoIt Scripts.- AutoHost and Password Enabler for Delta Force 2 Demo.| Caffine for Winamp 2.9x and WRS 2.0 | mp3 directory cleaner | CRAP DJ | A:B:J Radio Automation Software | FFMPEG batch conversion automator
Richard Robertson Posted July 17, 2009 Posted July 17, 2009 Adobe decided that local flash objects aren't allowed to execute local data on a user's computer unless you allow it to in the settings panel (which is only available on Adobe's website for-who-knows-what-reason). I ran into this problem a while back. It started just after Adobe took control of Flash.
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