-
self-portrait
Event.RESIZE
Why won't Event.RESIZE trigger through the standalone flashplayer (v 9.0.115.0)?
This snippet works fine in the IDE.
Code:
stage.addEventListener ( Event.RESIZE, resize );
resize ( null );
function resize ( event:Event ) :void
{
graphics.beginFill ( Math.random () *0xffffff );
graphics.drawRect ( 0, 0, 100, 100 );
graphics.endFill ();
}
Last edited by Kianis; 08-24-2008 at 07:54 PM.
-
self-portrait
Apparently it works if scaleMode is set to NO_SCALE, but I want it to scale. Event.RESIZE is supposed to be triggered whenever the flashplayer window is resized, right? So it shouldn't matter what scaleMode I got?
-
M.D.
-
self-portrait
Originally Posted by mr_malee
try, EXACT_FIT.
It doesn't even trigger in the IDE
-
M.D.
Event Object Type: flash.events.Event
Event.type property = flash.events.Event.RESIZE
Dispatched when the scaleMode property of the Stage object is set to StageScaleMode.NO_SCALE and the SWF file is resized.
looks like its not possible.
what are you trying to do?
-
self-portrait
Oh, ****. It's strange that it works in the IDE though.
I want to redraw the background and reposition all the entities
when the movie is resized (it's going to be downloadable only) so
you play it fullscreen too, with a bigger play area but without it scaling.
Last edited by Kianis; 08-25-2008 at 08:09 AM.
-
M.D.
ok, I don't see the problem then. Unless you mistyped this last bit:
you play it fullscreen too, with a bigger play area but without it scaling.
I thought you wanted it to scale?
if you want to have a flexi-ui / game. Set:
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
fscommand("fullscreen", true);
then, stage.stageWidth and stage.stageHeight will give you the right dimensions.
if you want it fullscreen and stretching:
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.EXACT_FIT;
fscommand("fullscreen", true);
i'm pretty sure that unless you develop in AIR, then "stage.displayState = StageDisplayState.FULLSCREEN" will disable some keyboard controls, so use fscommand instead.
hope that helped.
-
self-portrait
Sorry I'm a bit confused. I want it scale, yes. The problem is
that I want the background the be pixel perfect, which is easily done
since it's a repeating pattern. The idea was that whenever the player
resizes the window or goes into fullscreen mode (fscommand style, not StageDisplayState.FULLSCREEN since I'm using keyboard controls) I
would redraw the entire background image with a bitmapDataFill so there wouldn't be any visible edges (the movie is 800x600, if you go fullscreen
depending on your screen resolution there would be a visible edge since
the aspect ratio is preserved) AND the background pattern wouldn't be stretched. Piece of cake, if only Event.RESIZE would trigger.
-
ism
Graphics Attract, Motion Engages, Gameplay Addicts
XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro
-
self-portrait
Thanks Blink, but that's not what I'm really after, I'm not going to embed
it into a web page.
All I want is a way to detect when the flashplayer (standalone) window has
been resized, while keeping StageScaleMode to its standard value.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|