I need help.
Okay dokay, these what is happening.
I am building a flash site, that adjusts the stage width to the width of the browser window, done simply through the publish settings under the HTML tab.
I have been searching all day to find code that can anchor flash objects to particular corners of the browser window. This is done simply by using a listener to find the stage width.
Say I want to anchor the object to the right of the page, all I do is make it work out the new stage width then tell the object to move to the new stage width, and the object._x should be placed against the right side of the browser window. Hunky fucking dory. This works.
HOWEVER! this is only possible if the original stage is positioned top left of the browser.
// ***Stage aligned top left
Stage.align = "TL";
// *** Stop the stage from scaling with the browser window.
Stage.scaleMode = "noScale";
stop ();
// initiate postitions and scaling values for objects
boxbutton._x = Stage.width - boxbutton._width
// end initial position setting
//create a listner that checks to see if the browser window is resized
sizeListener = new Object();
sizeListener.onResize = function() {
// change movieclip properties when the window is resized.
boxbutton._x = Stage.width - boxbutton._width
};
Stage.addListener(sizeListener);
Right so basically the boxbutton object's x coordinate is the same as stage width, but this is base don the fact that the top left hand corner of the stage is set at the cordinates 0,0 of the browser window.
If you replace the "LT" at the start of the code with s "C" it centres the flash stage in the centre of the browser.
BUT now the code telling the box to position itself to the right hand side of the browser doesn't do it correctly. So what I need to know is how can I make this code work out that the stage is not set at 0,0 but in fact set at a varying position based on the browser size.
I also need the boxbutton, when clicked, to enlarge to 90% size of the stage (again based on the size of the browser window), so its position coordinates now become negative numbers.
Does this make sense.
Here is where I downloaded the demo fla and tried to change it to suit. The entire thing is called liquid flash, in the sense that the objects move according to the broswer size, very much like Liquid CSS.
http://www.tutorio.com/media/flash/liquid-demo.htmlhttp://www.tutorio.com/media/flash/liquid-demo.zipOne solution i have is to position the stage top left and reposition everything I have on stage with code to make them centered but FUCK THAT.
Thanks for ytou help folks.
