Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I know that this is quite a late reply, but I have just recently installed Flash 5 and have an answer to this question. IlyaM is definitely on the right track. Using a perl script to output the URLs to the swf file is the way to go.

Example:

First let's create the flash (swf) file:

  1. Create a new flash project.
  2. Select one of the shape tools (square, circle, etc) and draw a quick shape.
  3. Use the 'select tool' to select the shape and hit F8 (or go to Insert->Convert to Symbol) Select the button option and hit OK.
  4. Right-click this button on your stage and select 'Actions'. This is where ActionScript comes into play
  5. Click the right-pointing arrow at the top of the little 'Actions' window. Select the 'Expert Mode' option.
  6. Copy and paste the following code into the right-hand side textbox:

    on (release) { loadVariablesNum ("/path/to/script.pl", 0); getURL (address, "_blank"); }
  7. Make sure you replace "path/to/script.pl" to the path of the perl script.
  8. Note that the getURL() function is passed address and not "address". This is because address is the variable name we will send to flash via the perl script.

Next up we have the perl script:

1. Open your favorite script editor and enter the following code:

#!/path/to/perl -w use strict; use URI::Escape; my $url = "http://www.yahoo.com"; print "Content-type: text/plain\n\naddress=$url";

2. $url is the URL of the page you want flash to open when you click that button you created. Note that the script passes the url via the 'address' variable.

There, you have something that works! Of course, this could be made much better by allowing the passing of multiple URLs to the flash file, but that can be homework ;)


In reply to Re: Re: Perl Flash by mt2k
in thread Perl Flash by hakkr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (1)
As of 2024-04-25 19:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found