A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Fullscreen background

  1. #1
    Junior Member
    Join Date
    Sep 2014
    Posts
    4

    Fullscreen background

    Hi everyone !
    I'm new here...
    What I wanted to ask is if there is any opportunity to make my project fullscreen (adjust to the resolution of the clients monitor) but the size of my app will be constant and application should be align center horizontaly and verticaly so what I mean is to make white border around my app that will display fullscreen and the apps size will be constant.

    Thanks for any help !
    Attached Images Attached Images

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    This should get you started

    with a movieclip on stage called box, any size.
    PHP Code:
    import flash.events.Event;

    stage.align StageAlign.TOP_LEFT;
    stage.scaleMode StageScaleMode.NO_SCALE;
    stage.addEventListener(Event.RESIZE,doSize);

    box.= (stage.stageWidth box.width) / 2;
    box.= (stage.stageHeight box.height) / 2;

    function 
    doSize(e:Event):void
    {
        
    box.= (stage.stageWidth box.width) / 2;
        
    box.= (stage.stageHeight box.height) / 2;

    and the accompanying html page, as written by flash, with changes

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    	<head>
    		<title>box</title>
    		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    		<style type="text/css" media="screen">
    		html, body { height:100%; background-color: #ffffff;}
    		body { margin:0; padding:0; overflow:hidden; }
    		#flashContent { width:100%; height:100%; }
    		</style>
    	</head>
    	<body>
    	<div id="flashContent">
    		<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="100%" height="100%" id="box" align="middle">
    			<param name="movie" value="box.swf" />
    			<param name="quality" value="high" />
    			<param name="bgcolor" value="#ffffff" />
    			<param name="wmode" value="window" />
    			<param name="scale" value="noScale" />
    			<param name="allowScriptAccess" value="sameDomain" />
    			<!--[if !IE]>-->
    			<object type="application/x-shockwave-flash" data="box.swf" width="100%" height="100%">
    				<param name="movie" value="box.swf" />
    				<param name="quality" value="high" />
    				<param name="bgcolor" value="#ffffff" />
    				<param name="wmode" value="window" />
    				<param name="scale" value="noScale" />
    				<param name="allowScriptAccess" value="sameDomain" />
    				<!--<![endif]-->
    				<a href="http://www.adobe.com/go/getflash">
                    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
    					</a>
    				<!--[if !IE]>-->
    				</object>
    				<!--<![endif]-->
    			</object>
    		</div>
    	</body>
    </html>


    I'm not sure how this works with mobile apps as I don't do them
    Last edited by fruitbeard; 09-17-2014 at 09:12 AM.

  3. #3
    Junior Member
    Join Date
    Sep 2014
    Posts
    4
    Thanks !
    but what about publishing to windows projector (EXE) without html?

  4. #4
    Junior Member
    Join Date
    Sep 2014
    Posts
    4
    and btw how can I make my exe file bordless? (without Adobe Flash Player title and window border)

  5. #5
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    You would use the same method or code as above, making your screen full or not using
    import flash.system.fscommand;

    fscommand("fullscreen","true");
    fscommand("fullscreen","false");

    perhaps with a button

    and obviously publish your exe file

  6. #6
    Junior Member
    Join Date
    Sep 2014
    Posts
    4
    okey and is there opportunity to get the screen resolution:

    trace(Capabilities.screenResolutionX);
    trace(Capabilities.screenResolutionY);

    than set the stage-size: stage.width and stage.height so it will be the same as screen resolution
    and set the object size just like the size of the stage?

  7. #7
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Basically Capabilities.screenResolutionX and Capabilities.screenResolutionY one will only tell you what size monitor the person uses.
    When using fullscreen mode the exe/swf will fit the monitor regardless of size, if you want to either scale the whole page or just a certain part of your movie then you will need to mess around with the stage.scaleMode = StageScaleMode

    http://help.adobe.com/en_US/FlashPla...ScaleMode.html

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