Hi Glen,

Nice catch.

Although I'm pretty sure you also need to add "px" after the amount so that the DIV will know that you're talking pixels and not centimeters or whatever,

box.style.height = box.style.min-height = ht+"px";

/ Viktor H

On Mon, 02 Jun 2008 16:52:04 +0200, Glen Pike <[EMAIL PROTECTED]> wrote:

JS:

function expandDiv(divName, amount) {
    var box = document.getElementById(divName);
    //alert("Box is " +box);
    var ht = box.style.height + amount;
    //alert("Height is " + ht);
    box.style.height = box.style.min-height = ht;
    //alert("height is now " + box.style.height);
}

To test, put a link in your HTML first:

<a href="javascript:expandDiv('flashcontent', 10)">Click me</a>
<div style="height:300px;min-height:300px"><p>This is a div<p></div>

Make sure your JS all works nicely...

Then try:
var name:String = "flashcontent";
var amt:Number = 10;
ExternalInterface.call('expandDiv', name, amt); //think this is correct for multiple params, but check!

Also, you need to have allowScriptAccess set http://www.google.co.uk/search?hl=en&q=allowScriptAccess&btnG=Search&meta= <http://www.google.co.uk/search?hl=en&q=allowScriptAccess&btnG=Search&meta=> when you embed your Flash movie...



Viktor Hesselbom wrote:
Well, I worked out some basics but it only seems to work when I export to Flash Player 6 (using Opera, might be different in other browsers).

Anyway, here it is.
The idea is to have a div called 'flashcontent' and changing it's height through the div's style property using javascript.

onMouseUp = expandDiv;
var h:Number = 300;
function expandDiv():Void {
    h += 10;
getURL("javascript:document.getElementById('flashcontent').style.height='"+h+"px';"); }

Someone feel free to make this script better and more global.

On Sun, 01 Jun 2008 17:48:02 +0200, Allandt Bik-Elliott (Receptacle) <[EMAIL PROTECTED]> wrote:

has anyone used or know of any really good page expanders for flash/javascript - i guess it would use an external interface call - either as2 or as3 - i'd like to have a textfield that extends the html page it's in to it's total height but i'm not really good with javascript

thanks
al


_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders







--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to