{"id":1231,"date":"2011-01-19T22:02:40","date_gmt":"2011-01-20T03:02:40","guid":{"rendered":"http:\/\/www.lonhosford.com\/lonblog\/?p=1231"},"modified":"2015-07-31T18:25:51","modified_gmt":"2015-07-31T23:25:51","slug":"flvplayback-component-in-a-flash-builder-4-actionscript-project","status":"publish","type":"post","link":"https:\/\/www.lonhosford.com\/lonblog\/2011\/01\/19\/flvplayback-component-in-a-flash-builder-4-actionscript-project\/","title":{"rendered":"FLVPlayback Component in a Flash Builder 4 Actionscript Project"},"content":{"rendered":"<p>This is an example of how to include the Flash CS5 Actionscript 3 FLVPlayback component in a Flash Builder 4 Actionscript project. <img loading=\"lazy\" decoding=\"async\" class=\"alignleft\" src=\"http:\/\/lh5.ggpht.com\/_e5pwU0LJbN8\/TTeeXBUhJiI\/AAAAAAAAFxw\/9C9c7O64eT4\/s800\/FlashBuilder4VideoPlayer_published.png\" alt=\"\" width=\"400\" height=\"305\" \/>I used Mark Walters&#8217;s <a href=\"http:\/\/yourpalmark.com\/2008\/04\/30\/flvplayback-directly-in-flex\/\" target=\"_blank\">FLVPlayback directly in Flex<\/a> article to understand how to get the FLVPlaybackAS3.swc file needed and the rest was very similar to doing this in Flash CS5. <\/p>\n<p>In locating the FLVPlaybackAS3.swc I was on a Mac and just used Finder to locate the files with &#8220;FLVPlaybackAS&#8221; as my search string. <\/p>\n<p>You need include the FLVPlaybackAS swc in your project. Create a folder in your project and then in the project properties include the folder in the Actionscript Build Path under Library Path. I like to call this folder libs.<\/p>\n<p>You need to get a skin SWF file for the FLVPlayer. The easiest method is to create a Flash CS5 document and add the FLVPlayer component. Then include your video and select the skin in the component properties. Then publish. You will see the SWF file for the skin for example SkinOverAll.swf is one possible from CS5. <\/p>\n<p><strong>Downloads<\/strong><\/p>\n<ul style=\"padding-top: 10px;\">\n<li><a href=\"https:\/\/www.lonhosford.com\/content\/flex\/flvplayer\/FLVPlayBackEx01.zip\" onClick=\"javascript: pageTracker._trackPageview('\/downloads\/flvplayer\/FLVPlayBackEx01.zip'); \">Flex Builder Actionscript Project<\/a><\/li>\n<\/ul>\n<p>[ad name=&#8221;Google Adsense&#8221;]<br \/>\n<strong>Application Class &#8211; FLVPlayerEx01<\/strong><br \/>\nYou need to add your Flash video FLV file on line 19 and the FLVPlayer skin SWF file on line 21. These could be in the debug-bin folder or another project level folder. This all depends on where you plan to keep these files in relation to the published swf.<\/p>\n<pre class=\"brush: as3; title: ; wrap-lines: false; notranslate\" title=\"\">\r\npackage\r\n{\r\n\timport fl.video.FLVPlayback;\r\n\timport fl.video.VideoScaleMode;\r\n\timport flash.display.Sprite;\r\n\t&#x5B;SWF (width=640, height=450, backgroundColor=0xeeeeee, frameRate=24)]\r\n\t\/**\r\n\t * Starter application class demonstration loading the FLVPlayer Component.\r\n\t * *\/\r\n\tpublic class FLVPlayBackEx01 extends Sprite\r\n\t{\r\n\t\tprivate var flashVars:Object;\r\n\t\tpublic function FLVPlayBackEx01()\r\n\t\t{\r\n\t\t\tvar videoPlayer:FLVPlayback = new FLVPlayback();\r\n\t\t\tvideoPlayer.width = 640;\r\n\t\t\tvideoPlayer.height = 450;\r\n\t\t\taddChild( videoPlayer );\r\n\t\t\tvideoPlayer.play( &quot;YOUR_FLV_FILE_NAME_HERE&quot; );\r\n\t\t\tvideoPlayer.scaleMode = VideoScaleMode.MAINTAIN_ASPECT_RATIO;\r\n\t\t\tvideoPlayer.skin = &quot;YOUR_SKIN_SWF_FILE_NAME_HERE&quot;;\r\n\t\t\tvideoPlayer.skinAutoHide = true;\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<div id=\"fb-root\"><\/div>\n<p><script src=\"https:\/\/connect.facebook.net\/en_US\/all.js#appId=105467682877384&amp;xfbml=1\"><\/script><fb:like href=\"https:\/\/www.lonhosford.com\/lonblog\/2011\/01\/19\/flvplayback-component-in-a-flash-builder-4-actionscript-project\/\" send=\"true\" width=\"450\" show_faces=\"true\" font=\"\"><\/fb:like><\/p>\n<div id=\"fb-root\"><\/div>\n<p><script src=\"https:\/\/connect.facebook.net\/en_US\/all.js#xfbml=1\"><\/script><fb:comments href=\"https:\/\/www.lonhosford.com\/lonblog\/2011\/01\/19\/flvplayback-component-in-a-flash-builder-4-actionscript-project\/\" num_posts=\"2\" width=\"500\"><\/fb:comments><br \/>\n[ad name=&#8221;Google Adsense&#8221;]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is an example of how to include the Flash CS5 Actionscript 3 FLVPlayback component in a Flash Builder 4 Actionscript project. I used Mark Walters&#8217;s FLVPlayback directly in Flex article to understand how to get the FLVPlaybackAS3.swc file needed and the rest was very similar to doing this in Flash CS5. In locating the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[19,3],"class_list":["post-1231","post","type-post","status-publish","format-standard","hentry","category-general","tag-actionscript","tag-adobe-flash"],"_links":{"self":[{"href":"https:\/\/www.lonhosford.com\/lonblog\/wp-json\/wp\/v2\/posts\/1231","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.lonhosford.com\/lonblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lonhosford.com\/lonblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lonhosford.com\/lonblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lonhosford.com\/lonblog\/wp-json\/wp\/v2\/comments?post=1231"}],"version-history":[{"count":18,"href":"https:\/\/www.lonhosford.com\/lonblog\/wp-json\/wp\/v2\/posts\/1231\/revisions"}],"predecessor-version":[{"id":3691,"href":"https:\/\/www.lonhosford.com\/lonblog\/wp-json\/wp\/v2\/posts\/1231\/revisions\/3691"}],"wp:attachment":[{"href":"https:\/\/www.lonhosford.com\/lonblog\/wp-json\/wp\/v2\/media?parent=1231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lonhosford.com\/lonblog\/wp-json\/wp\/v2\/categories?post=1231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lonhosford.com\/lonblog\/wp-json\/wp\/v2\/tags?post=1231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}