I have specified a stage size of 800x600, and put all my frames in a s:Group with a width and height of 100% and top & left = 0. The same applies to all the frames that are inside the s:Group.

But when I display my .swf, it has 20 pixels of whitespace at the top, and is at least 1042 pixels wide (that's where the black area ends).

I've attached the code and the swf.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:local="*"
       xmlns:mx="library://ns.adobe.com/flex/mx"
       xmlns:loc="location.*"
       xmlns:ch="choices.*"
       xmlns:step="script_step.*"
       pageTitle="GHen"
       height="600"
       width="800"
       backgroundColor="#FFFFFF">

  <fx:Declarations>
  </fx:Declarations>
  <s:layout>
    <s:VerticalLayout horizontalAlign="center" paddingTop="20" />
  </s:layout>

  <!-- This group contains all the main parts of the game.  Each one fills
       the entire window, and the AS3 code turns them visible or invisible
       as the player works through the game. -->
  <s:Group id="all" left="0" top="0" width="100%" height="100%">

    <!-- The help screens -->
    <s:Group id="helptop"  visible="false" left="0" top="0">
      <s:Rect top="0" left="0" right="0" bottom="0">
	<s:fill>
	  <s:SolidColor color="0x0" />
	</s:fill>
      </s:Rect>
	<s:RichText id="helpchoice" color="0xffffff"> <!-- choose help level -->
	</s:RichText>
	<s:RichText id="helpbrief" color="0xffffff"> <!-- help summary -->
	  <s:content>
	  </s:content>
	</s:RichText>
	<s:RichText id="help1" color="0xffffff"> <!-- help screen #1 -->
	  <s:content>
	  </s:content>
	</s:RichText>
	<s:RichText id="help2" color="0xffffff"> <!-- help screen #2 -->
	  <s:content>
	  </s:content>
	</s:RichText>
    </s:Group> <!-- end of help screens -->

    <!-- The splash screen is displayed first. After the player clicks the
	 accept link, the main menu is displayed.  When the user starts a
	 new game, the map is displayed. From there, various rooms and
	 characters display themselves. -->
    <s:Group id="splashscreen" left="0" top="0" width="100%" height="100%">
      <s:RichText opaqueBackground="0x0" left="0" top="0"
	    width="100%" height="100%">
	<s:div backgroundColor="0x0" color="0xffffff">
	  <s:div id="splashbody" backgroundColor="0x0" color="0xffffff"
	      paddingTop="14" paddingRight="60" paddingLeft="60">
	    <s:div id="warning1" paddingBottom="24"
		color="0xf00000" textAlign="center"
		fontSize="48" fontWeight="bold"
		fontFamily="Helvetica,Verdana,Tahoma,sans-serif">
	      !!! LISTEN UP !!!
	    </s:div>
	    <s:div id="warning2"
		color="0xf00000" paddingBottom="27"
		textAlign="center"
		fontSize="22" fontWeight="bold"
		fontFamily="Helvetica,Verdana,Tahoma,sans-serif">
  Please read the whole thing and pay attention if you want to know<s:br/>
  what to click on to start the game!
	    </s:div>
	    <s:div fontSize="16">
	      <s:p paddingBottom="24" paddingTop="0">Some text
	      ... some more text...
	      with the magic word hidden inside
	      ... some more text...
	      </s:p>
	    </s:div>
	  </s:div>
	</s:div>
    </s:RichText>
    </s:Group> <!-- end of warning screen -->

    <!-- The main menu screen. From here, the player can start a new game,
	 read the help text, read the credits, or restore a saved game. -->
    <!--
    <s:Group id="mainmenutop"  visible="false" left="0" top="0"
	    width="100%" height="100%">
      <s:BitmapImage source="@Embed('../imgs/menubackground.jpg')" x="0" y="0" />
      <s:HGroup id="mainmenugroup" x="0" y="0">
	<mx:Spacer />
	<s:VGroup id="mainMenu" width="200" />
	<mx:Spacer height="24"/>
	<s:Label fontSize="10" fontFamily="Century">
	  <s:filters>
	    <s:DropShadowFilter blurX="4" blurY="4" distance="4"
		angle="45" color="0x0" />
	  </s:filters>
	    Gasper Heights v.0.01
	</s:Label>
      </s:HGroup>
      -->

  </s:Group> <!-- end of the group that holds the whole game -->

  <fx:Metadata>
    [Event(name="customEvent", type="flash.events.Event")]
  </fx:Metadata>
  <fx:Script >
    <![CDATA[
      import flashx.textLayout.formats.TextDecoration;
      import mx.events.ItemClickEvent;
      import mx.core.FlexTextField;
      import gamelogic.*;
      import Displayable.*;
      import spark.components.*;
      // import gamelogic.GameSequence;

      private var myController:GameSequence;
      private var myGame:Game;
      private var myMainMenu:MainMenu;

      protected function startGame():void
      {
	  var game:Game = Game.getGame();
	  var myController:GameSequence = GameSequence.getGameSequence();
	  myController.setGame(game);
	  myGame.setController(myController);
	  var myMainMenu:MainMenu = MainMenu.getMainMenu();
	  myMainMenu.setController(myController);
      }

      protected function gotoMainMenu():void
      {
	  //;; myController.mainMenu();
	  // I commented the above out because it was jumping to the main
	  // menu too soon. I'll deal with that later.
      }


    ]]>
  </fx:Script>
	
</s:Application>

Reply via email to