X20
asked on
How can I detect the user's screen resoultion in AS3 to make my stage and its contents the same size?
What can I do about it?
I think you're thinking about it the wrong way.
You'll use HTML to make sure it's always 100% of the window, and so you can act as if that has literally changed your stage size.
Set the scale mode to NO_SCALE (see http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Stage.html#scaleMode)
And then you'll use the onResize event to layout your content, so if you wanted your clip myMenu to always be right aligned, you'd have:
You'll use HTML to make sure it's always 100% of the window, and so you can act as if that has literally changed your stage size.
Set the scale mode to NO_SCALE (see http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Stage.html#scaleMode)
And then you'll use the onResize event to layout your content, so if you wanted your clip myMenu to always be right aligned, you'd have:
addEventListener(Event.RESIZE, onResize);
private function onResize(evt : Event) : void {
myMenu.x = stage.stageWidth - myMenu.width;
}
ASKER
thank you very much, I'll try that as soon as possible and let you know!!
X20
X20
ASKER
Does this actually change the size of the stage?
My actual stage size is 1280x800. If the user resolution is 1920x1080, will the stage resize like that?
My actual stage size is 1280x800. If the user resolution is 1920x1080, will the stage resize like that?
ASKER
or do I have to write that code for every componenet on my stage? Can you write a simple working example please? That would just definitely make things easier and quicker.
Thank you!
X20
Thank you!
X20
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ok thanks, I'm working on it! I'll get back to you as soon as possible.
X20
X20
ASKER
does this work only with movie clips? I have dynamic scenes and containers to be resized for a photo gallery.
ASKER
Ok I'm pretty tired on trying things on about this stuff, I'm sure you can make much more esaily and quiker than me. I send you the code for my gallery with some test pictures. I just want the gallery to appear in all the user's screen with all the stuff in it. Can you work this out so that everything that is inside it can be displayed properly as you said?
Thanks!!
X20
Thanks!!
X20
ASKER
Ha!
No, I won't be doing it all for you. I've shown you how it all works, so you should get an understanding of it and develop it yourself.
It's all very straight forward once you get the concept, so maybe create a sample FLA, or use the one I gave you, and learn properly how it works.
I'm not here just to do your work for you when you get a little tired or bored with it! Anybody who has learnt Actionscript properly has done it by putting the hard work in - there's no reason it was any easier for us to learn it then you.
No, I won't be doing it all for you. I've shown you how it all works, so you should get an understanding of it and develop it yourself.
It's all very straight forward once you get the concept, so maybe create a sample FLA, or use the one I gave you, and learn properly how it works.
I'm not here just to do your work for you when you get a little tired or bored with it! Anybody who has learnt Actionscript properly has done it by putting the hard work in - there's no reason it was any easier for us to learn it then you.
ASKER
This is not because I'm lazy! I simply thought that you would be doing it in snap. But anyway, thank you for your help.
Thank you, WhackAMod.
ASKER
And please bear in mind that in no way I have ever obliged anyone to do anything. Besides, that solution is GRADE B for my case (what is this thing of reassigning grades???) because my problem isn't solved yet and I'm still working on it cause it's very different from what the expert told me, which is just a general case.
Thank you.
Thank you.
ASKER
That thing applies to movie clips, and I have no movie clips on my stage, and I still don't kow what to do about it.
Bye bye
Bye bye
Is this website still called Experts Exchange or has someone changed the name to Kindergarten Quarrel ?
Maybe we need to shift zone's on this one?
DM
Maybe we need to shift zone's on this one?
DM
ASKER