Saturday, May 18, 2019

Scripting multimedia web pages

Chapter 07 Scripting multimedia system clear summonsSCRIPTING MULTIMEDIA WEB PAGESLEARNING OUTCOMEUpon the completion of this chapter you should be adequate to(p) toUnderstand assorted scripting manners used for web page designing.Know the different types of computer programming linguistic dialogues.Know the OOP paradigm and coffee tree bulk.Know OOP paradigm and slangUnderstand the deep brown 3D theoretical account.Know the assorted multimedia initializes.7.1 Scripting multimedia web pages multimedia system would be lifeless with come step to the fore scripting. Multimedia becomes synergistic when scripting is added to it. The inter run characteristics such as doing a bill of f be release, alteration of coloration on axial rotation over of slip, mannequin filling on a web page and compilation and directing that breeding to another topographic train opening a new web browser window when choosing a hyperlink triping a new installment when an externalize of sp eech is appointed or even doing simple games.7.1.1 Types of programing linguistic confabulationsMachine computer code is the closely basic type of scheduling.Machine codification is only when iodin typeIt is composed but of the two binary figures 0 and 1.Interpretation of the machine codification depends on the hardw atomic number 18 running in the cipher machine.Programing linguistic communications ar of m either types. The most of import linguistic communications arall-purpose scheduling linguistic communicationScripting scheduling linguistic communication object glass-oriented scheduling linguistic communication public-purpose scheduling linguistic communications involve coffee tree, C and C++ . These linguistic communications ar to be compiled by a compiler plan. A compiler is a plan which translates beginning codification written in a peculiar scheduling linguistic communication into computer-readable machine codification that can be executed on its ain. javaScrip t, Flash ActionScript and camber come under Scripting linguistic communications n eertheless it uses Object-oriented linguistic communication every bit good.General characteristics of scripting linguistic communications atomic number 18Easy to larn and utilizeNeed non be compiledBy and large interpreted at run-timeAssociated with a diverse scope of bing computing machine constituentsAble to pass on with other scheduling and scripting linguistic communications.7.1.2 canonical obtain constructionsPrograming linguistic communications have prevail constructions that direct the combine of information. The three basic control constructions atomic number 18sequencechoicerepeatConsecutive control constructionThe stairss from start to exonerate atomic number 18 peremptoryly carried out one afterward another, without whatsoever break.Selection control constructionThese are rehearsals where a true/false pick is made.The if statementIf the side is true, so a indisputable actio n or actions can 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 action or actions can be triggered if false, so a certain action or actions can be triggered.Repetition control constructionThese are statements that are often acted upon while a peculiar status remains true. While the status is true, the take actions will be carried out. Equally shortly as the needed status is false, so the cringle will be ignored. It is of import to observe that there must ever be some manner to do a status false.The basic control constructions can anyways work in concert in a sequence or nested within each other to sooner complex statements.7.1.3 The OOP paradigmThe scripting languages belong to a set prefigureed Object Orientated schedule, or OOP that incorporates patois, ActionScript and chocolateScript. OOP breaks the sequence of stairss from top to tin into separate par ts called fair game lenss that interact with each other in a non-linear manner.OOP is based on class scripting information into categories. From a category, multiple cases can be made and used. These cases are referred to as objects. Each object has propertys and methods. These programming objects are same as existent humans objects. completely the objects such as frames, movieClips, films, fling phalluss, buttons, text Fieldss, etc. are merely objects made with codification. They are seeable because they have belongingss such as size of it, colour, place, etc. and the user can utilize them as they have methods such as drama, halt, edit, etc.Puting up for codification deep brownScript, ActionScript and Lingo have different scripting environments. coffee berryScript is by and large bound to net pages.ActionScript is inside the frames of a timeline and on objects such as buttons and movieClips.Lingo is like ActionScript, but has different types of books depending on where it is used.Event animal trainersAn event occurs when the mouse is moved or the mouse button is clicked, a key is pressed or a web page is loaded. It is a individual happening though it may be repeated many times a second, such as enterFrame in ActionScript and Lingo.The animal trainer is the piece of codification that every book linguistic communication contains to observe the events. Some event animal trainers are common to chocolateScript, ActionScript and Lingo, and some are specific 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 between the book ticket is carried out when loaded into the browser.In ActionScript, any codification that is right added to an single frame in any timeline will be executed when the playhead enters that frame.In Lingo, codification must be with in a n event animal trainer.7.1.4 OOP and JavaScriptAll the scripting linguistic communications have scorn and user specify objects. Default objects are built in the scripting linguistic communication and User defined objects are 1s that are made by you. In scripting linguistic communications like JavaScript, you can break 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. star of the most critical belongingss is calling single object cases. In JavaScript, the bring out property is added to the HTML elements ticket. For illustration, to call the signifier loginForm in an HTML use the undermentioned codification& lt signifier name= loginForm & gt Objects in JavaScript are called the Document Object Model ( DOM ) . DOM is a hierarchy of objects that are contained in each HTML page. These objects are chiefly categorized into three types Window object, paper 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 firmament for loginTo entree the text in a text discipline i.e username dictated in a signifier called loginForm on a web pagedocument.loginForm.userName. revalue ( read this from right to unexpended )Here the scripting statement entree the value 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 importation of this statement is text threading value.Properties and methods in JavaScriptPropertiesProperties are by and large linked to the physical visual feeling of scripting objects. In existent life, objects besides have belongingss. Some belongingss of object are read-only, that is the belongings s value can be retrieved but can non b e changed. Other object belongingss can be retrieved and changed. These characteristics are referred to as proving or puting a belongings s value.Example 1 declare structure JavaScript proving a video s width belongingsdocument.greenHondaCRX.widthIn this illustration, the scripting statement entree the value of the width belongings of the externalise object called greenHondaCR , that is in web page s papers object.Example2 judgment of conviction 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. realistic life objects can besides cast off methods/actions. Methods require excess information for the object to transport out the action right. In scripting linguistic communi cations this excess information is referred to as a methods parametric quantities or statements.Example 3 sentence structure JavaScript utilizing the taradiddle objecthistory.go ( -1 )In this illustration, the scripting statement is utilizing the go method of the history object. Methods are typically recognized by the usage of brackets ( ) after the methods name. The brackets are used to envelop any parametric quantities that you send to the method. In the above 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 arrange and enter an case name in the Properties panel. This is same as appellative variables.ActionScript uses aim waies to maintain mode of object cases. These waies are laid out like a route part 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- single file by snaping the insert loot way button situated in the ActionScript Panel.Let us take an illustration Target way channel 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 mark way button.The Insert Target Path duologue box opens and shows a ocular representation of the road map of objects presently accessible from the timeline that we are in.In the Insert Target Path duologue box, choice Dots and absolute options.Click the little plus gestural + following to the movieClip icon name loginClip to demo 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 stream 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 native-bornly 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 alone 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 fairy s figure.Sprite Number ExampleIn Director, everything that is on the phase goes into a channel in the mark. Merely one fairy can meddling a channel.For illustration the fairy s figure is four, the sentence structure to entree the width belongings of this fairy would befairy ( 4 ) .widthorthe breadth of sprite 4Lingo has two types of sentence structure The first codification sample uses dot sentence structure, which is in broad usage now. The 2nd illustration is what Lingo calls verbose sentence structure. Almost any Lingo statement can be written with either dot sentence structure or verbose.In the first dot phrase structure illustration, the scripting statement is a iming the fairy object that is in channel four of the mark and accessing its width belongings. To Lingo, this whole 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 form 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 codification, the sentence structure for aiming cast member objects can be written in two dot and verbose sentence structure.In the first dot sentence structure, t he 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 cheque 7.11. If more than 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 do 3D artworks. Java 3D is a scene graph-based 3D application programming interface ( API ) for the Java platform. It runs on top of either OpenGL or Direct3D.Advantages of Java 3DPlatform MugwumpIt is platform indie as it is an API character of Java.Object-oriented 3D ArtworksIt is carried out by utilizing a scene graph-based 3D artworks theoretical account.Optimized strongholdDuring runtime, the scene graph of the fastest possible renders is optimized by utilizing the rendition capableness spots. T his facilitates the Java 3D to be used in synergistic artworks environments every bit good as high quality artworks. countermand of 3D stevedoresFree handiness of Java 3D VRML97 file stevedore and browser, with their codifications.Support Exotic DevicessThe com.sun.j3d.utils.trackers software package provides Fake infinite, Logitech, and Polhemus devices.Disadvantages of Java 3DStandard 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 inside informationsJava 3D a high story API, deliberately hides inside informations of the rendering grapevine from the developer therefore doing it ill-sorted for applications where such inside informations are require d.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 blend good when placed together in one object or window.7.2.1 Key differences between Java 3D and VRMLProgram attack In making 3D universes, VRML adopts a content-centric attack and Java 3D adopts a program-centric attack.FlexibilityJava 3D is more lissome in footings of programming manner and the maps available. The better figure of available maps makes Java 3D a better tool in making specific and modified behaviour and applications. Java 3D provides extended game for behaviours, interpolators, niping and hit sensing.Application complexnessVRML is more suited 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 fa ster 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 matter-of-fact 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 immediate manners renderingIncludes hardware-accelerated JOGL, OpenGL and Direct3D renderers ( depending on platform )Platform independentNative support for head-mounted showCAVE ( multiple screen projectors )3D spatial soundcomplicated virtual-reality-based position theoretical accoun t 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. constitute out the advantages and disadvantages of java3D7.3 Multimedia FormatsMultimedia elements like sound or returns are stored in media files. Detect 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 spotted as.css. Image formats are identified by extensions like.gif and.jpg.Windows Multimedia FormatsWindows media files have the extensions like.asf, .asx, .wma, and.wmv. travel swarming Format ( ASF )ASF is peculiarly designed to run over the Internet. ASF files include audio, reckon, parachute shows, and synchronised events. These files should be good compressed and are delivered a s 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 near files used to depict multimedia content. These are field text filesWindows Media sound Format ( WMA )WMA format is developed by Microsoft to manage all types of audio content. mistakable to ASF arrange these files too 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 characterization Format ( WMV )WMV format is developed by Microsoft to manage all types of picture content. Similar to ASF arrange 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 ( pr ove )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 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 frequently 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 communications such as General-purpose scheduling linguistic communication, Scripting programming linguistic communication and Object-oriented scheduling linguistic communication.In this chapter you hav e 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 redbird 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 Redirector FormatMentionDavid Miller ( 1996 ) Web multimedia development pages 649 ISBN1562056832, 9781562056834Timothy Paul Garrand ( 2001 ) Writing for multimedia and the web Pages 341 IS BN0240803817, 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/False Questions1. Machine codification is composed merely of the two binary figures 0 and 1. ( TRUE/ imitation )2. Multimedia would be lifeless without scripting. ( TRUE/ wild )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 happen 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 progra mming 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 ) None of the above3. The OOP stands forA ) Object Operating ProgramingB ) Original Orientated ProgrammingC ) Object Orientated ProgrammingD ) Object Orientated Patch4. 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 depict multimedia content.A ) WMAB ) WMVC ) ASXD ) All the aboveChapter 7 Answers ( True/False Questions )1. T 2. tetraiodothyronine3. F 4. Thymine5. F 6. F7. T 8. Thymine9. F 10. ThymineAnswer ( Multiple Choice Questions )1. D 2. Angstrom3. C 4. C5. B 6. Bacillus7. A 8. Angstrom9. D 10. C

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.