Passing parameters to a Flash 9 ActionScript 3 SWF file

9 actionscript,as3,flash,work  |   August 9, 2007  |     2672

Hi everyone, I found this blog entry which shed light on how to pass variables to your SWF this way :


Here is some usefull function you can use. Put it in your Document Class. For those who don’t know what that is, just put it on the stage on Frame 1 then.

So it’s quite simple to use it:



I used these articles as inspiration. Make sure you READ the FIRST COMMENT of the post since it outlines an important omission from the author.

link to Theo’s Blog entry


  • August 25, 2009 at 10:25 am


    Thank you! You just saved my life.

  • August 31, 2009 at 6:24 pm


    I’m trying to pass a variable like this from as3
    private var _movie:String=”mymovie.swf”
    var mRequest:URLRequest = new URLRequest(“swfloader.swf?m=”+_movie);

    But I get a url not found error, not because it doesn’t find mymovie.swf, but it can’t load swfloader.swf at all, I don’t understand why.
    If I remove the “?m=+_movie” then it works, but of course it doesn’t load the final movie…

  • September 5, 2009 at 3:20 am


    Really Cool
    Thanks for solution!!!!!!!!11

  • October 1, 2009 at 11:55 am

    Bernardo Pereira

    Another interesting thing I found out is that you can add the code ‘’ to the JavaScript that calls the swf file, so that you don’t need to hardcode the variable in the html. The result is something like this:

    ‘src’, ‘swf_file_name’”,
    ‘movie’, ‘swf_file_name’”,

  • December 8, 2009 at 7:19 am


    really preciated!!!!! mate!

  • January 20, 2010 at 7:08 am


    Thanks, finally i found it 🙂 you saved some hours for me

  • April 19, 2010 at 9:55 pm


    you made my day (or nigth).


  • July 25, 2010 at 5:08 am


    thx a lot..

  • August 6, 2012 at 3:48 am

    Ramon Fincken

    Is this injection safe?

Leave a Reply