Hi,

   I have uploaded a stripped out example for you at this location:
http://glenpike.co.uk/resize_test/files.zip

   You can see it working at http://glenpike.co.uk/resize_test/ too

   Basically, inside your ActionScript you will need to have a few things:

1. functions that call your JavaScript (Don't forget to import your ExternalInterface class):

   public function showContent():void {
           try {
               trace("will call flashShowContent")
               ExternalInterface.call("flashShowContent");
           } catch (e:Error) {
               trace("ExternalInterface.call error " + e);
           }
       }
public function hideContent():void {
           try {
               trace("will call flashHideContent")
               ExternalInterface.call("flashHideContent");
           } catch (e:Error) {
               trace("ExternalInterface.call error " + e);
           }
       }

2. Something that stops people reszing the SWF (You need to set this up in a handler for the Event.ADDED_TO_STAGE). 3. Listen for resize events on the stage (put this in the same place) and then resize the height of your movie clips to suit:

   private function _addedToStage(event:Event):void {
           this.stage.scaleMode = StageScaleMode.NO_SCALE;
           this.stage.align = StageAlign.TOP_LEFT;
this.stage.addEventListener(Event.RESIZE, _resize, false, 0, true); _big.addEventListener(MouseEvent.CLICK, _btnClickHandler, false, 0, true); _small.addEventListener(MouseEvent.CLICK, _btnClickHandler, false, 0, true);
       }
private function _resize(event:Event):void {
           this.width = this.stage.stageWidth;
           this.height = this.stage.stageHeight;
       }
4. Make sure you set so.addParam('allowscriptaccess','always'); as a param for the Flash otherwise the ExternalInterface won't work...

   Ignore the SWFAddress stuff, that is in the live site...

At the moment, the example will either be 100% of the browser height - if you want something different, set the initial height of the navigation div to a pixel value. When it is made smaller the height is resized to 127px - look in the CSS and the funcs.js to see what happens.

If you want to see it in action click on one of the cube faces, then click the "Home" button to zoom out again. The project was for a Flash navigation element to sit over HTML - when you click on a cube face, the page is set to load in the background whilst the cube zoomed in, then the div is resized to reveal the content.

Hope this helps you a bit...

Glen



Rohit Sharma wrote:
  Hi Glen,

    Surely, I would like to go through the code. Please let me have it if it
can be shared ( I mean not proprietary).
  Thanks a lot.

  Rohit

On Fri, Feb 19, 2010 at 7:41 PM, Glen Pike <[email protected]>wrote:

I have some code for doing this at home, I will post it later if you like,
but we had big problems with some browsers not resizing - it might be dodgy
JavaScript, but think it was just sh**y Safari.

Glen


Nathan Mynarcik wrote:

Hey Rohit,

I believe you are correct. ExternalInterface will allow you to communicate
to the HTML javascript function that in turn can change the size of the
flash area.

------Original Message------
From: Rohit Sharma
Sender: [email protected]
To: Flash Coders List
ReplyTo: Flash Coders List
Subject: [Flashcoders] Scroll Bars not coming on increase of movie
clipheight
Sent: Feb 19, 2010 7:08 AM

Hello Everyone,

   In my application I have two screens, first screen measures 800 * 600
and second screen measures 800 * 950.
I have set width and height in html to be 100%.
   On running the swf the first screen comes centred but when I move to
next screen it is cropped. I cannot see the bottom half of the image.
Ideally, I was expecting a scroll bar to scroll the whole movieclip. I
tried
couple of things like setting the html height to 950 but
in that case I am seeing a scroll bar for both the screens. It seems the
html is taking same height for both the screens.

I was searching internet for this and the one solution i got was to use
external interface to change html height when the screen change occurs.
Is this the only way? Please provide your opinions on this.

Thanks,
Rohit
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Nathan Mynarcik
Interactive Web Developer
[email protected]
254.749.2525
www.mynarcik.com

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders




_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


--

Glen Pike
01326 218440
www.glenpike.co.uk <http://www.glenpike.co.uk>

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to