Is this a stage listener?
- Started
- Last post
- 26 Responses
- Buckyball2
How do they keep the buttons consistently sized but the background image resizes when you pull the window in?
Thanks,
bB
- rasko40
mentalist
- UndoUndo0
with a listener and the stage class
- Buckyball20
thanks. any good tutorials you could suggest on this?
- Buckyball20
Thx Undo.
- Buckyball20
Looked through tutorial after tutorial to no avail. This is the site containing the example I'm after.
http://landing.ancestry.com/mili…
Skip intro and once you click on a bio the background images shrinks or expands proportionally based on how you resize the window. But the menu items do not.
Anyone have an .fla file I can alter with this code in place?
I'll send you a Christmas ornament.
- ********0
try the Flashcoders or Flashnewbie list archives at
http://chattyfig.figleaf.com/apa…
you'll need to sign up to the mailing list, if you're not ultra into it I'd advise you to get the digest instead of all posts...
- Buckyball20
Alright. Getting close. I searched through a couple Flash forums and came across some code. Here it is. "mauiflowers" being my mc.
function onResize ():Void
{
mauiflower._width = Stage.width;
mauiflower._height = Stage.height;
}
Stage.addListener(this);I applied it to the first frame of my timeline and exported out at 100%/no scale. Here is the result. The image seems to move with the browser as I resize it but the image stays the same size. Want it to shrink like the previous example I posted.
Is this code wrong? Or do I need to tweak it a bit?
thanks.
- Buckyball20
Doh. Here is the active link.
- UndoUndo0
try
function onResize ():Void
{
_root.mauiflower._width = Stage.width;
_root.mauiflower._height = Stage.height;
}
Stage.addListener(th is);
- Buckyball20
and apply that to the main timeline?
- UndoUndo0
_root is the maintimeline so try it out and see if it works is not
post yr code here
and post back the link and i'll try to help out
- Buckyball20
Still does the same thing. Also, am I publishing it correctily out of Flash? 100% and no scale?
- fate_0
Well UndoUndo just led you pretty fuckin far astray.
Stage.scaleMode = "noScale";
Put that on the first frame of one movie, load that one movie into a Main swf that is set to 100%x100% without the noScale code. Simple as that.
- UndoUndo0
Well UndoUndo just led you pretty fuckin far astray
fate_
(Nov 18 05, 06:08)...................................
yeah looks like well out into the wilderness
- Buckyball20
Alright. I'll give that a go and see where it takes me. thanks.
- ********0
damn it _fate, you always need that nasty edge huh?
BuckyBall if you're still having problems email me and I'll do a Breeze meeting with you.
- UndoUndo0
Stage.scaleMode = "noScale";
Stage.align = "TL";
myListener1 = new Object();
myListener1.onResize = function() {
//whatever you want to to when the stage resizes
};
Stage.addListener(myListener1);
- ********0
a gent and a scholar Undo.
- Buckyball20
A couple more questions and thanks again for everyone chipping in on this.
How big should my picture be? Should it be large like 2000 x 1500 pixels or scaled down to fit my stage? And the stage itself. Do I just make it a normalish size like 760 x 540 for example or make it the size of my large pic?
Hope that makes sense.