0
votes

I create a document which has 990px width and 40px height. I create a button and when I click the button I want to swf height grow up to 250px. Like this: http://demo.linkz.net/LinkZmasthead/turkcell/gece_kusu/default.html

I tried to change stage height but swf height doesn't grow up.

var mc:MovieClip;
mc = this["buton"];
mc.buttonMode = true;
mc.mouseChildren = false;
mc.addEventListener(MouseEvent.CLICK, clickHandler);

function clickHandler(e:MouseEvent):void {
    // codes
}

How can I solve this issue? Thank you

1
You don't modify the SWF height, you modify the height of the container in the HTML page. - Marty
Should I solve issue like this? there will be 2 stage which have different sizes. When I click the expand button stage2 appears and I change container size up to 250px. When I click on close button container size will be set down 40px and stage1 will appears. - ed joe

1 Answers

0
votes

You can do this.

import flash.display.Stage; 
import flash.display.StageAlign; 
import flash.display.StageScaleMode; 
import flash.events.Event; 

swfStage.scaleMode = StageScaleMode.NO_SCALE; 
swfStage.align = StageAlign.TOP_LEFT; 

stage.addEventListener(Event.RESIZE, resizeYourStage);

function resizeYourStage(e:Event):void {
    //resize code here
};

In your HTML add an onclick event to the button

<button type="button" onClick="StageResize.height = '250';">Resize</button>

Here is an example. You can right click on the page to inspect the swf size changes.

Note: In an HTML page hosting the SWF file, both the object and embed tags' height attributes must be set to a percentage not pixels.