<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-22686038</id><updated>2012-02-10T18:41:32.277-08:00</updated><category term='Actionscript2'/><category term='Flex'/><category term='media'/><title type='text'>blog.yehiashouman.com</title><subtitle type='html'>Flash Platform Selected Topics</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.yehiashouman.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22686038/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://blog.yehiashouman.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Yehia Shouman</name><uri>http://www.blogger.com/profile/18011995273011630750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-22686038.post-2741417568632246334</id><published>2010-05-22T13:02:00.000-07:00</published><updated>2010-05-24T21:51:14.045-07:00</updated><title type='text'>Adobe Tour 2010</title><content type='html'>Today was just a GREAT saturday! I had the honor to give a session at The Arab Academy for Sciences and Technology (AAST) on Adobe Flash Video Evolution. The session was one of seven sessions given under the Adobe Tour - www.adobetour.com (An Adobe User Group Initiative)&lt;br /&gt;&lt;br /&gt;The session was basically tackling how the web evolution has actually reflected upon the Flash/Media evolution on the web. And how online video experiences inherited traits of Web 2.0 and 3.0 to look the way they look today. Telling us a little about the future as well. &lt;br /&gt;&lt;br /&gt;I would like to thank Ahmed Rabieh for pushing me to actually get on the Adobe User Group ship, and thank the organizers of the event for taking care of us and the attendees for being engaged and keeping that enthusiastic atmosphere.&amp;nbsp;I would love to definitely thank the love of my life for her continuous support.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Here's a slide show of my presentation ...&lt;br /&gt;&lt;br /&gt;&lt;iframe src="http://docs.google.com/present/view?id=dck87tn8_38cp6mq3fv&amp;amp;interval=60&amp;amp;autoStart=true" style="height: 520px; width: 640px;"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22686038-2741417568632246334?l=blog.yehiashouman.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.yehiashouman.com/feeds/2741417568632246334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22686038&amp;postID=2741417568632246334' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22686038/posts/default/2741417568632246334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22686038/posts/default/2741417568632246334'/><link rel='alternate' type='text/html' href='http://blog.yehiashouman.com/2010/05/adobe-tour-2010.html' title='Adobe Tour 2010'/><author><name>Yehia Shouman</name><uri>http://www.blogger.com/profile/18011995273011630750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22686038.post-4817099384760196573</id><published>2009-09-19T20:58:00.000-07:00</published><updated>2009-09-20T16:20:53.765-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Flex'/><title type='text'>Moving To Flex: Tooltip on a SimpleButton</title><content type='html'>Gone are the days of spending hours on building components in Flash. I agree that Adobe Flex, will make me Laaaaazy! The reason behind that is that Flex unlike Flash is made for that very reason, to speed up the development time. The best friend of your company's top management it would be! I secretly enjoyed that geek-satisfaction you get when you build your own very-primitive components in Flash, like a List! I never liked that of Flash. I always ended up building my own, skinnable and much lighter during the days of keep your Flash movie at 100k file size. Having recently moved to Flex, I thought I would forever loose that satisfactory moment of a developer's glory. Well, I was wrong! Flex gives you the speed, control and flexibility all in a single pack!&lt;br /&gt;&lt;br /&gt;On a project I am currently working on, I needed to build my own custom Button that when you roll over would display a tool tip. I used SimpleButton to build my button. But sadly, since SimpleButton does not have a toolTip property it felt a bit awkward. After some Google.getResults("SimpleButton toolTip").length==null, I came to this &lt;a href="http://blog.flexexamples.com/2007/09/03/controlling-a-flex-tool-tips-show-delay-hide-delay-and-scrub-delay/#comment-944"&gt;post&lt;/a&gt; by&amp;nbsp;&lt;span style="color: #111111; font-family: Georgia, 'Times New Roman', Times, serif; font-size: 14px; line-height: 22px;"&gt;Peter deHaan. I learned that I can dynamically create a tool tip and destroy it. I faced an additional issue with the positioning of the toolTip that I created.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #111111; font-family: Georgia, 'Times New Roman', Times, serif; font-size: medium;"&gt;&lt;span style="font-size: 14px; line-height: 22px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #111111; font-family: Georgia, 'Times New Roman', Times, serif; font-size: medium;"&gt;&lt;span style="font-size: 14px; line-height: 22px;"&gt;Here's how I handled it:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div class="highlight"&gt;&lt;pre&gt;package com.shouman.ui&lt;br /&gt;{&lt;br /&gt; &lt;span style="color: #008000; font-weight: bold"&gt;import&lt;/span&gt; flash.display.SimpleButton&lt;span style="color: #666666"&gt;;&lt;/span&gt;&lt;br /&gt; &lt;span style="color: #008000; font-weight: bold"&gt;import&lt;/span&gt; flash.events.MouseEvent&lt;span style="color: #666666"&gt;;&lt;/span&gt;&lt;br /&gt; &lt;span style="color: #008000; font-weight: bold"&gt;import&lt;/span&gt; flash.geom.&lt;span style="color: #008000"&gt;Point&lt;/span&gt;&lt;span style="color: #666666"&gt;;&lt;/span&gt;&lt;br /&gt; &lt;span style="color: #008000; font-weight: bold"&gt;import&lt;/span&gt; mx.controls.ToolTip&lt;span style="color: #666666"&gt;;&lt;/span&gt;&lt;br /&gt; &lt;span style="color: #008000; font-weight: bold"&gt;import&lt;/span&gt; mx.managers.ToolTipManager&lt;span style="color: #666666"&gt;;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt; &lt;span style="color: #008000; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;class&lt;/span&gt; Marker &lt;span style="color: #008000; font-weight: bold"&gt;extends&lt;/span&gt; SimpleButton&lt;br /&gt; {&lt;br /&gt;  &lt;br /&gt;  [Embed(source&lt;span style="color: #666666"&gt;=&lt;/span&gt;&lt;span style="color: #BA2121"&gt;&amp;quot;assets/images/Buttons/tagMarkerUp.png&amp;quot;&lt;/span&gt;)]&lt;br /&gt;        [Bindable]&lt;br /&gt;        protected &lt;span style="color: #008000; font-weight: bold"&gt;var&lt;/span&gt; iconUp&lt;span style="color: #666666"&gt;:&lt;/span&gt;Class&lt;span style="color: #666666"&gt;;&lt;/span&gt;&lt;br /&gt;         &lt;br /&gt;        [Embed(source&lt;span style="color: #666666"&gt;=&lt;/span&gt;&lt;span style="color: #BA2121"&gt;&amp;quot;assets/images/Buttons/tagMarkerOver.png&amp;quot;&lt;/span&gt;)]&lt;br /&gt;        [Bindable]&lt;br /&gt;        protected &lt;span style="color: #008000; font-weight: bold"&gt;var&lt;/span&gt; iconOver&lt;span style="color: #666666"&gt;:&lt;/span&gt;Class&lt;span style="color: #666666"&gt;;&lt;/span&gt;&lt;br /&gt;        &lt;br /&gt;  [Embed(source&lt;span style="color: #666666"&gt;=&lt;/span&gt;&lt;span style="color: #BA2121"&gt;&amp;quot;assets/images/Buttons/tagMarkerDown.png&amp;quot;&lt;/span&gt;)]&lt;br /&gt;        [Bindable]&lt;br /&gt;        protected &lt;span style="color: #008000; font-weight: bold"&gt;var&lt;/span&gt; iconDown&lt;span style="color: #666666"&gt;:&lt;/span&gt;Class&lt;span style="color: #666666"&gt;;&lt;/span&gt;&lt;br /&gt;        &lt;br /&gt;  &lt;span style="color: #008000; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;var&lt;/span&gt; info&lt;span style="color: #666666"&gt;:*;&lt;/span&gt;&lt;br /&gt;        &lt;br /&gt;  protected &lt;span style="color: #008000; font-weight: bold"&gt;var&lt;/span&gt; toolTip&lt;span style="color: #666666"&gt;:&lt;/span&gt;ToolTip&lt;br /&gt;&lt;br /&gt;  &lt;span style="color: #008000; font-weight: bold"&gt;public&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;function&lt;/span&gt; TagMarker(ptag)&lt;span style="color: #666666"&gt;:&lt;/span&gt;void&lt;br /&gt;  {&lt;br /&gt;   tag&lt;span style="color: #666666"&gt;=&lt;/span&gt; ptag&lt;span style="color: #666666"&gt;;&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: #008000; font-weight: bold"&gt;super&lt;/span&gt;();&lt;br /&gt;   &lt;span style="color: #008000; font-weight: bold"&gt;this&lt;/span&gt;.overState &lt;span style="color: #666666"&gt;=&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;new&lt;/span&gt; iconOver();&lt;br /&gt;   &lt;span style="color: #008000; font-weight: bold"&gt;this&lt;/span&gt;.upState &lt;span style="color: #666666"&gt;=&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;this&lt;/span&gt;.tag.EVENTTYPE&lt;span style="color: #666666"&gt;!=3?&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;new&lt;/span&gt; iconUp() &lt;span style="color: #666666"&gt;:&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;new&lt;/span&gt; iconUp_B();&lt;br /&gt;   &lt;span style="color: #008000; font-weight: bold"&gt;this&lt;/span&gt;.downState &lt;span style="color: #666666"&gt;=&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;this&lt;/span&gt;.tag.EVENTTYPE&lt;span style="color: #666666"&gt;!=3?&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;new&lt;/span&gt; iconDown() &lt;span style="color: #666666"&gt;:&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;new&lt;/span&gt; iconDown_B();&lt;br /&gt;   &lt;span style="color: #008000; font-weight: bold"&gt;this&lt;/span&gt;.hitTestState &lt;span style="color: #666666"&gt;=&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;new&lt;/span&gt; iconUp();&lt;br /&gt;   &lt;span style="color: #008000; font-weight: bold"&gt;this&lt;/span&gt;.useHandCursor &lt;span style="color: #666666"&gt;=&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;true&lt;/span&gt;&lt;span style="color: #666666"&gt;;&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: #008000; font-weight: bold"&gt;this&lt;/span&gt;.addEventListener(MouseEvent.CLICK&lt;span style="color: #666666"&gt;,&lt;/span&gt;handleClick);&lt;br /&gt;   &lt;br /&gt;   &lt;span style="color: #408080; font-style: italic"&gt;/*All you need to do is handle when the toolTip should show up, &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #408080; font-style: italic"&gt;   and hide with ROLL_OVER and ROLL_OUT events handling*/&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: #008000; font-weight: bold"&gt;this&lt;/span&gt;.addEventListener(MouseEvent.ROLL_OVER&lt;span style="color: #666666"&gt;,&lt;/span&gt;handleOver);&lt;br /&gt;   &lt;span style="color: #008000; font-weight: bold"&gt;this&lt;/span&gt;.addEventListener(MouseEvent.ROLL_OUT&lt;span style="color: #666666"&gt;,&lt;/span&gt;handleOut);&lt;br /&gt;    &lt;br /&gt;  }&lt;br /&gt;  &lt;br /&gt;  &lt;span style="color: #008000; font-weight: bold"&gt;private&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;function&lt;/span&gt; handleClick(e&lt;span style="color: #666666"&gt;:&lt;/span&gt;MouseEvent)&lt;span style="color: #666666"&gt;:&lt;/span&gt;void{&lt;br /&gt;  &lt;br /&gt;   &lt;span style="color: #408080; font-style: italic"&gt;//raising event here...&lt;/span&gt;&lt;br /&gt;  }&lt;br /&gt;  &lt;span style="color: #008000; font-weight: bold"&gt;private&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;function&lt;/span&gt; handleOver(e&lt;span style="color: #666666"&gt;:&lt;/span&gt;MouseEvent)&lt;span style="color: #666666"&gt;:&lt;/span&gt;void{&lt;br /&gt;   &lt;span style="color: #408080; font-style: italic"&gt;//first you need to find the position of the container of the button globally&lt;/span&gt;&lt;br /&gt;   &lt;span style="color: #008000; font-weight: bold"&gt;var&lt;/span&gt; position&lt;span style="color: #666666"&gt;:&lt;/span&gt;&lt;span style="color: #008000"&gt;Point&lt;/span&gt; &lt;span style="color: #666666"&gt;=&lt;/span&gt; localToGlobal(&lt;span style="color: #008000; font-weight: bold"&gt;new&lt;/span&gt; &lt;span style="color: #008000"&gt;Point&lt;/span&gt;(&lt;span style="color: #008000; font-weight: bold"&gt;this&lt;/span&gt;.parent.x&lt;span style="color: #666666"&gt;,&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;this&lt;/span&gt;.parent.y));&lt;br /&gt;   &lt;span style="color: #408080; font-style: italic"&gt;/*&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #408080; font-style: italic"&gt;    *create the tooltip passing the text to display, then 0 for x position and we need to make it higher&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #408080; font-style: italic"&gt;    *than the y position of the container by 20 pixels.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #408080; font-style: italic"&gt;   */&lt;/span&gt;&lt;br /&gt;   toolTip &lt;span style="color: #666666"&gt;=&lt;/span&gt; ToolTipManager.createToolTip(info.TITLE&lt;span style="color: #666666"&gt;,&lt;/span&gt; &lt;span style="color: #666666"&gt;0,&lt;/span&gt; position.y &lt;span style="color: #666666"&gt;-&lt;/span&gt; &lt;span style="color: #666666"&gt;20&lt;/span&gt;) as ToolTip&lt;span style="color: #666666"&gt;;&lt;/span&gt;&lt;br /&gt;   &lt;br /&gt;   &lt;span style="color: #408080; font-style: italic"&gt;/*now you reposition the tooltip at the x of the button (position.x) then center it to the &lt;/span&gt;&lt;br /&gt;&lt;span style="color: #408080; font-style: italic"&gt;    *button (toolTip.width/2)+(this.upState.width/2). Note that I got the toolTip width after i filled&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #408080; font-style: italic"&gt;    *the text on the createToolTip call. I had to move it to the right by half the width of the button&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #408080; font-style: italic"&gt;    *to make sure it is properly centered.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: #408080; font-style: italic"&gt;   */&lt;/span&gt;&lt;br /&gt;   toolTip.x &lt;span style="color: #666666"&gt;=&lt;/span&gt; position.x&lt;span style="color: #666666"&gt;-&lt;/span&gt;(toolTip.width&lt;span style="color: #BB6688"&gt;/2)+(this.upState.width/&lt;/span&gt;&lt;span style="color: #666666"&gt;2&lt;/span&gt;);&lt;br /&gt;   &lt;br /&gt;  }&lt;br /&gt;  &lt;span style="color: #008000; font-weight: bold"&gt;private&lt;/span&gt; &lt;span style="color: #008000; font-weight: bold"&gt;function&lt;/span&gt; handleOut(e&lt;span style="color: #666666"&gt;:&lt;/span&gt;MouseEvent)&lt;span style="color: #666666"&gt;:&lt;/span&gt;void{&lt;br /&gt;  &lt;br /&gt;   &lt;span style="color: #408080; font-style: italic"&gt;//now you can safely destroy the tool tip&lt;/span&gt;&lt;br /&gt;    ToolTipManager.destroyToolTip(toolTip);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Obviously it turned out easy to be done...glad I am coding on Flex!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22686038-4817099384760196573?l=blog.yehiashouman.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.yehiashouman.com/feeds/4817099384760196573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22686038&amp;postID=4817099384760196573' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22686038/posts/default/4817099384760196573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22686038/posts/default/4817099384760196573'/><link rel='alternate' type='text/html' href='http://blog.yehiashouman.com/2009/09/moving-to-flex-tooltip-on-simplebutton.html' title='Moving To Flex: Tooltip on a SimpleButton'/><author><name>Yehia Shouman</name><uri>http://www.blogger.com/profile/18011995273011630750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22686038.post-7304623121970872587</id><published>2009-04-13T22:48:00.000-07:00</published><updated>2009-09-20T16:22:01.149-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='media'/><title type='text'>Online Media 101</title><content type='html'>Having been in the online media industry for quite some time now I thought I'd put together some "media 101" articles.&lt;br /&gt;&lt;br /&gt;The following is a listing of some media jargon. This is quite useful for developers who are looking forward to get their feet in or customers whom would like to get their terms right.&lt;br /&gt;&lt;br /&gt;I will start with some general jargon...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Web TV Internet TV&lt;/span&gt;: refers to a set-top box that makes it possible to view web content on a television screen. &lt;span style="font-weight: bold;"&gt;..&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;IPTV &lt;/span&gt;Closed TV, Orbit, ART, comcast ..etc&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Online TV:&lt;/span&gt;Streamed TV on Video Players.. Online Service (www.Hulu.com)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Media Platform:&lt;/span&gt; Basically a media content management system (Web application) that is focused on media, it could have a player, encoding engine&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Encoding: &lt;/span&gt;Writing your media files in a specific codec, changing parameters that control quality, file size, keyframes&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;DRM:&lt;/span&gt; Digital Rights Management - A mechanism in which the content is digitally signed to prevent insecure access.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;Analog Hole:&lt;/span&gt; The analog hole basically says that anything that can be perceived by human senses (Eventually displayed on screen) can never be secured against unauthorized use - essentially because it can be captured (Whether streamed or progressively downloaded; there is always the software to do the job!). Definitely a killer to DRM investment!&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Video Display Ratios &lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;4:3&lt;/span&gt; - AKA 1.33:1 Width to Height, Standard TV (SDTV) Scale Ratio&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;16:9&lt;/span&gt; - AKA 1.78:1 Width to Height, High Definition TV (HDTV) Scale Ratio - Widescreen TV Ratio (Not equivalent to CINEMA)&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;24:9&lt;/span&gt;  Widescreen&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;2.39:1&lt;/span&gt; Anamorphic/Cinemascope (prior to 1970)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Video Display Jargon &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PillarBox&lt;/span&gt;: 2 black horizontal boxes on left and right appear when a 4:3 video is displayed fitted on a widescreen&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;LetterBox:&lt;/span&gt; 2 black vertical boxes on top and bottom appear when a 16:9 video is displayed fitted on a SDTV normal 4:3 screen&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Video File Types: &lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;FLV&lt;/span&gt; The FLV format is an Adobe file format for storing media content that supports Sorenson Spark, Nellymoser, On2 VP6, and mp3 codecs. It is used to deliver audio and video for playback in Adobe Flash Player, Adobe Media Player, and Adobe AIR.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;F4V&lt;/span&gt; F4V is an Adobe file format for storing media content, based on MPEG-4 Part 12 (ISO/IEC 14496-12), which supports H.264 and HE-AAC codecs. It is used to deliver audio and video for playback in Adobe Flash Player, Adobe Media Player, and Adobe AIR. Supports HD Video&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;MP4&lt;/span&gt; Supports HD Video&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;WMV&lt;/span&gt; Basically for Silverlight and is a MS Technology; Windows Media Video - Limitied to MS Technologies - has DRM though (Good luck with that!)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;MOV&lt;/span&gt;  Quicktime Movie; Runs on all platforms too.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Video Codecs &lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;H.264&lt;/span&gt; H.264 is a standard for video compression. It is also known as MPEG-4 Part 10, or MPEG-4 AVC (for Advanced Video Coding)&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;MPEG-4&lt;/span&gt;  MPEG-4 is a collection of methods defining compression of audio and visual (AV) digital data&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;VP6&lt;/span&gt; Developed by On2&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;VP7&lt;/span&gt; TrueMotion VP7 is a video codec developed by On2 Technologies as a successor to earlier efforts such as VP3, VP5 and TrueMotion VP6.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Content Deployment/Storage:&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;CDN&lt;/span&gt; A content distribution network; content delivery network&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Dedicated Server&lt;/span&gt; A dedicated hosting service, dedicated server, or managed hosting service is a type of Internet hosting where the client leases an entire server .&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Shared Hosting&lt;/span&gt; A shared web hosting service or virtual hosting service or derive host refers to a web hosting service where many websites reside on one web server.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Playback Models: &lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Progressive Download&lt;/span&gt; Also referred as HTTP streaming. Allows user to view or interact with data while the content is being downloaded.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Streaming&lt;/span&gt; A method of "playing" animated/motion picture or audio data received over a network. The transmitted data file is played in real time AS it arrives (bit by bit) at the recipient's end. The opposite of "streaming" is "downloading.". There is RTSP (Realtime Streaming Protocol) and RTMP (Adobe's RealTime Media Protocol)&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Pseudostreaming/HTTP&lt;/span&gt; An HTTP workaround that writes the header of the file on the fly and appends the rest of the file from a parameterized point to allow seeking to time points in a video file still not downloaded.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Monetizing Content:&lt;/span&gt; The media alchemy of converting your media content to money!&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Ads&lt;/span&gt; Comes in many flavors. There are …&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Pre Appears before video&lt;/li&gt;&lt;li&gt;Mid Appears during video playback&lt;/li&gt;&lt;li&gt;Post Appears at the end of a video&lt;/li&gt;&lt;li&gt;Overlays Appears on top of video usually having a close button&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-weight: bold;"&gt;PPV&lt;/span&gt; Pay-per-view. A system by which a viewer can pay and view the programme he wants&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;P2V&lt;/span&gt; Pay-to-View/Pay per minute; a system by which a viewer enters their credit card information and starts viewing and automatic deduction takes place based on viewing minutes&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Download &lt;/span&gt;User can just download the file by paying for it&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Player Controls/Components &lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Play&lt;/span&gt;,&lt;span style="font-weight: bold;"&gt;Pause&lt;/span&gt;,&lt;span style="font-weight: bold;"&gt;FF&lt;/span&gt;,&lt;span style="font-weight: bold;"&gt;RW&lt;/span&gt;, and other playback controls&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Volume Slider&lt;/span&gt; A slider control that controls the volume, draggable (rather than old + and -)&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Progress Bar/Scrubber&lt;/span&gt; A bar that shows progress of video playback (and downloaded so far), it could have a scrub handle&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Scrub Handle&lt;/span&gt; Allows the user by click and drag to seek to points in video (past downloaded area in case of streaming and pseudo-streaming)&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Overlay Plugin&lt;/span&gt; JW Player and other opensource players have developed Plugins like Comments, Ratings …that goes on top of video&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Additional Viewing Interactivity &lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Zoom&lt;/span&gt; Ability to zoom in to video, specially in HD video&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Seek&lt;/span&gt; to point For Streaming, Pseudostreaming only you can seek beyond downloaded time&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Fullscreen&lt;/span&gt; Ability to go fullscreen with Flash Player version 9+&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Ads&lt;/span&gt; Ads as described in this document&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Annotations&lt;/span&gt; Overlaid boxed on top of video with text on them to point out something in the video or as comment (Implemented during 2008 in Youtube)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Captions&lt;/span&gt; Overlaid Text Captions (Subtitles) for different languages/translation&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Panning&lt;/span&gt; Ability to drag video around, usually comes with zooming.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;HD&lt;/span&gt; Provide another version of the file in High definition format&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Adaptive Streaming/Dynamic Bitrate Switching&lt;/span&gt; Ability to change to a different bitrate (quality) based on user's connection to use the most of his connection serving him the best quality affordable.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Multiview&lt;/span&gt; Pick a different camera!, Created by BitGravity (www.bitgravity.com)&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Sharing Methods&lt;/span&gt; Embed, Share to Social Media Network (Facebook ..etc), Copy Link&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Examples of opensource players are&lt;br /&gt;JW Player&lt;br /&gt;http://www.longtailvideo.com/&lt;br /&gt;&lt;br /&gt;FlowPlayer&lt;br /&gt;http://flowplayer.org/&lt;br /&gt;&lt;br /&gt;I personally prefer the JW Player.&lt;br /&gt;&lt;br /&gt;This little dictionary should help you move around knowing what to say/ask for!&lt;br /&gt;&lt;br /&gt;Good luck with the media boom! Don't forget to monetize your knowledge ;)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22686038-7304623121970872587?l=blog.yehiashouman.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.yehiashouman.com/feeds/7304623121970872587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22686038&amp;postID=7304623121970872587' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22686038/posts/default/7304623121970872587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22686038/posts/default/7304623121970872587'/><link rel='alternate' type='text/html' href='http://blog.yehiashouman.com/2009/04/online-media-101.html' title='Online Media 101'/><author><name>Yehia Shouman</name><uri>http://www.blogger.com/profile/18011995273011630750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22686038.post-6081968653053273542</id><published>2007-03-24T03:41:00.001-07:00</published><updated>2009-09-20T16:22:31.696-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Actionscript2'/><category scheme='http://www.blogger.com/atom/ns#' term='media'/><title type='text'>FLV FPS is affected by Flash Document FPS in IE</title><content type='html'>Unlike what Adobe's documentation say that you can have your FLVs play back at a frame rate different than that of the Flash document, last week I came to discover that that was totally misleading! Well, in most of the cases at least !&lt;br /&gt;&lt;br /&gt;I am working on an IPTV project. (Online TV - like Youtube ..etc). and I have been suffering for the past five months to make the application work smoothly as intended no matter how much requirements the client keep adding (which is adding a lot of value to the application as well).&lt;br /&gt;&lt;br /&gt;Here's my findings, it was required to play video clips on the site at 30 fps. NTSC video is 29.97 or 30 FPS. PAL and SECAM video are 25 FPS. Cinema films are 24 FPS. and most of the animated websites you see on the web are from 12-30 FPS.&lt;br /&gt;&lt;br /&gt;Now here's the trick, I followed exactly what Adobe says in their documentation that Flash Document FPS rate does not affect video playback. Well, this is true only on Mozilla Firefox (And not to a big extent though, will discuss that shortly). And this is very wrong on Internet Explorer. I was streaming a 30 FPS video in a Flash document set to 12 FPS, the client kept complaining that he can see dropped frames in the video playback and that it was somehow chunky. I tracked down the FPS rate in a debugging field, and I was shocked to see my 30 FPS video playing at 12 FPS on IE only, and at 30 FPS on Firefox !!!&lt;br /&gt;&lt;br /&gt;After googling and pulling my hair out, I thought of trying to increase the Flash document FPS (Although I trust everything Adobe says about their product in their documentation should be true!) and voila ! The video is playing at 30 FPS in IE. To add more to my surprise and to lessen my happiness, I found out it overloaded Firefox and its playback became chunky !&lt;br /&gt;&lt;br /&gt;It's worth mentioning that I am using Actionscript 2.0, I tried to hack the Flash Player version 9 to set the stage frameRate property but definitely couldn't though I tried:&lt;br /&gt;stage["frameRate"]&lt;br /&gt;&lt;br /&gt;I thought of coming to a rate in between to work for both browsers, but that was a failure ! I had to create 2 SWF versions, one for Firefox (12 FPS) and one for IE (30FPS) and using the a server script I could send back the SWF appropriate to the client's browser.&lt;br /&gt;&lt;br /&gt;I am really surprised why they (Adobe) couldn't add the FPS as an html object parameter tag like background color ! Why embed it in the SWF binary file itself ? But then again, I still love you Adobe ! Glad you added a feature to change FPS using code in AS3.0.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22686038-6081968653053273542?l=blog.yehiashouman.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.yehiashouman.com/feeds/6081968653053273542/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22686038&amp;postID=6081968653053273542' title='22 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22686038/posts/default/6081968653053273542'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22686038/posts/default/6081968653053273542'/><link rel='alternate' type='text/html' href='http://blog.yehiashouman.com/2007/03/flv-fps-is-affected-by-flash-document.html' title='FLV FPS is affected by Flash Document FPS in IE'/><author><name>Yehia Shouman</name><uri>http://www.blogger.com/profile/18011995273011630750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>22</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22686038.post-114200919089011383</id><published>2006-03-10T08:46:00.000-08:00</published><updated>2009-09-20T16:23:16.357-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Actionscript2'/><title type='text'>OOP 101: OOP is about Species - 2/5</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;big&gt;&lt;b&gt;Encapsulation:&lt;/b&gt;&lt;/big&gt;&lt;br /&gt;OOP introduces a better organized way to write your code. You definitely have used variables before and might have had problems with colliding variable names, (e.g. a variable on the root with name "count" and another _global variable called "count"). The great thing about OOP is that you can really give identity to pieces of code. Much more than composing your code in the form of functions. It would rather be better if you can have different "managers" who perform different tasks and who does have their identities as if they were little people here and there knowing what their task is and how they do it AND at the same time they do not care about other's way of performing their tasks. They only know what methods or properties to call others by. This is the concept of encapsulation, typically, a class should know what it does and how it can do it, it knows nothing about the external world, and no body knows about the way it performs its tasks. Much like our early examples, a designer knows everything that goes with design, a developer knows everything that goes with development. They can communicate but with certain limits. A developer/manager asks the designer to make a template, the designer creates the template (they don't necessarily have to know anything about how the template is being done, they just need/know about the output).&lt;br /&gt;&lt;br /&gt;&lt;big&gt;&lt;b&gt;Visibility of methods and variables (properties)&lt;/b&gt;&lt;/big&gt;&lt;br /&gt;We have learned that methods are actions done by instances of a certain class, and that properties give us a chance to give information or get information in or out of that class instance. Typically applying this concept (Encapsulation), we must have recognized now that there are things that the class know about and no body else is interested in it, these things are private to that class instance. And that there are other things that are exposed for others to communicate with that class instance, that are public communication channels, these are public methods and properties.&lt;br /&gt;&lt;br /&gt;So in terms of code examples:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Public Members&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Public methods&lt;/i&gt; could be something like&lt;br /&gt;myClass.getClassName();&lt;br /&gt;myCharacter.smile();&lt;br /&gt;myCharacter.moveTo(x,y);&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Properties&lt;/i&gt; could be like:&lt;br /&gt;myCharacter.xPos&lt;br /&gt;myCharacter.hairColor = 0xFF0000;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Private Members: &lt;/b&gt;&lt;br /&gt;&lt;i&gt;Private Methods&lt;br /&gt;&lt;/i&gt;this.createChildren();&lt;br /&gt;this.drawMyInterface();&lt;br /&gt;this.updateView();&lt;br /&gt;this.createHeader();&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Private Variables&lt;br /&gt;&lt;/i&gt;this._newXPos;&lt;br /&gt;this._label_str;&lt;br /&gt;this._label_txt;&lt;br /&gt;(note that the word "this" implies the call of the method or property from inside the class)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;big&gt;&lt;b&gt;Inheritence&lt;/b&gt;&lt;/big&gt;&lt;br /&gt;Inheritence, is really very useful. Say you have a game (Police officer, thieves and innocent people), and your main character is the police officer inforcing the law in town. Your thieves (Sorry), I mean thieves, are walking around terrorizing the innocent citizens.&lt;br /&gt;In the conventional classic world, you will have to create 3 classes(one for each type). All of which are performing say 50% of the same functionalities. You are doing redundant work (100% extra work), that is, because they both run, walk, have the same human figure (Assuming you are not going to chase alien thieves). Inheritence comes in handy in these situations. You will simple write 1 class with the same functionalities that is common between all your characters, and then write simple derivations of those characters to suite each type. This will I promise you (When you master it) will save you tons of work. Inheritence works like this&lt;br /&gt;&lt;br /&gt;Person Class defines the following common private functions&lt;br /&gt;runTo(x,y)&lt;br /&gt;walkTo(x,y)&lt;br /&gt;CheckIFShot();&lt;br /&gt;ApplySkin(SkinID);&lt;br /&gt;&lt;br /&gt;then,&lt;br /&gt;PoliceOfficer Class extending Person Class will inherit the methods listed above and then you can add specific performance specifically for this class. So PoliceOfficer will have&lt;br /&gt;&lt;font color="#ccffff"&gt;&lt;font color="#999999"&gt;runTo(x,y)&lt;br /&gt;&lt;br /&gt;walkTo(x,y)&lt;br /&gt;&lt;br /&gt;CheckIFShot();&lt;br /&gt;&lt;br /&gt;ApplySkin(SkinID);&lt;/font&gt;&lt;br /&gt;&lt;/font&gt;Shoot(characterID);&lt;br /&gt;Arrest(thiefID);&lt;br /&gt;&lt;br /&gt;and the Thief Class would extend the Person Class as well, so it will have&lt;br /&gt;&lt;font color="#999999"&gt;runTo(x,y)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;walkTo(x,y)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CheckIFShot();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ApplySkin(SkinID);&lt;/font&gt;&lt;br /&gt;&lt;br /&gt;Shoot(characterID);&lt;br /&gt;Rob(citizenID);&lt;br /&gt;Escape();&lt;br /&gt;&lt;br /&gt;Typically a Citizen Class would extend the Person Class as well, so it will have&lt;br /&gt;&lt;br /&gt;&lt;font color="#999999"&gt;runTo(x,y)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;walkTo(x,y)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;CheckIFShot();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ApplySkin(SkinID);&lt;/font&gt;&lt;br /&gt;Escape();&lt;br /&gt;Scream();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note that when you extend a class you don't have to re-write the grey private methods, they are already defined, when you simple use the magical keyword "extends".&lt;br /&gt;&lt;br /&gt;&lt;big&gt;&lt;b&gt;Interfaces&lt;/b&gt;&lt;/big&gt;&lt;br /&gt;is simply a blue print for a new class that classes that wish to perform like intended in that blue print should follow. It's a list of methods all classes should perform in order to comply with the needs of compatibility. This is essential when you have several serious programmers distributed and want to write a few classes that has the same communication channels. E.g.&lt;br /&gt;All the last classes will have to define the following methods as an example:&lt;br /&gt;&lt;br /&gt;&lt;font color="#999999"&gt;/*use the skinID to get a library item and attach&lt;br /&gt;to the instance's skin_mc.(Movieclip)*/&lt;/font&gt;&lt;br /&gt;renderSkin(skinID); &lt;br /&gt;&lt;font color="#999999"&gt;/*a function that will (if called from any character &lt;br /&gt;instance) return a&lt;br /&gt;number 0 to 100 &lt;br /&gt;representing the energy level of the character*/&lt;/font&gt;&lt;br /&gt;getEnergyLevel() &lt;br /&gt;&lt;br /&gt;The constraint that all these classes should implement a specific method is defined in the interface.&lt;br /&gt;&lt;br /&gt;We will move deeper as we continue ...&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22686038-114200919089011383?l=blog.yehiashouman.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.yehiashouman.com/feeds/114200919089011383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22686038&amp;postID=114200919089011383' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22686038/posts/default/114200919089011383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22686038/posts/default/114200919089011383'/><link rel='alternate' type='text/html' href='http://blog.yehiashouman.com/2006/03/oop-101-oop-is-about-species-25.html' title='OOP 101: OOP is about Species - 2/5'/><author><name>Yehia Shouman</name><uri>http://www.blogger.com/profile/18011995273011630750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-22686038.post-114082375448136584</id><published>2006-02-24T15:29:00.000-08:00</published><updated>2009-09-20T16:23:31.147-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Actionscript2'/><title type='text'>OOP 101: Intro - 1/5</title><content type='html'>&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;Intended Audience Level: Beginner&lt;br /&gt;&lt;br /&gt;OOP is simply bringing life practices into programming.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;What is OOP ?&lt;/b&gt;&lt;br /&gt;OOP - Object Oriented Programming. Is grouping different functionalities in your application as job descriptions done by different managers.&lt;br /&gt;&lt;br /&gt;In a typical IT software house you will have a &lt;br /&gt;&lt;br /&gt;Designer: Knows everything about design, is a service provider to all other departments, knows how to draw, knows which colors matches which ones.&lt;br /&gt;Developer: Knows about code, instructions given to PC to perform certain actions. Knows about calculations and processes&lt;br /&gt;Marketing Manager: Knows most about the needs of the market, competitors...etc&lt;br /&gt;&lt;br /&gt;&lt;i&gt;These employees are given tasks to perform that they know how to do in advance.&lt;br /&gt;These employees are directed by a manager&lt;br /&gt;These employees does not know about each other's sub details.&lt;br /&gt;These employees knows best at what they are specified in&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;This model is similar to object oriented programming. Lets see how that would look in a simple application example. In programming, the group of functionalities that are relevant in field can be grouped in a single class, so if we were speaking of the company example above, We would have &lt;br /&gt;&lt;br /&gt;&lt;code&gt;Designer class&lt;br /&gt;Developer class&lt;br /&gt;Marketeer class&lt;br /&gt;ManagingDirector class&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;Let's say we need to create a small game, spaceship fighting alien enemies. we will call it "Space fighter"&lt;br /&gt;&lt;br /&gt;we will typically have a few classes as a start&lt;br /&gt;&lt;code&gt;Spaceship Class&lt;br /&gt;Alienship Class&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;we will add up to these classes functionality as we move on. Just remember those classes names.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;PROPERTIES&lt;br /&gt;&lt;/b&gt;Properties is a very simple concept. A property is the state of a specific feature of a class or a reference to another element the class knows about. Ouch! that was hard to understand ok, Let's apply this to our 2 models, the company model and the "Space fighter" examples.&lt;br /&gt;&lt;br /&gt;For the company model:&lt;br /&gt;&lt;br /&gt;Any employee may have the following properties &lt;br /&gt;&lt;code&gt;&lt;br /&gt;developer.isBusy =true;//a boolean property&lt;br /&gt;&lt;br /&gt;developer.Name ="John Smith";//a string property&lt;br /&gt;developer.skills = ["UML","XML","C#"];//an Array:he is skilled in UML,XML,C#&lt;br /&gt;developer.experience=5; //indicating 5 years of experience - a Number property: &lt;/code&gt;&lt;br /&gt;A designer may have&lt;br /&gt;&lt;code&gt;designer.skills = ["Photoshop","Flash","CSS"];&lt;br /&gt;&lt;/code&gt;Typically more properties can be specific for designer instances (employees of type designer).&lt;br /&gt;&lt;code&gt;designer.isGoodAtPhotoshop = true&lt;br /&gt;designer.isIllustrator=true;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;A manager may have the following property&lt;br /&gt;&lt;code&gt;Manager.isMicroManagerType=false; //all the employees will be happy&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;For the Space Fighter model:&lt;br /&gt;&lt;code&gt;Spaceship.isDead=true; //so decrease the lives by 1 and restart space ship.&lt;br /&gt;Spaceship.lives=3;&lt;br /&gt;Spaceship.energy=50;&lt;br /&gt;Spaceship.shields=true;&lt;br /&gt;Alienship.type="Predator"; //will tell the class to render itself as a predator enemy ship&lt;br /&gt;Alienship.energy=20;&lt;br /&gt;Alienship.x; //x position of the alien ship&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;b&gt;METHODS:&lt;br /&gt;&lt;/b&gt;Methods are simple actions that instances of that type can do/perform.&lt;br /&gt;&lt;br /&gt;For the company model:&lt;br /&gt;&lt;code&gt;designer.draw();&lt;br /&gt;designer.findColorMatch(blueColor); //this method can return white as a color match&lt;br /&gt;developer.writeCode();&lt;br /&gt;developer.debug();&lt;br /&gt;Marketeer.FindCompetitors();&lt;br /&gt;Marketeer.getMarketingPlan();&lt;br /&gt;Manager.control(resource1,resource2,resource3);&lt;br /&gt;Manager.doPresentation(audience1,audience2 ...audienceN);&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;For the Space fighter example:&lt;br /&gt;&lt;code&gt;Spaceship.fireMissleAt(enemyShipID);&lt;br /&gt;Spaceship.glideLeft();&lt;br /&gt;Spaceship.explode();&lt;br /&gt;Spaceship.initialize();&lt;br /&gt;Spaceship.autoDrive();&lt;br /&gt;Alienship.explode();&lt;br /&gt;Alienship.fireMissle();&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Key Differences between Properties and Methods:&lt;/b&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;Naming:&lt;/b&gt; &lt;br /&gt;Methods are always given a verb name, example:&lt;br /&gt;&lt;code&gt;doSomething();&lt;br /&gt;createChildren();&lt;br /&gt;draw();&lt;br /&gt;&lt;/code&gt;Where properties are always given an adjective:&lt;br /&gt;&lt;code&gt; happy = true;&lt;br /&gt;dead = true;&lt;br /&gt;isOK = true;&lt;br /&gt;&lt;/code&gt;&lt;b&gt;Performance:&lt;/b&gt;&lt;br /&gt;Typically, a method performs something, whereas a property says the state of a certain feature of my instance is X.&lt;br /&gt;Similarly in english:&lt;br /&gt;You &lt;i&gt;order&lt;/i&gt; someone to "Sit down" - this is a method you are calling&lt;br /&gt;Whereas properties are information related to that person.&lt;br /&gt;You &lt;i&gt;inform&lt;/i&gt; him with his job description - this is a property setting.&lt;br /&gt;&lt;/blockquote&gt;We will continue with exposing more of the hidden treasures of OOP.&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/22686038-114082375448136584?l=blog.yehiashouman.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.yehiashouman.com/feeds/114082375448136584/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=22686038&amp;postID=114082375448136584' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/22686038/posts/default/114082375448136584'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/22686038/posts/default/114082375448136584'/><link rel='alternate' type='text/html' href='http://blog.yehiashouman.com/2006/02/oop-101-intro-15.html' title='OOP 101: Intro - 1/5'/><author><name>Yehia Shouman</name><uri>http://www.blogger.com/profile/18011995273011630750</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry></feed>
