Log in

View Full Version : can swf detect screen resolution?



evan
09-03-2008, 12:06 PM
and the question that follows is from there would I need to develop alternate swfs for each detected resolution or is there an easy way for it to automatically resize ?

BLiZZaRD
09-03-2008, 01:55 PM
Depends on how you want to implement it. For a full screen idea, if Using Flash 8 (or even Flash 9) check out this tutorial (http://julian.empiregn.com/2007/2/22/How-to-create-true-fullscreen-movies-with-Flash)

If full screen isn't what you are after, let me know.

Medyman
09-03-2008, 04:56 PM
and the question that follows is from there would I need to develop alternate swfs for each detected resolution or is there an easy way for it to automatically resize ?

By resolution, do you mean the size of the stage? Flash can definetely detect that. And by using listeners on the stage's size, you can realign objects relatively.

So, for example, if you want a particular movieclip to remain centered on the stage even after the user resizes, you could do that.

Here (http://gotoandlearn.com/player.php?id=31) is a tutorial on it from gotoAndLearn(). It's in AS2 but the same logic applies to AS3. There are just some syntactic changes (dropping the underscore before property names, for example).

Dottydog
09-18-2008, 10:21 AM
Hello
My question is along the same lines. I have designed the following :
www.greenpatch.co.uk/testing. It is a liquid layout. As you can see, I have three swf and I would like them to resize relatively according to the browser size. If you could give me some advice on how to achieve this, I would really appreciate it.
Thank you very much in advance.
PS I tried the above link but its a 404

Master_script_maker
09-18-2008, 10:41 PM
here (http://gotoandlearn.com/play?id=31) is the link medyman was trying to link to

Medyman
09-18-2008, 10:44 PM
The correct URL for the link above is http://gotoandlearn.com/play?id=31.
That's only a technique for full-browser flash however.

For what you're looking to do, just defining the height/width by percentages should do the trick. Otherwise, you'll have to do it via JS.

punstc
09-19-2008, 03:01 AM
http://flashsourcecode.com/
heres an example of this in as3 yo can view a demo and download the source files.