Forum Moderators: open

Message Too Old, No Replies

Dynamically resizing a stage area

         

potato95

5:47 pm on Apr 11, 2007 (gmt 0)

10+ Year Member



Hi

I'm new to flash so excuse me if my terminology is wrong!

I have a flash movie that acts as a slide-show to show different views of products on a web page. It gets its image data from an xml file (path, dimensions etc).

On each product page there will be one movie that displays a set of images, all the images for a particular product page will have the same dimensions. However different product pages will have images with different dimensions.

What I have now is a working "static" version where the stage is = 200x200 with a movie clip in a mask with dimensions 200x150. The remaining 50px of the stage area has navigation buttons "next" and "previous".

This works fine if the image is 200x150px but if the image is 200x200px then I want the stage to show the image plus 50px for the navigation buttons. ie I want to make the stage have a height of 250px and the movie mask a height of 200px.

I am setting the flash object html dimensions at runtile using JS but the actual flash movie always ends-up at the fixed dimension.

I thought first of all I would set the size of the Stage element but it turns out that is a read only value. Setting the size of my mask and movie-clip don't seem to have any effect.

How can I dynamically alter the flash at runtime to expand and contract according to the images dimensions?

General pointers?

Thanks

bsterz

3:39 am on Apr 15, 2007 (gmt 0)

10+ Year Member



Sorry - I've had a couple of developers look into this and the concensus seems to be that stages cannot be dynamically resized. If you find a solution let me know :)

Benek

2:28 am on Apr 18, 2007 (gmt 0)

10+ Year Member



Can't you just have the flash stage be 100% width and height of it's container, and then alter the size of the stage by changing the container size?

Then, in flash, have the position of you navigation buttons be based on the height of the image file.

Josefu

7:37 am on Apr 19, 2007 (gmt 0)

10+ Year Member



Benek is right - and if I understand your goals correctly, it seems as though you are going to have to have a stage with 'enough room' for vertical and horizontal photos.

For a flash movie filling 100% its html container, just enter the actionscript 'Stage' variable against your flash document's original size to calculate the correct position of your button (eg: 'lower left' would be (button._x =_root._width - Stage._width)/2 ; button._y = (_root.height - _button._height) + ((Stage.height -_root._height )/2) ) and use a onEnterFrame() function to keep it there if you have a liquid layout.

Good luck!

[edited by: Josefu at 7:41 am (utc) on April 19, 2007]