Re: [newbie] Embedding Flash OCX object



Thanks Kartic,

Don't know if i have understand everything, but i 'll try using your lights,

To integrate a flash movie using wx, here is a piece of code (the Flash.py
is auto-generated by makepy.py)

### testFlash.py
from wxPython.wx import *
import os

if wxPlatform == '__WXMSW__':
from wxPython.lib.activexwrapper import MakeActiveXClass
#import win32com.client.gencache
#import win32com.client
import flash

flashControl = flash

class FlashPanel(wxPanel):
def __init__(self, parent, flashFile):
wxPanel.__init__(self, parent, -1)

sizer = wxBoxSizer(wxVERTICAL)

ActiveXWrapper = MakeActiveXClass(flashControl.ShockwaveFlash)
self.Flash = ActiveXWrapper( self, -1)
self.Flash.Movie = os.path.join(os.getcwd(), flashFile)
self.Flash.Menu=False
self.Flash.OnFSCommand = self.OnFSCommand

sizer.Add(self.Flash, 1, wxEXPAND)
self.SetSizer(sizer)
self.SetAutoLayout(True)

EVT_WINDOW_DESTROY(self, self.OnDestroy)

def OnDestroy(self, evt):
if self.Flash:
self.Flash.Cleanup()
self.Flash = None

def OnFSCommand(self, command, *args):

if command=="openFile":
self.openFile()
if command=="saveFile":
self.saveFile(*args)


def openFile(self):
dlg = wxFileDialog(self, "Choose", "", "", "*.*", wxOPEN)
if dlg.ShowModal()==wxID_OK:
filename = dlg.GetFilename()
dirname = dlg.GetDirectory()
f = open(os.path.join(dirname, filename), "r")
self.Flash.SetVariable("PyReply", f.read())
f.close()
dlg.Destroy()

def saveFile(self, text):
dlg = wxFileDialog(self, "Save As", "", "", "*.*",
wxSAVE|wxOVERWRITE_PROMPT)
if dlg.ShowModal()==wxID_OK:
filename = dlg.GetFilename()
dirname = dlg.GetDirectory()
f = open(os.path.join(dirname, filename), "w")
f.write(text)
f.close()
dlg.Destroy()


if __name__ == '__main__':
class FlashFrame(wxFrame):
def __init__(self):
wxFrame.__init__(self, None, -1, "PyFlash -- Simple File Viewer",
size=(550, 400))
self.flashPanel = FlashPanel(self, "testFlash.swf")

app = wxPySimpleApp()
frame = FlashFrame()
frame.Show(True)
app.MainLoop()
### Flash.py

# -*- coding: mbcs -*-
# Created by makepy.py version 0.4.8
# By python version 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit
(Intel)]
# From type library '{D27CDB6B-AE6D-11CF-96B8-444553540000}'
# On Tue Mar 16 01:58:37 2004
"""Shockwave Flash"""
makepy_version = '0.4.8'
python_version = 0x20303f0

import win32com.client.CLSIDToClass, pythoncom
import win32com.client.util
from pywintypes import IID
from win32com.client import Dispatch

# The following 3 lines may need tweaking for the particular server
# Candidates are pythoncom.Missing and pythoncom.Empty
defaultNamedOptArg=pythoncom.Empty
defaultNamedNotOptArg=pythoncom.Empty
defaultUnnamedArg=pythoncom.Empty

CLSID = IID('{D27CDB6B-AE6D-11CF-96B8-444553540000}')
MajorVersion = 1
MinorVersion = 0
LibraryFlags = 8
LCID = 0x0

from win32com.client import DispatchBaseClass
class IShockwaveFlash(DispatchBaseClass):
"""Shockwave Flash"""
CLSID = IID('{D27CDB6C-AE6D-11CF-96B8-444553540000}')
coclass_clsid = IID('{D27CDB6E-AE6D-11CF-96B8-444553540000}')

#default_interface = IShockwaveFlash
#default_source = _IShockwaveFlashEvents

def Back(self):
"""method Back"""
return self._oleobj_.InvokeTypes(114, LCID, 1, (24, 0), (),)

def CurrentFrame(self):
"""method CurrentFrame"""
return self._oleobj_.InvokeTypes(128, LCID, 1, (3, 0), (),)

def FlashVersion(self):
"""method FlashVersion"""
return self._oleobj_.InvokeTypes(132, LCID, 1, (3, 0), (),)

def Forward(self):
"""method Forward"""
return self._oleobj_.InvokeTypes(115, LCID, 1, (24, 0), (),)

def FrameLoaded(self, FrameNum=defaultNamedNotOptArg):
"""method FrameLoaded"""
return self._oleobj_.InvokeTypes(131, LCID, 1, (11, 0), ((3,
1),),FrameNum)

def GetVariable(self, name=defaultNamedNotOptArg):
"""method GetVariable"""
# Result is a Unicode object - return as-is for this version of Python
return self._oleobj_.InvokeTypes(152, LCID, 1, (8, 0), ((8, 1),),name)

def GotoFrame(self, FrameNum=defaultNamedNotOptArg):
"""method GotoFrame"""
return self._oleobj_.InvokeTypes(127, LCID, 1, (24, 0), ((3,
1),),FrameNum)

def IsPlaying(self):
"""method IsPlaying"""
return self._oleobj_.InvokeTypes(129, LCID, 1, (11, 0), (),)

def LoadMovie(self, layer=defaultNamedNotOptArg,
url=defaultNamedNotOptArg):
"""method LoadMovie"""
return self._oleobj_.InvokeTypes(142, LCID, 1, (24, 0), ((3, 1), (8,
1)),layer, url)

def Pan(self, x=defaultNamedNotOptArg, y=defaultNamedNotOptArg,
mode=defaultNamedNotOptArg):
"""method Pan"""
return self._oleobj_.InvokeTypes(119, LCID, 1, (24, 0), ((3, 1), (3, 1),
(3, 1)),x, y, mode)

def PercentLoaded(self):
"""method PercentLoaded"""
return self._oleobj_.InvokeTypes(130, LCID, 1, (3, 0), (),)

def Play(self):
"""method Play"""
return self._oleobj_.InvokeTypes(112, LCID, 1, (24, 0), (),)

def Rewind(self):
"""method Rewind"""
return self._oleobj_.InvokeTypes(116, LCID, 1, (24, 0), (),)

def SetVariable(self, name=defaultNamedNotOptArg,
value=defaultNamedNotOptArg):
"""method SetVariable"""
return self._oleobj_.InvokeTypes(151, LCID, 1, (24, 0), ((8, 1), (8,
1)),name, value)

def SetZoomRect(self, left=defaultNamedNotOptArg,
top=defaultNamedNotOptArg, right=defaultNamedNotOptArg,
bottom=defaultNamedNotOptArg):
"""method SetZoomRect"""
return self._oleobj_.InvokeTypes(109, LCID, 1, (24, 0), ((3, 1), (3, 1),
(3, 1), (3, 1)),left, top, right, bottom)

def Stop(self):
"""method Stop"""
return self._oleobj_.InvokeTypes(113, LCID, 1, (24, 0), (),)

def StopPlay(self):
"""method StopPlay"""
return self._oleobj_.InvokeTypes(126, LCID, 1, (24, 0), (),)

def TCallFrame(self, target=defaultNamedNotOptArg,
FrameNum=defaultNamedNotOptArg):
"""method TCallFrame"""
return self._oleobj_.InvokeTypes(155, LCID, 1, (24, 0), ((8, 1), (3,
1)),target, FrameNum)

def TCallLabel(self, target=defaultNamedNotOptArg,
label=defaultNamedNotOptArg):
"""method TCallLabel"""
return self._oleobj_.InvokeTypes(156, LCID, 1, (24, 0), ((8, 1), (8,
1)),target, label)

def TCurrentFrame(self, target=defaultNamedNotOptArg):
"""method TCurrentFrame"""
return self._oleobj_.InvokeTypes(145, LCID, 1, (3, 0), ((8, 1),),target)

def TCurrentLabel(self, target=defaultNamedNotOptArg):
"""method TCurrentLabel"""
# Result is a Unicode object - return as-is for this version of Python
return self._oleobj_.InvokeTypes(146, LCID, 1, (8, 0), ((8, 1),),target)

def TGetProperty(self, target=defaultNamedNotOptArg,
Property=defaultNamedNotOptArg):
"""method TGetProperty"""
# Result is a Unicode object - return as-is for this version of Python
return self._oleobj_.InvokeTypes(154, LCID, 1, (8, 0), ((8, 1), (3,
1)),target, Property)

def TGetPropertyAsNumber(self, target=defaultNamedNotOptArg,
Property=defaultNamedNotOptArg):
"""method TGetPropertyAsNumber"""
return self._oleobj_.InvokeTypes(172, LCID, 1, (5, 0), ((8, 1), (3,
1)),target, Property)

def TGetPropertyNum(self, target=defaultNamedNotOptArg,
Property=defaultNamedNotOptArg):
"""method TGetPropertyNum"""
return self._oleobj_.InvokeTypes(158, LCID, 1, (5, 0), ((8, 1), (3,
1)),target, Property)

def TGotoFrame(self, target=defaultNamedNotOptArg,
FrameNum=defaultNamedNotOptArg):
"""method TGotoFrame"""
return self._oleobj_.InvokeTypes(143, LCID, 1, (24, 0), ((8, 1), (3,
1)),target, FrameNum)

def TGotoLabel(self, target=defaultNamedNotOptArg,
label=defaultNamedNotOptArg):
"""method TGotoLabel"""
return self._oleobj_.InvokeTypes(144, LCID, 1, (24, 0), ((8, 1), (8,
1)),target, label)

def TPlay(self, target=defaultNamedNotOptArg):
"""method TPlay"""
return self._oleobj_.InvokeTypes(147, LCID, 1, (24, 0), ((8, 1),),target)

def TSetProperty(self, target=defaultNamedNotOptArg,
Property=defaultNamedNotOptArg, value=defaultNamedNotOptArg):
"""method TSetProperty"""
return self._oleobj_.InvokeTypes(153, LCID, 1, (24, 0), ((8, 1), (3, 1),
(8, 1)),target, Property, value)

def TSetPropertyNum(self, target=defaultNamedNotOptArg,
Property=defaultNamedNotOptArg, value=defaultNamedNotOptArg):
"""method TSetPropertyNum"""
return self._oleobj_.InvokeTypes(157, LCID, 1, (24, 0), ((8, 1), (3, 1),
(5, 1)),target, Property, value)

def TStopPlay(self, target=defaultNamedNotOptArg):
"""method TStopPlay"""
return self._oleobj_.InvokeTypes(148, LCID, 1, (24, 0), ((8, 1),),target)

def Zoom(self, factor=defaultNamedNotOptArg):
"""method Zoom"""
return self._oleobj_.InvokeTypes(118, LCID, 1, (24, 0), ((3, 1),),factor)

_prop_map_get_ = {
"AlignMode": (121, 2, (3, 0), (), "AlignMode", None),
"AllowScriptAccess": (171, 2, (8, 0), (), "AllowScriptAccess", None),
"BGColor": (140, 2, (8, 0), (), "BGColor", None),
"BackgroundColor": (123, 2, (3, 0), (), "BackgroundColor", None),
"Base": (136, 2, (8, 0), (), "Base", None),
"DeviceFont": (138, 2, (11, 0), (), "DeviceFont", None),
"EmbedMovie": (139, 2, (11, 0), (), "EmbedMovie", None),
"FlashVars": (170, 2, (8, 0), (), "FlashVars", None),
"FrameNum": (107, 2, (3, 0), (), "FrameNum", None),
"InlineData": (191, 2, (13, 0), (), "InlineData", None),
"Loop": (106, 2, (11, 0), (), "Loop", None),
"Menu": (135, 2, (11, 0), (), "Menu", None),
"Movie": (102, 2, (8, 0), (), "Movie", None),
"MovieData": (190, 2, (8, 0), (), "MovieData", None),
"Playing": (125, 2, (11, 0), (), "Playing", None),
"Quality": (105, 2, (3, 0), (), "Quality", None),
"Quality2": (141, 2, (8, 0), (), "Quality2", None),
"ReadyState": (-525, 2, (3, 0), (), "ReadyState", None),
"SAlign": (134, 2, (8, 0), (), "SAlign", None),
"SWRemote": (159, 2, (8, 0), (), "SWRemote", None),
"Scale": (137, 2, (8, 0), (), "Scale", None),
"ScaleMode": (120, 2, (3, 0), (), "ScaleMode", None),
"SeamlessTabbing": (192, 2, (11, 0), (), "SeamlessTabbing", None),
"TotalFrames": (124, 2, (3, 0), (), "TotalFrames", None),
"WMode": (133, 2, (8, 0), (), "WMode", None),
}
_prop_map_put_ = {
"AlignMode": ((121, LCID, 4, 0),()),
"AllowScriptAccess": ((171, LCID, 4, 0),()),
"BGColor": ((140, LCID, 4, 0),()),
"BackgroundColor": ((123, LCID, 4, 0),()),
"Base": ((136, LCID, 4, 0),()),
"DeviceFont": ((138, LCID, 4, 0),()),
"EmbedMovie": ((139, LCID, 4, 0),()),
"FlashVars": ((170, LCID, 4, 0),()),
"FrameNum": ((107, LCID, 4, 0),()),
"InlineData": ((191, LCID, 4, 0),()),
"Loop": ((106, LCID, 4, 0),()),
"Menu": ((135, LCID, 4, 0),()),
"Movie": ((102, LCID, 4, 0),()),
"MovieData": ((190, LCID, 4, 0),()),
"Playing": ((125, LCID, 4, 0),()),
"Quality": ((105, LCID, 4, 0),()),
"Quality2": ((141, LCID, 4, 0),()),
"SAlign": ((134, LCID, 4, 0),()),
"SWRemote": ((159, LCID, 4, 0),()),
"Scale": ((137, LCID, 4, 0),()),
"ScaleMode": ((120, LCID, 4, 0),()),
"SeamlessTabbing": ((192, LCID, 4, 0),()),
"WMode": ((133, LCID, 4, 0),()),
}

class _IShockwaveFlashEvents:
"""Event interface for Shockwave Flash"""
CLSID = CLSID_Sink = IID('{D27CDB6D-AE6D-11CF-96B8-444553540000}')
coclass_clsid = IID('{D27CDB6E-AE6D-11CF-96B8-444553540000}')
_public_methods_ = [] # For COM Server support
_dispid_to_func_ = {
150 : "OnFSCommand",
1958 : "OnProgress",
-609 : "OnReadyStateChange",
}

def __init__(self, oobj = None):
if oobj is None:
self._olecp = None
else:
import win32com.server.util
from win32com.server.policy import EventHandlerPolicy
cpc=oobj._oleobj_.QueryInterface(pythoncom.IID_IConnectionPointContainer)
cp=cpc.FindConnectionPoint(self.CLSID_Sink)
cookie=cp.Advise(win32com.server.util.wrap(self,
usePolicy=EventHandlerPolicy))
self._olecp,self._olecp_cookie = cp,cookie
def __del__(self):
try:
self.close()
except pythoncom.com_error:
pass
def close(self):
if self._olecp is not None:
cp,cookie,self._olecp,self._olecp_cookie =
self._olecp,self._olecp_cookie,None,None
cp.Unadvise(cookie)
def _query_interface_(self, iid):
import win32com.server.util
if iid==self.CLSID_Sink: return win32com.server.util.wrap(self)

# Event Handlers
# If you create handlers, they should have the following prototypes:
# def OnFSCommand(self, command=defaultNamedNotOptArg,
args=defaultNamedNotOptArg): pass
# def OnProgress(self, percentDone=defaultNamedNotOptArg):
# def OnReadyStateChange(self, newState=defaultNamedNotOptArg):


from win32com.client import CoClassBaseClass
class FlashObjectInterface(CoClassBaseClass): # A CoClass
# IFlashObjectInterface Interface
CLSID = IID('{D27CDB71-AE6D-11CF-96B8-444553540000}')
coclass_sources = [
]
coclass_interfaces = [
]

class FlashProp(CoClassBaseClass): # A CoClass
# Macromedia Flash Player Properties
CLSID = IID('{1171A62F-05D2-11D1-83FC-00A0C9089C5A}')
coclass_sources = [
]
coclass_interfaces = [
]

# This CoClass is known by the name 'ShockwaveFlash.ShockwaveFlash.1'
class ShockwaveFlash(CoClassBaseClass): # A CoClass
# Shockwave Flash
CLSID = IID('{D27CDB6E-AE6D-11CF-96B8-444553540000}')
coclass_sources = [
_IShockwaveFlashEvents,
]
default_source = _IShockwaveFlashEvents
coclass_interfaces = [
IShockwaveFlash,
]
default_interface = IShockwaveFlash

IDispatchEx_vtables_dispatch_ = 1
IDispatchEx_vtables_ = [
(('GetDispID', 'bstrName', 'grfdex', 'pid'), 1610743808, (1610743808, (),
[(8, 1, None, None), (19, 1, None, None), (16387, 2, None, None)], 1, 1, 4,
0, 28, (3, 0, None, None), 0)),
(('RemoteInvokeEx', 'id', 'lcid', 'dwFlags', 'pdp', 'pvarRes', 'pei',
'pspCaller', 'cvarRefArg', 'rgiRefArg', 'rgvarRefArg'), 1610743809,
(1610743809, (), [(3, 1, None, None), (19, 1, None, None), (19, 1, None,
None), (36, 1, None, None), (16396, 2, None, None), (36, 2, None, None),
(13, 1, None, "IID('{6D5140C1-7436-11CE-8034-00AA006009FA}')"), (3, 1, None,
None), (16387, 1, None, None), (16396, 3, None, None)], 1, 1, 4, 0, 32, (3,
0, None, None), 0)),
(('DeleteMemberByName', 'bstrName', 'grfdex'), 1610743810, (1610743810, (),
[(8, 1, None, None), (19, 1, None, None)], 1, 1, 4, 0, 36, (3, 0, None,
None), 0)),
(('DeleteMemberByDispID', 'id'), 1610743811, (1610743811, (), [(3, 1, None,
None)], 1, 1, 4, 0, 40, (3, 0, None, None), 0)),
(('GetMemberProperties', 'id', 'grfdexFetch', 'pgrfdex'), 1610743812,
(1610743812, (), [(3, 1, None, None), (19, 1, None, None), (16403, 2, None,
None)], 1, 1, 4, 0, 44, (3, 0, None, None), 0)),
(('GetMemberName', 'id', 'pbstrName'), 1610743813, (1610743813, (), [(3, 1,
None, None), (16392, 2, None, None)], 1, 1, 4, 0, 48, (3, 0, None, None),
0)),
(('GetNextDispID', 'grfdex', 'id', 'pid'), 1610743814, (1610743814, (),
[(19, 1, None, None), (3, 1, None, None), (16387, 2, None, None)], 1, 1, 4,
0, 52, (3, 0, None, None), 0)),
(('GetNameSpaceParent', 'ppunk'), 1610743815, (1610743815, (), [(16397, 2,
None, None)], 1, 1, 4, 0, 56, (3, 0, None, None), 0)),
]

IFlashFactory_vtables_dispatch_ = 0
IFlashFactory_vtables_ = [
]

IFlashObjectInterface_vtables_dispatch_ = 1
IFlashObjectInterface_vtables_ = [
]

IServiceProvider_vtables_dispatch_ = 0
IServiceProvider_vtables_ = [
(('RemoteQueryService', 'guidService', 'riid', 'ppvObject'), 1610678272,
(1610678272, (), [(36, 1, None, None), (36, 1, None, None), (16397, 2, None,
None)], 1, 1, 4, 0, 12, (3, 0, None, None), 0)),
]

IShockwaveFlash_vtables_dispatch_ = 1
IShockwaveFlash_vtables_ = [
(('ReadyState', 'pVal'), -525, (-525, (), [(16387, 10, None, None)], 1, 2,
4, 0, 28, (3, 0, None, None), 0)),
(('TotalFrames', 'pVal'), 124, (124, (), [(16387, 10, None, None)], 1, 2,
4, 0, 32, (3, 0, None, None), 0)),
(('Playing', 'pVal'), 125, (125, (), [(16395, 10, None, None)], 1, 2, 4, 0,
36, (3, 0, None, None), 0)),
(('Playing', 'pVal'), 125, (125, (), [(11, 1, None, None)], 1, 4, 4, 0, 40,
(3, 0, None, None), 0)),
(('Quality', 'pVal'), 105, (105, (), [(16387, 10, None, None)], 1, 2, 4, 0,
44, (3, 0, None, None), 0)),
(('Quality', 'pVal'), 105, (105, (), [(3, 1, None, None)], 1, 4, 4, 0, 48,
(3, 0, None, None), 0)),
(('ScaleMode', 'pVal'), 120, (120, (), [(16387, 10, None, None)], 1, 2, 4,
0, 52, (3, 0, None, None), 0)),
(('ScaleMode', 'pVal'), 120, (120, (), [(3, 1, None, None)], 1, 4, 4, 0,
56, (3, 0, None, None), 0)),
(('AlignMode', 'pVal'), 121, (121, (), [(16387, 10, None, None)], 1, 2, 4,
0, 60, (3, 0, None, None), 0)),
(('AlignMode', 'pVal'), 121, (121, (), [(3, 1, None, None)], 1, 4, 4, 0,
64, (3, 0, None, None), 0)),
(('BackgroundColor', 'pVal'), 123, (123, (), [(16387, 10, None, None)], 1,
2, 4, 0, 68, (3, 0, None, None), 0)),
(('BackgroundColor', 'pVal'), 123, (123, (), [(3, 1, None, None)], 1, 4, 4,
0, 72, (3, 0, None, None), 0)),
(('Loop', 'pVal'), 106, (106, (), [(16395, 10, None, None)], 1, 2, 4, 0,
76, (3, 0, None, None), 0)),
(('Loop', 'pVal'), 106, (106, (), [(11, 1, None, None)], 1, 4, 4, 0, 80,
(3, 0, None, None), 0)),
(('Movie', 'pVal'), 102, (102, (), [(16392, 10, None, None)], 1, 2, 4, 0,
84, (3, 0, None, None), 0)),
(('Movie', 'pVal'), 102, (102, (), [(8, 1, None, None)], 1, 4, 4, 0, 88,
(3, 0, None, None), 0)),
(('FrameNum', 'pVal'), 107, (107, (), [(16387, 10, None, None)], 1, 2, 4,
0, 92, (3, 0, None, None), 0)),
(('FrameNum', 'pVal'), 107, (107, (), [(3, 1, None, None)], 1, 4, 4, 0, 96,
(3, 0, None, None), 0)),
(('SetZoomRect', 'left', 'top', 'right', 'bottom'), 109, (109, (), [(3, 1,
None, None), (3, 1, None, None), (3, 1, None, None), (3, 1, None, None)], 1,
1, 4, 0, 100, (3, 0, None, None), 0)),
(('Zoom', 'factor'), 118, (118, (), [(3, 1, None, None)], 1, 1, 4, 0, 104,
(3, 0, None, None), 0)),
(('Pan', 'x', 'y', 'mode'), 119, (119, (), [(3, 1, None, None), (3, 1,
None, None), (3, 1, None, None)], 1, 1, 4, 0, 108, (3, 0, None, None), 0)),
(('Play',), 112, (112, (), [], 1, 1, 4, 0, 112, (3, 0, None, None), 0)),
(('Stop',), 113, (113, (), [], 1, 1, 4, 0, 116, (3, 0, None, None), 0)),
(('Back',), 114, (114, (), [], 1, 1, 4, 0, 120, (3, 0, None, None), 0)),
(('Forward',), 115, (115, (), [], 1, 1, 4, 0, 124, (3, 0, None, None), 0)),
(('Rewind',), 116, (116, (), [], 1, 1, 4, 0, 128, (3, 0, None, None), 0)),
(('StopPlay',), 126, (126, (), [], 1, 1, 4, 0, 132, (3, 0, None, None),
0)),
(('GotoFrame', 'FrameNum'), 127, (127, (), [(3, 1, None, None)], 1, 1, 4,
0, 136, (3, 0, None, None), 0)),
(('CurrentFrame', 'FrameNum'), 128, (128, (), [(16387, 10, None, None)], 1,
1, 4, 0, 140, (3, 0, None, None), 0)),
(('IsPlaying', 'Playing'), 129, (129, (), [(16395, 10, None, None)], 1, 1,
4, 0, 144, (3, 0, None, None), 0)),
(('PercentLoaded', 'percent'), 130, (130, (), [(16387, 10, None, None)], 1,
1, 4, 0, 148, (3, 0, None, None), 0)),
(('FrameLoaded', 'FrameNum', 'loaded'), 131, (131, (), [(3, 1, None, None),
(16395, 10, None, None)], 1, 1, 4, 0, 152, (3, 0, None, None), 0)),
(('FlashVersion', 'version'), 132, (132, (), [(16387, 10, None, None)], 1,
1, 4, 0, 156, (3, 0, None, None), 0)),
(('WMode', 'pVal'), 133, (133, (), [(16392, 10, None, None)], 1, 2, 4, 0,
160, (3, 0, None, None), 0)),
(('WMode', 'pVal'), 133, (133, (), [(8, 1, None, None)], 1, 4, 4, 0, 164,
(3, 0, None, None), 0)),
(('SAlign', 'pVal'), 134, (134, (), [(16392, 10, None, None)], 1, 2, 4, 0,
168, (3, 0, None, None), 0)),
(('SAlign', 'pVal'), 134, (134, (), [(8, 1, None, None)], 1, 4, 4, 0, 172,
(3, 0, None, None), 0)),
(('Menu', 'pVal'), 135, (135, (), [(16395, 10, None, None)], 1, 2, 4, 0,
176, (3, 0, None, None), 0)),
(('Menu', 'pVal'), 135, (135, (), [(11, 1, None, None)], 1, 4, 4, 0, 180,
(3, 0, None, None), 0)),
(('Base', 'pVal'), 136, (136, (), [(16392, 10, None, None)], 1, 2, 4, 0,
184, (3, 0, None, None), 0)),
(('Base', 'pVal'), 136, (136, (), [(8, 1, None, None)], 1, 4, 4, 0, 188,
(3, 0, None, None), 0)),
(('Scale', 'pVal'), 137, (137, (), [(16392, 10, None, None)], 1, 2, 4, 0,
192, (3, 0, None, None), 0)),
(('Scale', 'pVal'), 137, (137, (), [(8, 1, None, None)], 1, 4, 4, 0, 196,
(3, 0, None, None), 0)),
(('DeviceFont', 'pVal'), 138, (138, (), [(16395, 10, None, None)], 1, 2, 4,
0, 200, (3, 0, None, None), 0)),
(('DeviceFont', 'pVal'), 138, (138, (), [(11, 1, None, None)], 1, 4, 4, 0,
204, (3, 0, None, None), 0)),
(('EmbedMovie', 'pVal'), 139, (139, (), [(16395, 10, None, None)], 1, 2, 4,
0, 208, (3, 0, None, None), 0)),
(('EmbedMovie', 'pVal'), 139, (139, (), [(11, 1, None, None)], 1, 4, 4, 0,
212, (3, 0, None, None), 0)),
(('BGColor', 'pVal'), 140, (140, (), [(16392, 10, None, None)], 1, 2, 4, 0,
216, (3, 0, None, None), 0)),
(('BGColor', 'pVal'), 140, (140, (), [(8, 1, None, None)], 1, 4, 4, 0, 220,
(3, 0, None, None), 0)),
(('Quality2', 'pVal'), 141, (141, (), [(16392, 10, None, None)], 1, 2, 4,
0, 224, (3, 0, None, None), 0)),
(('Quality2', 'pVal'), 141, (141, (), [(8, 1, None, None)], 1, 4, 4, 0,
228, (3, 0, None, None), 0)),
(('LoadMovie', 'layer', 'url'), 142, (142, (), [(3, 1, None, None), (8, 1,
None, None)], 1, 1, 4, 0, 232, (3, 0, None, None), 0)),
(('TGotoFrame', 'target', 'FrameNum'), 143, (143, (), [(8, 1, None, None),
(3, 1, None, None)], 1, 1, 4, 0, 236, (3, 0, None, None), 0)),
(('TGotoLabel', 'target', 'label'), 144, (144, (), [(8, 1, None, None), (8,
1, None, None)], 1, 1, 4, 0, 240, (3, 0, None, None), 0)),
(('TCurrentFrame', 'target', 'FrameNum'), 145, (145, (), [(8, 1, None,
None), (16387, 10, None, None)], 1, 1, 4, 0, 244, (3, 0, None, None), 0)),
(('TCurrentLabel', 'target', 'pVal'), 146, (146, (), [(8, 1, None, None),
(16392, 10, None, None)], 1, 1, 4, 0, 248, (3, 0, None, None), 0)),
(('TPlay', 'target'), 147, (147, (), [(8, 1, None, None)], 1, 1, 4, 0, 252,
(3, 0, None, None), 0)),
(('TStopPlay', 'target'), 148, (148, (), [(8, 1, None, None)], 1, 1, 4, 0,
256, (3, 0, None, None), 0)),
(('SetVariable', 'name', 'value'), 151, (151, (), [(8, 1, None, None), (8,
1, None, None)], 1, 1, 4, 0, 260, (3, 0, None, None), 0)),
(('GetVariable', 'name', 'pVal'), 152, (152, (), [(8, 1, None, None),
(16392, 10, None, None)], 1, 1, 4, 0, 264, (3, 0, None, None), 0)),
(('TSetProperty', 'target', 'property', 'value'), 153, (153, (), [(8, 1,
None, None), (3, 1, None, None), (8, 1, None, None)], 1, 1, 4, 0, 268, (3,
0, None, None), 0)),
(('TGetProperty', 'target', 'property', 'pVal'), 154, (154, (), [(8, 1,
None, None), (3, 1, None, None), (16392, 10, None, None)], 1, 1, 4, 0, 272,
(3, 0, None, None), 0)),
(('TCallFrame', 'target', 'FrameNum'), 155, (155, (), [(8, 1, None, None),
(3, 1, None, None)], 1, 1, 4, 0, 276, (3, 0, None, None), 0)),
(('TCallLabel', 'target', 'label'), 156, (156, (), [(8, 1, None, None), (8,
1, None, None)], 1, 1, 4, 0, 280, (3, 0, None, None), 0)),
(('TSetPropertyNum', 'target', 'property', 'value'), 157, (157, (), [(8, 1,
None, None), (3, 1, None, None), (5, 1, None, None)], 1, 1, 4, 0, 284, (3,
0, None, None), 0)),
(('TGetPropertyNum', 'target', 'property', 'pVal'), 158, (158, (), [(8, 1,
None, None), (3, 1, None, None), (16389, 10, None, None)], 1, 1, 4, 0, 288,
(3, 0, None, None), 0)),
(('TGetPropertyAsNumber', 'target', 'property', 'pVal'), 172, (172, (),
[(8, 1, None, None), (3, 1, None, None), (16389, 10, None, None)], 1, 1, 4,
0, 292, (3, 0, None, None), 0)),
(('SWRemote', 'pVal'), 159, (159, (), [(16392, 10, None, None)], 1, 2, 4,
0, 296, (3, 0, None, None), 0)),
(('SWRemote', 'pVal'), 159, (159, (), [(8, 1, None, None)], 1, 4, 4, 0,
300, (3, 0, None, None), 0)),
(('FlashVars', 'pVal'), 170, (170, (), [(16392, 10, None, None)], 1, 2, 4,
0, 304, (3, 0, None, None), 0)),
(('FlashVars', 'pVal'), 170, (170, (), [(8, 1, None, None)], 1, 4, 4, 0,
308, (3, 0, None, None), 0)),
(('AllowScriptAccess', 'pVal'), 171, (171, (), [(16392, 10, None, None)],
1, 2, 4, 0, 312, (3, 0, None, None), 0)),
(('AllowScriptAccess', 'pVal'), 171, (171, (), [(8, 1, None, None)], 1, 4,
4, 0, 316, (3, 0, None, None), 0)),
(('MovieData', 'pVal'), 190, (190, (), [(16392, 10, None, None)], 1, 2, 4,
0, 320, (3, 0, None, None), 0)),
(('MovieData', 'pVal'), 190, (190, (), [(8, 1, None, None)], 1, 4, 4, 0,
324, (3, 0, None, None), 0)),
(('InlineData', 'ppIUnknown'), 191, (191, (), [(16397, 10, None, None)], 1,
2, 4, 0, 328, (3, 0, None, None), 0)),
(('InlineData', 'ppIUnknown'), 191, (191, (), [(13, 1, None, None)], 1, 4,
4, 0, 332, (3, 0, None, None), 0)),
(('SeamlessTabbing', 'pVal'), 192, (192, (), [(16395, 10, None, None)], 1,
2, 4, 0, 336, (3, 0, None, None), 0)),
(('SeamlessTabbing', 'pVal'), 192, (192, (), [(11, 1, None, None)], 1, 4,
4, 0, 340, (3, 0, None, None), 0)),
]

RecordMap = {
}

CLSIDToClassMap = {
'{D27CDB6C-AE6D-11CF-96B8-444553540000}' : IShockwaveFlash,
'{D27CDB6D-AE6D-11CF-96B8-444553540000}' : _IShockwaveFlashEvents,
'{D27CDB6E-AE6D-11CF-96B8-444553540000}' : ShockwaveFlash,
'{D27CDB71-AE6D-11CF-96B8-444553540000}' : FlashObjectInterface,
'{1171A62F-05D2-11D1-83FC-00A0C9089C5A}' : FlashProp,
}
CLSIDToPackageMap = {}
win32com.client.CLSIDToClass.RegisterCLSIDsFromDict( CLSIDToClassMap )
VTablesToPackageMap = {}
VTablesToClassMap = {
'{D27CDB72-AE6D-11CF-96B8-444553540000}' : 'IFlashObjectInterface',
'{D27CDB6C-AE6D-11CF-96B8-444553540000}' : 'IShockwaveFlash',
'{A6EF9860-C720-11D0-9337-00A0C90DCAA9}' : 'IDispatchEx',
'{D27CDB70-AE6D-11CF-96B8-444553540000}' : 'IFlashFactory',
'{6D5140C1-7436-11CE-8034-00AA006009FA}' : 'IServiceProvider',
}


NamesToIIDMap = {
'_IShockwaveFlashEvents' : '{D27CDB6D-AE6D-11CF-96B8-444553540000}',
'IFlashObjectInterface' : '{D27CDB72-AE6D-11CF-96B8-444553540000}',
'IFlashFactory' : '{D27CDB70-AE6D-11CF-96B8-444553540000}',
'IShockwaveFlash' : '{D27CDB6C-AE6D-11CF-96B8-444553540000}',
'IServiceProvider' : '{6D5140C1-7436-11CE-8034-00AA006009FA}',
'IDispatchEx' : '{A6EF9860-C720-11D0-9337-00A0C90DCAA9}',
}





"Kartic" <removethis.kartic.krishnamurthy@xxxxxxxxx> a écrit dans le message
de news: 6URce.2055$2f2.1166@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> The Great 'Exeem' uttered these words on 4/30/2005 11:37 AM:
>> Kartic,
>>
>> Thanks for your reply,
>>
>> I already use the wxPython to embbed my flash animation
>>
>> ###
>> from wxPython.lib.activexwrapper import MakeActiveXClass
>>
>> ActiveXWrapper = MakeActiveXClass(flashActiveXLib.ShockwaveFlash,
>> eventClass=None, eventObj=self)
>>
>> Flash = ActiveXWrapper( self, -1, style=wxSUNKEN_BORDER)
>> ####
>>
>> It work fine and i can control my flash animation from Python without
>> problem..
>>
>> But the Wrapper need the flash.ock to be installed on the user system in
>> order to work,
>> and i would like to make an executable application that include the
>> flash.ocx or load it on startup for
>> users who doesn't have the flash player installed.
>> I would like also to be able to load a flash animation from memory and
>> not to load it from external file.
>>
>> Don't know if you understand me.. Take a look at
>> http://www.flashplayercontrol.com/ .. I'd like such a solution for
>> Python,
>> don't know if i can use that dll from Python or make a module myself..
>>
>> Anyway, thank a lot for your interest
>>
>> Dan
>
>
> Dan,
>
> Ah! I see what you are trying to do. While I don't have a working piece of
> code to share with you, I can give you a few ideas that you could
> consider:
>
> 1. Supply the Macromedia OCX with your app. Try to use the wxActivex class
> and if that fails, register your copy of the OCX. You can do this either
> using a batch file invoking regsvr32 or use Win32 to register. The flip
> side: The flash will be loaded from a file rather than memory.
>
> 2. Wrap the flashplayercontrol.com's DLL in an Activex control using VB
> and distribute your OCX. And then use wxActivex to access your OCX.
>
> 3. Use SWIG to generate Python bindings for the DLL. I have never done
> this and I am sure some of the more erudite members of the newsgroup can
> shed some light.
>
> 4. Call the supplied DLL using Ctypes. In this case, you can convert the
> example under the "Features" link of that site in DLL calls using Ctypes.
> Question: How will that integrate with wx?
>
> Hope that helped a bit.
>
> Thanks,
> -Kartic


.



Relevant Pages

  • Re: flashblock version?
    ... After installing Python you just run python youtube.dl URL and then use ... mplayer etc to view the video. ... For every Flash video I've tried to access ... I haven't had any problems playing Flash videos. ...
    (comp.os.os2.apps)
  • Re: visual gui ides for python/jythpn
    ... PythonCard is a rapid way to prototype an ugly Windows GUI. ... Flash and Python: ... I would use Flash for the GUI portion of a Python app. ...
    (comp.lang.python)
  • RE: visual gui ides for python/jythpn
    ... PythonCard is a rapid way to prototype an ugly Windows GUI. ... But ONLY for prototyping. ... Flash and Python: ... I would use Flash for the GUI portion of a Python app. ...
    (comp.lang.python)
  • Network pass-through/proxy server questions
    ... I doing a project which uses Macromedia's Flash program and Python. ... I am going to use a flash app as a kind of chat app, ... Python server to act as the socket proxy ...
    (comp.lang.python)
  • Re: mp3 file or sound edit
    ... DLL are truncate files, you need to know what functions that DLL has. ... a lot of DJ's websites manage to do that, but they use FLASH to edit music, ... we can edit graphics using System.drawing. ...
    (microsoft.public.dotnet.framework.aspnet)