Re: Weird problem with Perl binding.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My environment is Debian Linux 2.6.18-4-486, perl 5.10.0 with SWF 0.4.0-beta6.

Thanks

Yung-chung Lin


On Fri, Aug 8, 2008 at 9:49 PM, ☼ 林永忠 ☼ (Yung-chung Lin) <henearkrxern@xxxxxxxxx> wrote:
This line: my $soundobject = SWF::Sound->new("snore.wav", $flag);

Thanks.

Yung-chung Lin



On Fri, Aug 8, 2008 at 8:36 PM, Klaus Rechert <klaus@xxxxxxxxxx> wrote:
Hi,

do you have a line number associated with the error message?

  Klaus

Hi,

I put a sound file in a swf file, but I encountered a weird problem. It emitted a message like "Modification of a read-only value attempted" when I tried to use SWF::Sound->new.

My code is listed below. Hope someone can help. Thanks.

#!/usr/bin/perl

use strict;
use warnings;
use Data::Dumper;
use SWF::Constants qw(SWFBUTTON_HIT SWFBUTTON_UP SWFBUTTON_DOWN SWFBUTTON_OVER);
use SWF qw(Action Bitmap Button Constants DisplayItem Fill Font Gradient Morph Movie MovieClip PrebuiltClip Shape Sound Text TextField);

sub main {
   my $m = new SWF::Movie();
   $m->setBackground(0xff,0xcc,0x0);
   $m->setDimension(200,100);

   my $b = new SWF::Button();

   my $filename = 'snore.wav';
   my $flag = SWF::Constants::SWF_SOUND_22KHZ | SWF::Constants::SWF_SOUND_8BITS | SWF::Constants::SWF_SOUND_MONO;

   my $soundobject = SWF::Sound->new("snore.wav", $flag);

   my $soundinstance = $b->addSound($soundobject, SWF::Constants::SWFBUTTON_HIT);

   my $s = new SWF::Shape();
   my $f = $s->addFill(0xff, 0, 0);
   $s->setRightFill($f);

   $s->movePenTo(0, 0);
   $s->drawLineTo(20, 0);
   $s->drawLineTo(20, 20);
   $s->drawLineTo(0, 20);
   $s->drawLineTo(0, 0);

   $b->addShape($s, SWF::Constants::SWFBUTTON_HIT | SWF::Constants::SWFBUTTON_UP | SWF::Constants::SWFBUTTON_DOWN | SWF::Constants::SWFBUTTON_OVER);

   $m->add($b);
   $m->nextFrame();

   $m->save("root/static/flash/empty.swf");
}

main(@ARGV);


Yung-chung Lin
------------------------------------------------------------------------

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url="">
------------------------------------------------------------------------

_______________________________________________
Ming-users mailing list
Ming-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ming-users
 



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ming-users mailing list
Ming-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/ming-users

[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux