|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
|
Announcements
Want a new Job?
Chapters
Services
Feature Zones
|
IntroductionThis article will explain how we can use Silverlight using JavaScript. BackgroundThis digital clock has been developed using Silverlight and JavaScript. We have four different files here. The XAML file will have code to display the numbers using different shapes like rectangle and polygon. If you know VML, then this XAML file will have the same syntax. Using the CodeHere, we will see a different file separately. Before you start using Silverlight, you have to download the Silverlight Plugin. 1. DigiClock.htmThis file will be executed by the browser to show the digital clock. First, add the JavaScript references to this page. Then, declare a <script src="Silverlight.js"></script>
<script src="my-script.js"></script>
</head>
<body>
<!-- Container-->
<div id="DigiClock">
</div>
<script type="text/javascript">
// Create Container Object.
var parentElement = document.getElementById("DigiClock");
// This function creates the Silverlight control.
createMySilverlightDigiClock();
</script>
2. Silverlight.jsThis file has to be downloaded from the Internet. This file will contain the methods to create a Silverlight control and other helper methods. 3. My-Script.jsThis file will contain my custom JavaScript functions to show the digital display.
4. digiclock.xamlThis file is the most important file where you have to define all the shapes you are going to use in your application. Here, I have created a single digit with seven polygons and each polygon's Note: I have also added my name at the bottom using PolyLine and Path Elements. Points of InterestI am working with .NET for the past 4 years. My areas of interest include .NET, AJAX and other new upcoming technologies. History
|
|||||||||||||||||||||||||||||||||||