By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,823 Members | 730 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,823 IT Pros & Developers. It's quick & easy.

Dynamically Size the Canvas

P: 4
Hi,
I have a flash movie (a ruler) that needs to float over an html page. The ruler size needs to stay fixed since it is measuring art pieces underneath. I can size the canvas to a fixed width say 1024x768 which allows the ruler to move all over the page. The problem is that if I have a larger screen rez say 1200 X 800 I have create a new movie with a larger canvas to support the ability to move the ruler all over the page.
The issue with this is if I have one user on 1024 and one with a higher rez, I either have a ruler that cant move all over the page, or I have scroll bars on the lower rez monitors.

Is there a way to dynamically size the canvas?
Any help would be appreciated - this is quite urgent.
Thanks!

Peter
Oct 19 '07 #1
Share this Question
Share on Google+
7 Replies


100+
P: 149
Hi,

You should be able to use javascript to dynamically size the flash movie according to the clients screen resolution.

Check out SWFobject.js on google for examples.
Oct 19 '07 #2

P: 4
Thanks but what I am after is the resizing of the canvas, not the movie. Make sense?
Oct 22 '07 #3

xNephilimx
Expert 100+
P: 213
Hi jonahcat!
Try this:
make your ruler as long as you think it's conveinent, then put this in the frame:
Stage.scaleMode = "noScale";

That will prevent the content of your movie to scale when changing the size of the movie. Then you can use JavaScript and SWFObject as rsdev said, to dynamicaly resize the movie and automatically fit it to the user's screen resolution.

Best regards,
The_Nephilim

Hi,
I have a flash movie (a ruler) that needs to float over an html page. The ruler size needs to stay fixed since it is measuring art pieces underneath. I can size the canvas to a fixed width say 1024x768 which allows the ruler to move all over the page. The problem is that if I have a larger screen rez say 1200 X 800 I have create a new movie with a larger canvas to support the ability to move the ruler all over the page.
The issue with this is if I have one user on 1024 and one with a higher rez, I either have a ruler that cant move all over the page, or I have scroll bars on the lower rez monitors.

Is there a way to dynamically size the canvas?
Any help would be appreciated - this is quite urgent.
Thanks!

Peter
Oct 23 '07 #4

P: 4
Thanks so much! Ill give it a try!
Oct 23 '07 #5

xNephilimx
Expert 100+
P: 213
You're welcome!
Let me know how it worked.

Best regards
The_Nephilim

Thanks so much! Ill give it a try!
Oct 23 '07 #6

P: 4
It seems to be working!!!
Thank-you so very much!
Oct 24 '07 #7

xNephilimx
Expert 100+
P: 213
Awesome!!
Glad it worked!

Best regards!
The_Nephilim

It seems to be working!!!
Thank-you so very much!
Oct 24 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.