ColdFusion Muse

Getting a reference to a flash form in Javascript

It's trying not to have adequate access to the client side movie produced by a flash form. For example, I Have a large number of panels in an accordian pane and I want to hide or unhide them based on user preferences. I also want to resize the form movie as the panels are "hidden" to make better use of the visible area of the screen. I wanted to be able to change the "height" and "width" parameters of the movie.

The problem is, that while the "NOSCRIPT" block has an ID parameter to it, the "document.write" block that outputs the object tag does not have and ID parameter attached to it (in spite of my putting ID="blah" in the CFFORM tag). That seems like a bug. Anyway, I went about trying to find another way to access the properties of the embeded movie. I came up with the following:

div class="code">div class="code">function resizeAp(iNx) {
debug.innerText = "";
document.body.children[iNx].attributes.id.value = "mainAp";
for(each in mainAp) {
if(each != "outerHTML" && each != "innerHTML" && each != "text")
debug.innerHTML = debug.innerHTML + each + ' IS ' + mainAp[each] + " <br/>";
}
}

Notice the manipulation of the "debug.innerHTML". This was just output to help me introspect the Object after making the reference to it. Also notice the "iNx" variable passed to the function. Since I'm looping through the "body" array and "body" can have many members, I used a select box with INTs in it to view each object till I stumbled upon the embeded script. The output had no width or height attributes, but it did have a currentStyle, style and runtimeStyle attribute. I was able to set the width and height on each of these style objects, but it had no effect on my movie.

Perhaps someone else can take it bit farther. I would love to be able to fiddle with a few of the properties - at least to be able to resize the move.

Comments



Blog provided and hosted by CF Webtools. Blog Sofware by Ray Camden.