..


Sponsored Links

Dynamics to a SMIL presentation with ASP

Article written by Luca Ruggiero

SMIL presentations can be performed in any type of Web pages such as HTML pages or dynamic web pages as a traditional ASP, PHP and so on.

Let's examine how to make a dynamic SMIL presentation by performing it in an ASP file.

The example we are going to achieve is just one of many tricks that can be used to boost SMIL presentations, so you take only as educational advice.

At the click of a button on the page we see the time of loading of the presentation, we activate different transition effects to an image that will be visible only to click occurred.

we see an example of code:






 <% @ LANGUAGE = VBScript%>







 <%



    



 Dim result



    



 effect = Request.QueryString ("effect")



    



 Dim filter (2)



    



 Filter (0) = "clockWipe"



    



 filter (1) = "fade"







 %>







 <html xmlns:time="urn:schemas-microsoft-com:time">







 <head>



    



 <? Import namespace = "time" implementation = "# default # time2">



    



 <style type="text/css">



    



 . Time



    



 {



        



 behavior: url (# default # time2);



    



 }



    



 </ Style>



    



 <script type="text/javascript">



    



 effect function (id)



    



 {



        



 location.href = "smil.asp? effect =" + id;



    



 }



    



 </ Script>







 <head>







 <body>









 <input type="button" value="Effetto clock" onclick="effetto(0)">







 <input type="button" value="Effetto fade" onclick="effetto(1)">









 <%



    



 If result <> "" Then







 %>







 <br /> <br />







 <Time: transitionfilter



    



 targetelement = "X"



    



 type ="<%= filter (effect)%> "



    



 begin = "X.begin"



    



 dur = "5s" />







 <img src="immagine.gif" id="X" class="time" />







 <%



    



 End If







 %>









 </ Body>







 </ Html>



Before the opening of the code we specify SMIL, ASP in a block, an array containing different transition effects. Council reading this lesson, the guide to SMIL Mr. Webmaster for a complete list of available effects.

At this point we check that the query string has been valued, or that the click on the button of choice has taken place, in order to show the filtered image from its chosen effect.

Smil.asp start the file at:

 



 http://localhost/smil.asp

 
Following a preview of 'image transition effect clockWipe:

In the same category ...

...

E-Learning
CSS (Course) CSS (Course)
Web Design and Accessibility according to W3C CSS and XHTML. Starting from 29 €.
XML (Course) XML (Course)
Creation of XML structures, XSL and other languages ​​extensible. Starting from 29 €.
Sponsored Links