Dynamic Flash Embed Restrictions with javascript

Ok,

I am not even sure this is possible but I challenge someone to prove that it is.

I have a flash object embedded in my page that I want to allow users to resize their browser window and have the flash object resize. Now that is usually as simple as setting width and height to 100% but I have a restriction. At no time can the width exceed 1024. Basically allow the resize to any width below 1024 but max resize width to 1024.

I am not very versed in javaScript and need to find out if this is even possible.

Anyone up for the challenge? Or can even help?