Visible attribute and the gap left in Flash forms

The visible attribute and the gap left in Flash formsFirst of thanks to Kelly Keith to actually putting me onto this solution after my post to CF-Talk about removing the gap left in when you set an item like visibilites to hidden. To quote Kelly direct the short answer is "When visible is set to false set the height to a negative number."Below I've got three examples of problem, the solution and an event driven solution. 1. This first exaple is a example of the visible gap left by setting visible to false Form 1 Panel 1 You'll notice the gap above this "panel" left by the first hidden panel 2. Below I have put in place Kelly's suggestion which resolves the whitespace Form 2 Panel 1 You'll notice the gap is now removed. This is done by setting a negative height e.g.

3. The final bit of code uses some basic Actionscipt to remove on a onClick event to hide/show the panel along with setting the height function hidePanel(){ _root.pan1.visible = false; _root.pan1.height = -1; } function showPanel(){ _root.pan1.visible = true; _root.pan1.height = 100; } Form 3 Panel 1 Bottom Panel If you are working with Flash Forms I gotta say check out I've been working on a few rather complex forms which has meant even replicating some Ajax functionality via Flash Remoting all of which I've got from there. I'll try and blog about that soon.
comments powered by Disqus