# How to get a variable from the object tag

**URL:** <https://forum.kirupa.com/t/how-to-get-a-variable-from-the-object-tag/212126>\
**Category:** flash\
**Created:** [January 8, 2007, 7:27pm UTC](https://forum.kirupa.com/t/how-to-get-a-variable-from-the-object-tag/212126 "2007-01-08T19:27:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DDD](https://avatars.discourse-cdn.com/v4/letter/d/9fc348/32.png) [@DDD](https://forum.kirupa.com/u/DDD)\
**Post date:** [January 8, 2007, 7:27pm UTC](https://forum.kirupa.com/t/how-to-get-a-variable-from-the-object-tag/212126/1 "2007-01-08T19:27:51Z")

</div>

I need to get a variable from a param in the object into flash and apply it to the onclick event for a button. Can anyone help me out with that? Snippet below

```auto
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="320" height="240" id="source" align="middle">
 <param name="allowScriptAccess" value="sameDomain" />
 <param name="flashVars" value="urlToGoTo=http://myurl.com" />
 <param name="movie" value="http://myurl.com/Controls.swf" />
 <param name="quality" value="high" />
 <param name="bgcolor" value="#ffffff" />
 <embed src="http://myurl.com/Controls.swf" flashVars="urlToGoTo=http://myurl.com/" quality="high" bgcolor="#ffffff" width="320" height="240" name="source" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"/>
</object>

```

This is the variable I have to capture and apply to a button.  
**urlToGoTo**

As always thank for any help.
