Locating your final HTML and Silverlight files
Publishing your content
Venture into Gaming Using Expression Blend: Module 10
Publishing and Testing your Silverlight Game
When it comes time to get your game online, you need to take care of the files you transfer from your local system to a remote one. There are a great number of files involved in the authoring process that should remain with the author, not put online. In this module, you will learn how to locate only the files needed to place your game online.
Using Expression Web 3 to Insert Silverlight Content into a Web Page
Expression Web is part of Expression Studio and allows you to insert Silverlight content into a pre-existing or new HTML Document.
Open Expression Web 3 and choose Site > New Site. From the Options that appear, select the One Page Site Option. Navigate to the folder associated with this module by clicking Browse.
Create a new folder and name it beehive_web, then click OK.
In the Folder List, you will see the default.html page created. Double-click it to open the page into Design View.
Click the Tag Properties tab if necessary and click the swatch for bgcolor, this opens a color palette, Choose the color black. This will serve as a good background color for your game.
To Insert your Silverlight Application, choose Insert> Media> Silverlight.
You will be prompted to select a Silverlight 2 or Silverlight 3 XAP file. The Xap file holds all the various components of the Silverlight Application.
In this case, you can locate your beehive XAP file in the following directory:
beehive>beehive>Bin>Debug> beehive.xap
Select this file and then click Open.
A placeholder will appear for your beehive game. You will not be able to see the rendered game until you open the page in the Browser.
The default code that Expression Web generates for this placeholder is 640 pixels wide by 480 pixels high. You need to change this or else the application will be too small.
Click the white placeholder. This represents the Object tag for your Silverlight application. In the Attributes section of your Tag Properties window, change the height to 600 and the width to 800.
Choose File > Preview in Browser. You will need to Save the Changes, then click OK.
Your Game will appear inside your HTML. Click the Ball to test the game and when done, close the Browser.
Return to Expression Web and click the Site View Tab. You can see that a few new folders have been added, one named Silverlight, the other named Javascript. The Silverlight Folder is simply a subfolder with your xap file nested within. The Javascript file is a script that checks whether ot not a user has the correct version of Silverlight installed. If they do not have the correct version, the script provides a means for them to install it.