AMF-Perl
view release on metacpan or search on metacpan
Date: September 17, 2004.
This is the code and several examples that show the possibility of using Perl to talk to a Macromedia Flash client using AMF (Action Message Format).
To install:
1a. If you have access to Macromedia Flash MX, load the docs/examples/cpu/CpuExample.fla file. Edit the actions for Layer Name to use the URL of your script.
1b. If you do not have Macromedia authoringh tools, embed the
docs/examples/cpu/CpuExample.swf movie into a web page.
Use docs/examples/cpu/cpu.html as a template. When the movie starts, enter the URL of your script into the text field.
2. Observe the load of your server when you click Refresh!
Simon Ilyushchenko
doc/code.html view on Meta::CPAN
#...
return $value;
}
#Create the gateway object
my $gateway = AMF::Perl->new;
#Register a service that provides methods.
#You can register more than one service.
#This can happen during server startup (if running under mod_perl).
$gateway->registerService("Foo",new Foo());
#Let the gateway figure out who will be called.
$gateway->service();
</textarea>
</td>
<td valign=top>
File cpu.py:
<textarea cols=50 rows=10>
lib/AMF/Perl/IO/Serializer.pm view on Meta::CPAN
{
$self->writeHeader($i);
}
$count = $self->{amfout}->numBody();
# write the body count
$self->{out}->writeInt($count);
for (my $i=0; $i<$count; $i++)
{
# start writing the body
$self->writeBody($i);
}
}
sub writeHeader
{
my ($self, $i)=@_;
# for all header values
( run in 0.318 second using v1.01-cache-2.11-cpan-0d8aa00de5b )