Shockwave Flash in dialog
-
Does anyone here know how to use the Shockwave Flash OCX in a dialog. I'm not sure which wrapper functions to use to get the thing working. I'm using VC++ 7 with MFC. I have Macromedia Flash 5.0.44.0 installed and I can play Flash in IE6. I want to create a dialog box that plays a Flash (.swf) file. I inserted the Shockwave Flash ActiveX (OCX) control into my dialog. VC++ added an IDispatch wrapper class, CShockwaveflash, to my project and to the dialog class. My dialog is defined like this:
class CMyDlg : public CDialog { DECLARE_DYNAMIC(CMyDlg) public: CMyDlg(CWnd* pParent = NULL); // standard constructor virtual ~CMyDlg(); // Dialog Data enum { IDD = IDD_MYDIALOG }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support virtual BOOL OnInitDialog(); DECLARE_MESSAGE_MAP() public: CShockwaveflash m_FlashCtrl; };
In my implementation....BOOL CMyDlg::OnInitDialog() { if (CDialog::OnInitDialog()) { m_FlashCtrl.put_Movie(_T("sample.swf")); m_FlashCtrl.Play(); return TRUE; } return FALSE; }
When I run the dialog, the OCX shows the default background but no flash video. I can't find any documentation on using this OCX, even at Macromedia. Any sample code that works? thanks in advance, Andrew -
Does anyone here know how to use the Shockwave Flash OCX in a dialog. I'm not sure which wrapper functions to use to get the thing working. I'm using VC++ 7 with MFC. I have Macromedia Flash 5.0.44.0 installed and I can play Flash in IE6. I want to create a dialog box that plays a Flash (.swf) file. I inserted the Shockwave Flash ActiveX (OCX) control into my dialog. VC++ added an IDispatch wrapper class, CShockwaveflash, to my project and to the dialog class. My dialog is defined like this:
class CMyDlg : public CDialog { DECLARE_DYNAMIC(CMyDlg) public: CMyDlg(CWnd* pParent = NULL); // standard constructor virtual ~CMyDlg(); // Dialog Data enum { IDD = IDD_MYDIALOG }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support virtual BOOL OnInitDialog(); DECLARE_MESSAGE_MAP() public: CShockwaveflash m_FlashCtrl; };
In my implementation....BOOL CMyDlg::OnInitDialog() { if (CDialog::OnInitDialog()) { m_FlashCtrl.put_Movie(_T("sample.swf")); m_FlashCtrl.Play(); return TRUE; } return FALSE; }
When I run the dialog, the OCX shows the default background but no flash video. I can't find any documentation on using this OCX, even at Macromedia. Any sample code that works? thanks in advance, Andrew -
Hi Give the full path of swf file (
m_FlashCtrl.put_Movie(_T("c:\sample.swf"));
) and try. Best wishes..mil10Thanks, that fixed it (with backslashes appropriately escaped, "c:\\flash\\sample.swf"). I had previously tried ".\\sample.swf" to force it to read from the current directory, but that didn't work. So perhaps the full path is always required by Flash.ocx !? cheers! Andrew