# Javascript not reading flash variables correctly

**URL:** <https://forum.kirupa.com/t/javascript-not-reading-flash-variables-correctly/241021>\
**Category:** Uncategorized\
**Created:** [October 9, 2007, 2:00pm UTC](https://forum.kirupa.com/t/javascript-not-reading-flash-variables-correctly/241021 "2007-10-09T14:00:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pbrollwitme](https://avatars.discourse-cdn.com/v4/letter/p/439d5e/32.png) [@pbrollwitme](https://forum.kirupa.com/u/pbrollwitme)\
**Post date:** [October 9, 2007, 2:00pm UTC](https://forum.kirupa.com/t/javascript-not-reading-flash-variables-correctly/241021/1 "2007-10-09T14:00:12Z")

</div>

I have sort of a strange situation. I’m passing my variables from flash to js as such:

```auto

collat_movie.onRelease = function() {
   var image = this.img_src;
   getURL("javascript: loadImage(" + image + ");"); 
   trace(image.text);
  };

```

When I trace my variable0, it correctly states the variable as logo.jpg

However, in my javascript I have this:

```auto

function loadImage(x){
document.getElementById("flash").innerHTML = "<img src=/'" + x + "'/>";
}

```

When I try to run this in explorer, I get the following message:

“logo” is undefined.

Now considering that I do not use the variable “logo” anywhere in the flash/js, I know that what is happening is that js is stripping the .jpg off of the end of my ‘x’ variable. Does anyone know why this is happening and how I can fix it???

Thank you in advance!

Mat
