Arbogast has asked for the wisdom of the Perl Monks concerning the following question:
Thank you in advance.
I can get Perl sending Flash Player xml, swf and jpg files through the web server.
My question is, how does one get Perl and Flash talking to each other on a local Windows and Linux machine??? I assume it is possible. I don't expect anyone to solve the whole problem, unless it is real easy. But I would like to know what I need to study to figure it out.
Thanks,
Shade Tree Hacker
Re: Perl Talking to Flash
by PodMaster (Abbot) on Aug 26, 2003 at 12:56 UTC
|
Perl is independent of Flash.
Perl can talk HTTP/CGI (perldoc CGI, Tutorials).
This has been asked before, I suggest you look around (FLASH).
MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!" | I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README). | ** The third rule of perl club is a statement of fact: pod is sexy. |
| [reply] |
Re: Perl Talking to Flash
by Ovid (Cardinal) on Aug 26, 2003 at 15:15 UTC
|
While it hasn't been updated in a long time, we've successfully used Perl::Flash at my last job. In fact, unless things have changed, ICAP is currently having its Flash "buttons" manipulated with this module.
Note: I'm responsible for most of the coding of that site, but not the Flash part nor did I do the design, so don't crucify me. I complained about that pig, but the client kept wanting more and more shiny things :).
Cheers,
Ovid
New address of my CGI Course.
| [reply] |
Re: Perl Talking to Flash
by benn (Vicar) on Aug 26, 2003 at 12:58 UTC
|
I think you're going to need to define "talking together" a little better, both for your benefit and ours. If you mean "sending external signals to a running Flash process", then you're probably better off looking into ActionScript to communicate directly with your machine, rather than processing keystrokes etc. though Perl.
Cheers, Ben. | [reply] |
|
Talking together.
A Perl Program sending swf, xml and jpg to a Flash Player, and a Flash Player returning XML to a Perl program. Sorry if I was vague.
| [reply] |
|
NAME
SWF: an autoloadable interface module for Ming - a library for
+generat-
ing SWF ("Flash") format movies.
+
SYNOPSIS
# Don't import other modules
use SWF;
or use SWF();
+
# import all SWF modules
use SWF qw(:ALL);
+
# import SWF::Shape and SWF::Movie only.
use SWF qw(Shape Movie);
+
DESCRIPTION
By default, SWF doesn't import other SWF classes. You may, howe
+ver,
instruct SWF to import all modules by using the following synta
+x:
use SWF qw(:ALL);
METHODS
SWF::setScale($scale);
Sets scale to $scale.
+
SWF::setVersion($version);
Sets SWF version. Only versions 4 and 5 are currently suppo
+rted.
+
AUTHOR
Soheil Seyfaie (soheil@netcom.ca).
+
SEE ALSO
SWF, SWF::Action, SWF::Button, SWF::Action, SWF::Bitmap, SWF::B
+utton,
SWF::DisplayItem, SWF::Fill, SWF::Font, SWF::Gradient, SWF::Mor
+ph,
SWF::Movie, SWF::Shape, SWF::Sound, SWF::Sprite, SWF::Text,
SWF::TextField.
Hope this helps
thinker
| [reply] [d/l] |
|
the loadVariables ("url" ,level/"target" [, variables]) method in Actionscript can be used to pull information from environmental variables. I'm not sure if Flash could handle binary information like a .jpg file with this method, but i imagine you could use this to save information to a file and pass the filename to the script with loadVariables.
Flash has native XML handling in the latest version, look at the XML object that provides XML.send, XML.load, and XML.sendAndLoad methods, I've never used that feature, but I imagine there are examples on the net on the proper way to send XML over HTTP in flash.
| [reply] [d/l] |
|
Ahhh - gotcha!
With the proviso that I know next-to-nothing about Flash, presumably you can use exactly the same mechanism to communicate locally as you do with a webserver. If your perl program uploads files to the server's filesystem ready to be read by Flash and vice-versa, you can simply write out to local files instead. If you're using sockets to communicate(?!), then the process will be the same as it is already, but replacing the remote port with a local one.
Cheers, Ben.
| [reply] |
|
|
Update on solving the problem. I haven't worked on getting it working in Linux. Seems logical this would work under Linux
But an extremely simple solution on Windows was to install the Windows Version of Apache and let Perl and Flash communicate through Apache on 127.0.0.1
I like Tk, but Flash sure is a far more attractive local GUI over Perl/Tk for many things. Without doubt, the Perl Man is a genius compared to the lovely Miss Flash. They make a lovely couple.
| [reply] |
|
|