A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: Event.RESIZE

  1. #1
    self-portrait Kianis's Avatar
    Join Date
    Feb 2004
    Location
    Stockholm, Sweden
    Posts
    425

    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.
    // Mazapán, my portfolio

  2. #2
    self-portrait Kianis's Avatar
    Join Date
    Feb 2004
    Location
    Stockholm, Sweden
    Posts
    425
    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?
    // Mazapán, my portfolio

  3. #3
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    try, EXACT_FIT.
    lather yourself up with soap - soap arcade

  4. #4
    self-portrait Kianis's Avatar
    Join Date
    Feb 2004
    Location
    Stockholm, Sweden
    Posts
    425
    Quote Originally Posted by mr_malee
    try, EXACT_FIT.
    It doesn't even trigger in the IDE
    // Mazapán, my portfolio

  5. #5
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    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?
    lather yourself up with soap - soap arcade

  6. #6
    self-portrait Kianis's Avatar
    Join Date
    Feb 2004
    Location
    Stockholm, Sweden
    Posts
    425
    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.
    // Mazapán, my portfolio

  7. #7
    M.D. mr_malee's Avatar
    Join Date
    Dec 2002
    Location
    Shelter
    Posts
    4,139
    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.
    lather yourself up with soap - soap arcade

  8. #8
    self-portrait Kianis's Avatar
    Join Date
    Feb 2004
    Location
    Stockholm, Sweden
    Posts
    425
    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.
    // Mazapán, my portfolio

  9. #9
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  10. #10
    self-portrait Kianis's Avatar
    Join Date
    Feb 2004
    Location
    Stockholm, Sweden
    Posts
    425
    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.
    // Mazapán, my portfolio

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center