Flash Components      Flash Menu      Flash Gallery      Flash Slideshow      FLV Player      Flash Form      MP3 Player      PhotoFlow      Flash CMS      3D Wall      Flash Scroller

Flash / AS

Silverlight

WPF

ASP.net / PHP

Photoshop

Forums

Blog

About

 


FlashComponents
  Galleries
  Slideshows
  Menus
  Design & Effects
  Audio & Video
  User Interface
  Templates

 

 

 

 

 
Passing Variables to Flash
      by Brandon

In this tutorial I will explain how to pass variables to flash and what
dynamic things you could do with passing variables. Now you all have probably seen a link that ends in index.php or index.swf. Now, sometimes when you add a question mark ( ? ) mark to the end of index.php, it enables you to do some cool things.

This link (it's not real) index.php?atkirupa=true will probably display the same page but the page could look different if what follows the question is referred in the web page as a variable. Flash can take the variable and modify characteristics within the movie that the variable may refer to!

Here's how:

  1. First make a 440 x 300 (width and height) flash movie then add this Action Script to your flash movie on the very first frame:

if (movie==1 or movie=="") {
   trace("default");
}
if (movie==2) {
   getURL("http://www.yahoo.com");
}

  1. Save and publish your work as pv.swf
     
  2. Preview the animation and, in your address bar, you'll see pv.swf displayed. After pv.swf in your address bar, add the following argument: ?movie=2. Your address bar will look like:

     pv.swf?movie=2
     
  3. If everything worked as planned, you'll probably be taken to the Yahoo! home page.

Manually changing the value is cumbersome, and you did that because you are testing it. When embedding the movie in your animation, you can simply call the movie's name in the HTML as pv.swf?movie=2 or set a Param tag that looks like this:

<Param name="FlashVars" Value="movie=2">!



Regards,
Brandon

 

 

 

kirupa.com's fast and reliable hosting provided by Media Temple. flash components
The Text Animation Component for Flash CS3
Check out the great, high-quality flash extensions. Buy or sell stock flash, video, audio and fonts for as little as 50 cents at FlashDen.
Check out our high quality vector-based design packs! Flash Effect Components
flash menus, buttons and components Digicrafts Components
The best flash components ever! Entheos Flash Website Templates
Upload, publish, deliver. Secure hosting for your professional or academic video, presentations & more. Screencast.com Purchase & Download Flash Components
flash components Free Website | Make a Website
Streamsolutions Content Delivery Networks Learn how to advertise on kirupa.com