# Passing Variable to ActionScript

**URL:** <https://forum.kirupa.com/t/passing-variable-to-actionscript/320219>\
**Category:** flash\
**Created:** [March 17, 2011, 3:02am UTC](https://forum.kirupa.com/t/passing-variable-to-actionscript/320219 "2011-03-17T03:02:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![renton79](https://avatars.discourse-cdn.com/v4/letter/r/97f17d/32.png) [@renton79](https://forum.kirupa.com/u/renton79)\
**Post date:** [March 17, 2011, 3:02am UTC](https://forum.kirupa.com/t/passing-variable-to-actionscript/320219/1 "2011-03-17T03:02:40Z")

</div>

I have been looking for this couple hours and still can’t find the answer. I need to pass variable BUT only through URL as I need to use it as a target link in html (so I can’t use \<object\> flashvars), look below.

\<a href=“[www.site.com/[COLOR=Red]flash.swf?choice=1[/COLOR]](http://www.site.com/%5BCOLOR=Red%5Dflash.swf?choice=1%5B/COLOR%5D)”\>link\</a\>

My question is if I use link like the one above how do I read the variable choice in actionscript, I have my code in the main document file as.

Dave
