AS3 Dynamic Object Alignment
( June 7th, 2009 )If you are running your SWF file at 100% of the browser window’s size, you can use this example to dynamically position objects on the stage based on the window size i.e. when the browser is resized, all objects will dynamically move to their allocated positions relative to the window size.
(This file will open in Flash CS3) (Preview File)
Get Source
Posted in ActionScript 3.0, Flash
hey, thanks very much for this file! thought i had it figured out already, but then it all kept freezing, although i´d defined the tweens globally… but this seems to work.
just one question left: in IE and Firefox everything is working fine, but in Safari these scrollbars keep appearing and driving me nuts!
your example works perfectly, without scrollbars appearing, so i must be doing something wrong.
how do i have to publish my movie, or what else could i be doing wrong?
i would appreceate it, if u could help me.
thanks in advance, alex
I´ve got a question: in IE and Firefox everything is working as i want it to. But in Safari, for some reason, the content is a little longer than the actual screen and I get scrollbars.
How can I prevent this from happening? Do I have to publish my movie differently?
Any help would be appreciated.
Thanks, Alex
Hi Alex
When you want to publish a file to run at 100% of the browser’s size, it will help you to publish an HTML file from Flash.
To do this, under Publish Settings, on the Formats tab, tick HTML. Under the HTML tab, set the Dimensions dropdown to Percent and ensure that Width and Height are set to 100.
Once you have published your files, run the HTML file in Safari and see if you get the scrollbars.
Let me know if this works for you.
Thanks for the quick reply!
But I always publish my movies in flash, and I´ve also set width and height to 100%.
As I said, it works in every browser but Safari. Your example-file does work in Safari as well though, so you must have done something differently…
Can you think of something else?
Thanks again!
Alex
So I´ve published your file now and the same problem appears.
Maybe it´s a mistake in CS4, but I´m pretty sure I´ve had the same problem in CS3 once…
I am using CS3. Maybe compare my HTML code to the code generated by CS4 and see what’s different.
Perhaps, use my HTML code and change all the references to my filename with yours.
Ok, so I´ve copied your code and I don´t know why but it works!
Flash CS3 uses an AC_RunActiveContent.js-script, whereas CS4 writes the Javascript directly into the header of the html-page. I don´t know what the difference is though, I was too lazy to compare both scripts…
So thanks very much and keep up the good work!
Alex
Hi Alex!
I’ve downloaded the file “as3_dynamic_positioning” but I can’t open it with Flash CS4. It seems that the file doesn’t have extension and I’ve tried to change the name of the file introducing an extension like “.as or .fla” but it still doesn’t work!!! Please it would be great if you could help me cause I really need this script!
Thanks a lot,
Oliver
Hi Oliver
What is the name of the file without an extension?
I just downloaded and checked my file. There shouldn’t be any files without an extension.
Rowan
Hi Rowan
When I open the file “as3_dynamic_positioning.zip” it becomes the file “as3_dynamic_positioning” without an extension so I can’t open it. I’ve tried to download it again but the same happens. I don’t know why can be cause I’ve got all Adobe suite in my pc. Could be a problem if I worked with Windows Vista instead of Mac??? I don’t know!!!
Thank u so much for yor help!
Oliver
This works out great
!!! 10q! 10q !
The zip file has been currpted some. It is showing error while opening and after that the zip file is showing empty
Please try again Moh. I just downloaded it and it works fine. If you don’t come right I’ll email it to you.