100 likes | 272 Views
CCT260H. Flash-Integration and XML. Flash. Flash is a “movie” that contains pictures, video and sound Flash is also the primary drive of most video-based website A language is built-in allowing developers to program intelligence into the movie – creating interaction with the user.
E N D
CCT260H Flash-Integration and XML CCT260H - Christopher Evan Jones
Flash • Flash is a “movie” that contains pictures, video and sound • Flash is also the primary drive of most video-based website • A language is built-in allowing developers to program intelligence into the movie – creating interaction with the user CCT260H - Christopher Evan Jones
Flash Integration • Flash Integration is easy! <objecttype="application/x-shockwave-flash" data="space.swf" width="550" height="300"> <paramname="movie" value="space.swf"/> </object> • Place <object> in your body • Set the size using height and width • Remember there are twoplaces to set the flash file Width & Height of the Movie CCT260H - Christopher Evan Jones
Linking to Flash Link videos from YouTube! <objecttype="application/x-shockwave-flash" data="http://www.youtube.com/v/ljbI-363A2Q" width="400" height="300"> <paramname="movie" value="http://www.youtube.com/v/ljbI-363A2Q"/> </object> http://www.youtube.com/watch?v=ljbI-363A2Q Set a proper aspect ratio Copy the name CCT260H - Christopher Evan Jones
Interactive Flash Charts • amChart is a quick and easy way of adding flashy charts to your website • http://www.amcharts.com/ • All you need is three files: • The Flash movie • An XML settings file • An XML data file CCT260H - Christopher Evan Jones
amCharts <objecttype="application/x-shockwave-flash" data="ampie.swf" width="600" height="400"> <paramname="movie" value="ampie.swf"/> <paramname="flashvars" value="path=&settings_file=ampie_settings.xml&data_file=ampie_data.xml"/> </object> <param> elements contain parameters that are passed to the flash movie In this case, it is the location of the XML data and settings file CCT260H - Christopher Evan Jones
XML • Extensible Mark-up Language • Much like HTML(XHTML), XML is used to provide context to data or text • Works on the same concept of elements, tags and attributes CCT260H - Christopher Evan Jones
XML breakdown <?xmlversion="1.0" encoding="UTF-8"?> <pie> <slice title="Twice a day"pull_out="true">358</slice> <slice title="Once a day">258</slice> <slice title="Once a week">154</slice> <slice title="Never" alpha="50">114</slice> </pie> States that it is XML data The XML defines a pie chart It contains 4 slices of pie (or 4 data items) This is a single pie item with a name and value This is extra information to tell Flash how to format the pie slice CCT260H - Christopher Evan Jones
For This Lab • Find some data related to your subject • Create a chart to depict this data (see wiki for files) • Use one of your old labs! • Add a YouTube video! CCT260H - Christopher Evan Jones
Notes • RENAME YOUR FILES beforehand: • <Name>-data.xml e.g. ChrisJones-data.xml • <Name>-settings.xml • Hand in your .html file and both .xml settings • You do not have to upload the .swf file CCT260H - Christopher Evan Jones