Sunday, February 24, 2019
Scripting multimedia web pages
Chapter 07 Scripting multimedia system system sack rascalsSCRIPTING MULTIMEDIA WEB PAGESLEARNING OUTCOMEUpon the boundary of this chapter you should be able toUnderstand assorted scripting methods used for web summon designing.Know the different types of scheduling linguistic confabulations.Know the OOP paradigm and umber book.Know OOP paradigm and slangUnderstand the java 3D supposititious account.Know the assorted multimedia coiffes.7.1 Scripting multimedia web knavesMultimedia would be exanimate with pop out scripting. Multimedia be interjects interactive when scripting is added to it. The interaction characteristics such(prenominal) as doing a bill of f atomic number 18 vent, alteration of colour on axial gyration over of pilfer, figure filling on a web rascal and compilation and imparting that discipline to an early(a) topographic point adequate to(p)ing move a naked as a jaybird browser window when choosing a hyperlink triping a new instalment when an number is selected or even doing simple games.7.1.1 Types of scheduling linguistic communicationsMachine code is the most elemental type of scheduling.Machine code is merely wiz typeIt is composed merely of the deuce binary figures 0 and 1.Interpretation of the machine code depends on the hardw be running in the computing machine.Programing linguistic communications ar of numerous types. The most of import linguistic communications argonGeneral-purpose scheduling linguistic communicationScripting scheduling linguistic communication bearing-oriented scheduling linguistic communicationGeneral-purpose scheduling linguistic communications embroil coffee bean, C and C++ . These linguistic communications argon to be compiled by a compiler plan. A compiler is a plan which translates beginning computer code write in a droll scheduling linguistic communication into computer-readable machine codification that fag be executed on its ain. coffee treeScript, Flash ActionScript and Li ngo come under Scripting linguistic communications n incessantlytheless it uses Object-oriented linguistic communication either bit exhaustively.General characteristics of scripting linguistic communications atomic number 18Easy to check and utilizeNeed non be compiledBy and life-sized interpreted at run-timeAssociated with a diverse orbital cavity of bing computing machine constituentsAble to pass on with other scheduling and scripting linguistic communications.7.1.2 Basic construe wrenchsPrograming linguistic communications defecate restraint constructions that direct the flow of in coiffeion. The three basic authorisation constructions arsequence alternativerepeatConsecutive control constructionThe stairss from start to complete are perfectly carried out one after(prenominal) another, without any break. submition control constructionThese are statements where a professedly/false pick is made.The if statementIf the status is true, so a current action or actions tolerate be triggered if false, so they are ignored. These types of statements are normally known as an if statement.The if/else statementIf the status is true, so a certain(prenominal) action or actions can be triggered if false, so a certain action or actions can be triggered.repeat control constructionThese are statements that are often acted upon while a peculiar status remains true. While the status is true, the needed actions will be carried out. Equally shortly as the needed status is false, so the eyelet will be ignored. It is of import to observe that there must ever be some expressive style to do a status false.The basic control constructions can anyhow work together in a sequence or nested within from each one other to quite complicated statements.7.1.3 The OOP paradigmThe scripting languages belong to a put called Object Orientated Programming, or OOP that incorporates Lingo, ActionScript and burnt umberScript. OOP breaks the sequence of stairss from top to bottom into separate parts called target areas that interact with each other in a non-linear manner.OOP is based on grouping scripting in coiffeion into categories. From a category, multiple casings can be made and used. These cases are referred to as designs. each(prenominal) intention has belongingss and methods. These computer programing quarrys are like as vivacious founding object lenss.All the objects such as frames, movieClips, films, take out instalments, merelytons, schoolbook Fieldss, etc. are merely objects made with codification. They are seeable because they curb belongingss such as size, colour, place, etc. and the user can utilize them as they have methods such as drama, halt, edit, etc.Puting up for codification burnt umberScript, ActionScript and Lingo have different scripting environments. deep brownScript is by and large bound to net pages.ActionScript is within the frames of a timeline and on objects such as buttons and movieClips.Lingo is like A ctionScript, but has different types of books depending on where it is used.Event animal trainersAn proceeds occurs when the mouse is moved or the mouse button is clicked, a key is touch or a web page is loaded. It is a individual incident though it may be repeated many times a 2nd, such as enterFrame in ActionScript and Lingo.The animal trainer is the piece of codification that every book linguistic communication contains to observe the returns. Some event animal trainers are common to JavaScript, ActionScript and Lingo, and some are precise to certain scripting linguistic communication. Common event animal trainers are mouseup, mouseDown and enterFrameJavaScript and ActionScript allow books to be triggered without the event animal trainer,In JavaScript, any codification that is decently added in the midst of the book ticket is carried out when loaded into the browser.In ActionScript, any codification that is right added to an wiz frame in any timeline will be executed when the playhead enters that frame.In Lingo, codification must be with in an event animal trainer.7.1.4 OOP and JavaScriptAll the scripting linguistic communications have default and user delimitate objects. Default objects are built in the scripting linguistic communication and substance abuser defined objects are 1s that are made by you. In scripting linguistic communications like JavaScript, you can soften every bit many cases of a peculiar object category as you like. Your scripting linguistic communication should cognize the specific object case you target and the belongings or method you want to command.One of the most critical belongingss is calling single object cases. In JavaScript, the take in property is added to the HTML elements ticket. For illustration, to call the var. loginForm in an HTML use the undermentioned codification& lt signifier quote= loginForm & gt Objects in JavaScript are called the entry Object Model ( DOM ) . DOM is a pecking order of objects t hat are contained in each HTML page. These objects are chiefly categorized into three types Window object, document object and signifier object. Window object is at the top of the hierarchy. Document and form objects are largely manipulated. The signifier object is ever in the papers object.DOM illustration Text sphere of influence for loginTo entree the textual matter in a text field i.e user relieve oneself set(p) in a signifier called loginForm on a web pagedocument.loginForm.userName. tax ( read this from right to left )Here the scripting statement entree the look upon belongings of the text field object called userName that is in the signifier object called loginForm , which is in bend is in the web page s papers object. The terminal consequence of this statement is text threading shelter.Properties and methods in JavaScriptPropertiesProperties are by and large linked to the physical visual aspect of scripting objects. In existent life, objects besides have belongings s. Some belongingss of object are read-only, that is the belongings s value can be retrieved but can non be changed. otherwise object belongingss can be retrieved and changed. These characteristics are referred to as proving or puting a belongings s value. exercise 1 judgment of conviction structure JavaScript proving a image s width belongingsdocument.greenHondaCRX.widthIn this illustration, the scripting statement entree the value of the width belongings of the image object called greenHondaCR , that is in web page s papers object.Example2 clip structure JavaScript puting a image s width belongingsdocument.greenHondaCRX.width = 257 In this illustration, the scripting statement is puting the value of the width belongings of the image object called greenHondaCR to 257 . The greenHondaCR image object is in web page s papers object.MethodsMethods are linked to the intent and actions of an object. Real life objects can besides hold methods/actions. Methods require excess in formation for the object to get off out the action right. In scripting linguistic communications this excess information is referred to as a methods parametric quantities or statements.Example 3 fate structure JavaScript utilizing the business relationship objecthistory.go ( -1 )In this illustration, the scripting statement is utilizing the go method of the history object. Methods are typically recognized by the employ of brackets ( ) after the methods name. The brackets are used to envelop any parametric quantities that you send to the method. In the in a higher place illustration, we are directing negative one ( -1 ) , which instructs the go method of the history object to lade the old web page.7.1.5 OOP and ActionScriptIn ActionScript, select the object case on mannikin and enter an case name in the Properties panel. This is same as appellative variables.ActionScript uses aim waies to maintain path of object cases. These waies are laid out like a passage authority m ap and object should hold a name to look on this route map. This route map is a hierarchy, with the chief timeline at its base.ActionScript shows the object hierarchy in a cross-file by snaping the insert memorialise way button situated in the ActionScript Panel.Let us take an illustration grimeer way road map Text field and button for login, where we have two objects a film cartridge holder with a text field in it and a button. They are in the root timeline. Select each point and verify its name in the Properties Panel.The movieClip has the name loginClip .The text filed in the movieClip is named userName .The button is name btnLogin .Choose the button in the root timeline and open the ActionScript Panel in Expert Mode Click the Insert a target area way button.The Insert Target Path duologue boxwood opens and shows a ocular representation of the road map of objects without delay companionable from the timeline that we are in.In the Insert Target Path duologue b ox, choice Dots and overbearing options.Click the little increase gestural + following to the movieClip icon name loginClip to lay out the text field object in it.The existent mark way of the selected movieClip object loginClip appears.Click the text filed icon userName , the mark way alters.In ActionScript, absolute mark waies ever start from the _root timeline of the file. Relative mark waies start with the current object selected on phase.Click on the option Relative .Click on the little plus gestural + following to the movieClip icon name loginClip and select the userName text field.The mark way alters. Alter aboriginely get downing with _root it now starts with this , bespeaking the objects that are presently selected on phase.We have a mark way from the point we have originally selected on phase, the btnLogin button, to the text field userName that resides in the movieClip loginClip .7.1.6 OOP and LingoIn Lingo, the most normally used objects are cast members , and cast member object cases are sprites. In Director the objects must be in the film s dramatis personae to look on the phase. All cast members that are placed in the mark have a default dramatis personae member figure and a aalone(predicate) dramatis personae member name. Through these two dramatis personae member belongingss, Lingo communicates to specific dramatis personae members and its associated sprites.To pass on to single sprite cases in the mark, Lingo uses the hassock s figure.Sprite Number ExampleIn Director, everything that is on the phase goes into a impart in the mark. Merely one poof can busy a channel.For illustration the fairy s figure is four, the doom structure to entree the width belongings of this fairy would befairy ( 4 ) .widthorthe breadth of sprite 4Lingo has two types of denounce structure The initial codification sample uses dust sentence structure, which is in broad usage now. The 2nd illustration is what Lingo calls verbose sentence structur e. Almost any Lingo statement can be written with either dot sentence structure or verbose.In the first dot syntax illustration, the scripting statement is aiming the fairy object that is in channel four of the mark and accessing its width belongings. To Lingo, this all complete line of codification represents one whole number value stand foring the fairy s current breadth in pels.Cast member Name ExampleIn Director, everything that is created or imported into the dramatis personae is allocated a dramatis personae member figure and a alone dramatis personae member name.Choose a dramatis personae member and enter its name in the Cast Member Name text field.For illustration, a dramatis personae member 2, which its name green square member ( green square )member ( 2 )It is standard industry pattern to utilize cast member s name instead that its figure. In some particular fortunes the usage of cast member Numberss would be effectual.For the sprite illustration in Lingo codificat ion, the sentence structure for aiming cast member objects can be written in both dot and verbose sentence structure.In the first dot sentence structure, the scripting statement is aiming the dramatis personae member named green square and accessing its width belongings. To Lingo, this whole complete line of codification represents one whole number value stand foring the dramatis personae member current breadth in pels.Self bridle 7.11. If much(prenominal) than one dramatis personae member has the same name, what will Lingo make if that name is used in book?7.2 Java 3DJava 3D is a set of criterions that have been broaden under Java 2 for reservation 3D artworks. Java 3D is a scene graph-based 3D application programing port wine ( API ) for the Java platform. It runs on top of either OpenGL or Direct3D.Advantages of Java 3DPlatform MugwumpIt is platform independent as it is an API accompaniment of Java.Object-oriented 3D ArtworksIt is carried out by utilizing a scene graph-based 3D artworks theoretical account.Optimized SpeedDuring runtime, the scene graph of the fastest possible renders is optimized by utilizing the rendition capableness drifter. This facilitates the Java 3D to be used in interactional artworks environments every bit good as high quality artworks. insurrection of 3D dockersFree handiness of Java 3D VRML97 file stevedore and browser, with their codifications.Support Exotic DevicessThe com.sun.j3d.utils.trackers package runs Fake infinite, Logitech, and Polhemus devices.Disadvantages of Java 3Dmeasure Extension APIJava 3D is a standard extension API to the Java2 platform, which is regarded as a hazard factor as it may restrict the portability of Java 3D codification across platforms.Availability LimitationSun is the lone key seller that is back uping Java 3D through Solaris and Win32. The cross-platform portability is a serious issue for Java 3D.Concealment of Rendering Pipeline deep down informationsJava 3D a high degree A PI, deliberately hides inside informations of the rendering grapevine from the developer therefore doing it incompatible for applications where such inside informations are required.Heavyweight constituentsJava 3D, being heavyweight, carries out the rendering through native non-Java equal. In general the lightweight and heavyweight constituents of Java do non portmanteau word good when placed together in one object or window.7.2.1 Key differences between Java 3D and VRMLProgram ardour In making 3D universes, VRML adopts a content-centric attack and Java 3D adopts a program-centric attack.flexiblenessJava 3D is more lissome in footings of programming manner and the maps available. The let out figure of available maps makes Java 3D a better tool in making specific and modified behaviour and applications. Java 3D provides extended contain for behaviours, interpolators, niping and hit sensing.Application abstrusenessVRML is more meet for simple artworks applications where as Java 3D is more suited for making the content or 3D universe applications.File formatVRML has a standardized file format. Java 3D, has capableness to back up compiled codification of low degree API for faster 3D artworks rendering.CompatibilityJava 3D supports VRML objects through the VRML97 stevedore but VRML can non run Java 3D plans.Dynamic fluctuation of scene graphThe scene graph that describes the practicable 3D universe created in Java 3D can be changed dynamically but in VRML it is non executable.Vendor supportMost of the sellers support VRML than Java 3D.Some portion of Java 3D is basically evolves from OpenGL. OpenGL is non good suited for developing complicated 3D artworks applications due to programming, debugging, and care attempts.FeaturesMultithreaded scene graph constructionGeneric Real-time API, useable for both visual image and gamblingSupport for retained, compiled-retained, and flying manners renderingIncludes hardware-accelerated JOGL, OpenGL and Direct3D renderers ( depending on platform )Platform independentNative support for head-mounted showCAVE ( multiple screen projectors )3D spacial soundcomplicated virtual-reality-based position theoretical account with clasp for stereoscopic rendition and complex multi-display constellationsProgrammable shaders, back uping both GLSL and CGImporters for most mainstream formats, like 3DS, OBJ, VRML, X3D, NWN, and FLTStencil bufferSelf cheque 7.21. List out the advantages and disadvantages of java3D7.3 Multimedia fix upsMultimedia elements like sound or pictures are stored in media files. chance upon the file extension to place the media type. If the file is an HTML page, the browser spots the file extensions as.htm or.html. If it is an XML file, the browser spots it as.xml extension and the manner sheet is descry as.css. Image formats are identified by extensions like.gif and.jpg.Windows Multimedia setsWindows media files have the extensions like.asf, .asx, .wma, and.wmv. advance(a) sprouting For mat ( ASF )ASF is peculiarly designed to run over the Internet. ASF files include audio, picture, slide shows, and synchronised events. These files should be good compressed and are delivered as a changeless flow of informations. The file size is non restricted but should be good compressed to fit assorted bandwidths.Advanced Stream Redirector Format ( ASX )ASX files are metafiles that provide information about files used to cast multimedia content. These are field text filesWindows Media Audio Format ( WMA )WMA format is developed by Microsoft to manage all types of audio content. Similar to ASF regularize these files excessively should be good compressed and are delivered as a changeless flow of informations. The file size is non restricted but should be good compressed to fit assorted bandwidths.Windows Media Video Format ( WMV )WMV format is developed by Microsoft to manage all types of picture content. Similar to ASF set these files excessively should be good compressed and are delivered as a changeless flow of informations. The file size is non restricted but should be good compressed to fit assorted bandwidths.Windows Media Audio Redirector Format ( climb up )WAX files are similar to ASX files, but designed to depict audio files.Windows Media Player Format ( WMP )WMP files and WMX are reserved file types for future usage by Windows. Multimedia elements like sound or picture besides have their ain file formats with different extensions.General-purpose FormatsMatroska File Formatwhich aims to be an all-enclusive, unfastened multimedia container format.Acorn Replay File FormatAcorn Replay ( RPL ) file format used on RISC OS machines. The format is often seen on Eidos games, but is designed as a all-purpose format.Self cheque 7.31. List out assorted multimedia formats and their utilizations.7.4 SummaryThis is the 7th faculty for the multimedia web development class. This faculty explains about the different types of programming linguistic communicatio ns such as General-purpose scheduling linguistic communication, Scripting programming linguistic communication and Object-oriented scheduling linguistic communication.In this chapter you have learnt about control constructions that direct the flow of information in scheduling linguistic communication. additionally you have learnt the different types of control construction such as sequence, choice and RepeatIn add-on, this faculty pointed out the OOP paradigm and JavaScript. Further you have learnt about Properties and methods in JavaScript.It besides explained the Java 3D, a scene graph-based 3D application programming Interface.Finally you have learnt about the advantages and disadvantages of Java 3D and the cardinal differences between Java 3D and VRMLCardinal TERMSDOM Document Object ModelASF Advanced Streaming FormatASX Advanced Stream Redirector FormatWMA Windows Media Audio FormatWMV Windows Media Video FormatWMP Windows Media Player FormatWAX Windows Media Audio Redi rector FormatMentionDavid Miller ( 1996 ) weathervane multimedia development pages 649 ISBN1562056832, 9781562056834Timothy Paul Garrand ( 2001 ) Writing for multimedia and the web Pages 341 ISBN0240803817, 9780240803814Stephen McGloughlin ( 2009 ) Multimedia on the Web Pages 193 ISBN1575766485, 9781575766485Timothy Paul Garrand ( 2006 ) Writing for multimedia and the Web a practical usher to content development for synergistic media Pages 478 ISBN0240808223, 9780240808222ActivityA. True/ wrong Questions1. Machine codification is composed merely of the two binary figures 0 and 1. ( true(a)/ ill-judged )2. Multimedia would be lifeless without scripting. ( TRUE/ phoney )3. Programing linguistic communications do non hold control constructions to direct the flow of information. ( TRUE/FALSE )4. OOPs is based on grouping scripting information into categories. ( TRUE/FALSE )5. In OOP s each object does non hold belongingss and methods. ( TRUE/FALSE )6. An event will non ex it when the mouse is moved or the mouse button is clicked. ( TRUE/FALSE )7. ActionScript uses aim waies to maintain path of object cases. ( TRUE/FALSE )8. Java 3D is a scene graph-based 3D application programming interface ( TRUE/FALSE )9. Java 3D is platform dependant. ( TRUE/FALSE )10. WMV format is developed by Microsoft to manage all types of picture content. ( TRUE/FALSE )B. Multiple Choice1. The different types of scheduling linguistic communications are __________A ) General-purpose scheduling linguistic communicationB ) Scripting programming linguistic communicationC ) Object-oriented scheduling linguistic communicationD ) All the above2. In _____________ the stairss from start to complete are absolutely carried out one after another, without any break.A ) Sequential control constructionB ) Selection control constructionC ) Repetition control constructionD ) no(prenominal) of the above3. The OOP stands forA ) Object Operating ProgramingB ) Original Orientated ProgrammingC ) Object Orientated ProgrammingD ) Object Orientated repair4. Which of The followers is a basic control constructions?A ) sequenceB ) choiceC ) A & A BD ) None of the above5. In OOPs the cases are referred to as ________A ) PropertiesB ) ObjectsC ) MethodsD ) None of the above6. Objects in JavaScript are called the ____________-A ) Document Oriented ModelB ) Document Object ModelC ) A & A BD ) None of the above7. ____________ shows the object hierarchy in a file by snaping the insert mark way buttonA ) ActionScriptB ) OOPC ) LingoD ) All the above8. In making 3D universes, VRML adopts a _________________ and Java 3D adopts a __________________A ) content-centric attack, program-centric attack.B ) program-centric attack, content-centric attackC ) program-centric attack, program-centric attackD ) None of the above9. Extensions used by Windows media files areA ) .asfB ) .asxC ) .wma,D ) All the above10. __________files are metafiles that provide information about files used to depic t multimedia content.A ) WMAB ) WMVC ) ASXD ) All the aboveChapter 7 Answers ( True/False Questions )1. T 2. Thymine3. F 4. Thymine5. F 6. F7. T 8. Thymine9. F 10. ThymineAnswer ( Multiple Choice Questions )1. D 2. adenine3. C 4. C5. B 6. Bacillus7. A 8. Angstrom9. D 10. C
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment