Cheating with wmode = transparent

gwempz Community Member Posts: 137

After several failed attempts to get Flash to load a Lectora variable containing the title of my course, I came up with an interesting solution:

When a SWF has the added parameter wmode = transparent, any area of the SWF without content will be transparent and show whatever is behind it. I used this to my advantage, and placed a simple rectangle with a gradient over my entire SWF (an intro animation). When the animation sequence was complete, I tweened the rectangle to fade away (alpha to 0%). In Lectora, I made a text box containing my course title. I then placed the SWF as the last item on the page (which puts it on top).

The end result, when viewed in HTML, is that the white rectangle in the SWF hides the textbox until the animation sequence is complete, and then a nice fade-in transition is created for my course title. I even added an image beneath the SWF, and the same effect works. Now I can have an intro which displays the course title without having to manually edit a flash file, an XML file, or any of the other convoluted methods I’ve been trying for a couple years now.

This works in all common browsers, and the only flaw I noticed was Chrome and Safari showed the title for a split second before the SWF began playing. This could even be fixed by placing a slight delay on the text.