Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Anyone use SWF::Builder?

Status
Not open for further replies.

iluvperl

Programmer
Joined
Jan 22, 2006
Messages
107
I am trying to load an image into a SWF file. It should be simple but I am getting the error "Can't get the width and height of /home/everyday/public_html/pictures/100.jpg at /home/everyday/public_html/lib/SWF/Builder.pm line 189".

Code:
#!/usr/bin/perl -w

use strict;

use CGI::Carp qw(fatalsToBrowser);

use lib "/home/everyday/public_html/lib";

use SWF::Builder;

my $movie = SWF::Builder->new
    ( FrameRate => 15,
      FrameSize => [15, 15, 400, 400],
      BackgroundColor => 'ffffff'
      );

my $jpeg = $movie->new_jpeg('/home/everyday/public_html/pictures/100.jpg');

$jpeg->place;

$movie->save('winter.swf');

I was using a partial file path originally, but it didn't make any difference. The image is in the right place and permissions are set. I just don't see what the problem is.

Anyone familiar with this?

Thanks!
 
Does the SWF::Builder module need any other modules to be installed too? The documentation says it's a wrapper for SWF::File
 
I don't think so.

My host installed SWF::File, SWF::Builer and Data:TemporaryBag.pm .

That should be everything.
 
I don't know what all is needed or included with the SWF::File library, and I have never used the module you are using and a quick read of the documentation didn't enlighten me. Hopefully someone else will have a suggestion.
 
That's the main problem. The docs on all the SWF* library are pretty sappy. No real documentation or examples.
 
Here is what I'm doing. works great.


#new movie
my $movie = SWF::Builder->new
( FrameRate => 12,
FrameSize => [0, 0, 1280,1000 ],
BackgroundColor => 'ffffff'
);

###add the background
my $jpg = $movie->new_jpeg("/home/wireless/public_html/image.jpg");

my $bground = $movie->new_shape
->fillstyle($jpg, 'clipped', undef)
->box(0, 0, 1280, 1000);
my $bground_instance = $bground->place;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top