Forum Moderators: open
I've created a flash interface where an image path is defined in the actionscript for several buttons. The JS gets this path through a variable called flashTools. When I call flashTools, I end up getting the path to the image, not the image itself. Code:
// MARK 1
if(flashTools!=undefined){
objTools.style.display = 'block';
objTools.innerHTML = flashTools;
} else {
objTools.style.display = 'none';
}
So for example, button one on the flash interface will display "images/tools/1.gif", button two will display "images/tools/2.gif", etc)
If I do objTools.innerHTML = <img src='images/tools/ps.gif'>", I get an image, but it will always be the same one.
I just want a way to tell it that "flashTools" is an image and not text. Thoughts?
Why don't you just use the image URI for the src of an image tag? See the following:
objTools.innerHTML = '<img src="' + flashTools + '" alt="Alt text here" />';
See if that helps. :)