Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Perl Talking to Flash

by benn (Vicar)
on Aug 26, 2003 at 12:58 UTC ( [id://286687]=note: print w/replies, xml ) Need Help??


in reply to Perl Talking to Flash

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.

Replies are listed 'Best First'.
Re: Re: Perl Talking to Flash
by Arbogast (Monk) on Aug 26, 2003 at 13:08 UTC
    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.

      Hi Arbogast,

      Have you seen ming. A C library interface to flash with a Perl interface. ( Does that sound right!?)

      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

      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.

      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.

        Thanks Ben. I am guessing I should carefully read Network Progamming in Perl by Lincoln Stein??? Sounds like I have a doable problem.

        On Ming, I have used Ming, it is good. But, the version I have only covers through Flash 5, and it isn't complete I believe. Plus, it doesn't have a nice graphical tool to use Ming.

        Title edit by tye

      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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://286687]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-24 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found