On 02/07/07, Octavian Rasnita <[EMAIL PROTECTED]> wrote:
Is it possible to display a Flash annimation in a window created with
Win32::GUI?

If yes, please tell me how. I think that it should be possible to do it
using Win32::GUI::AxWindow but I don't know what control name to use in
the -control option.

See below for an example.

BTW, for other type of controls, where can I find the control name I need to
use in a Win32::GUI::AxWindow object?

If you haven't tried it, then there is an AxWindow demo distributed
with Win32::GUI called 'InfoControl.pl' - it reads a list of all
ActiveX components installed on your PC, and lets you selets one and
see the propeties/methods available.   By browsing the list you can
usually make a pretty good guess as to what you're looking for.

Regards,
Rob.

#!perl -w
use strict;
use warnings;

# Demo of Shockwave flash player embedded in a window
# using Win32::GUI::AxWindow.  The Shockwave
# player ActiveX control is available from www.adobe.com

use Win32::GUI qw(WS_CLIPCHILDREN);
use Win32::GUI::AxWindow();

# It appears that this must be a full URL, and not a relative path
my $movie = 'file:///C:/TOUR.SWF';

# main Window
my $mw = new Win32::GUI::Window (
   -title => "Win32::GUI::AxWindow Shockwave Flash demo",
   -pos   => [100, 100],
   -size  => [400, 400],
   -name  => "Window",
   -addstyle => WS_CLIPCHILDREN,
        -onResize => \&resize,
) or die "new Window";

# Create AxWindow
my $Control = new Win32::GUI::AxWindow  (
   -parent  => $mw,
   -name    => "Control",
   -pos     => [0, 0],
   -size    => [400, 400],
   -control => "ShockwaveFlash.ShockwaveFlash",
) or die "new Control";

$Control->CallMethod("LoadMovie", 0, $movie);
$Control->CallMethod("Play");

# Event loop
$mw->Show();
Win32::GUI::Dialog();
$mw->Hide();
exit(0);

# Main window event handler

sub resize {
        my ($self) = @_;

        $self->Control->Resize ( ($self->GetClientRect)[2..3] );

        return;
}
__END__

Reply via email to