<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>JActionScripters &#187; bA</title>
	<atom:link href="http://blog.jactionscripters.com/author/ba/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jactionscripters.com</link>
	<description>More than 20 Japanese flash coders share the blog/ You will be junkie for this crazy Japanese Flash news</description>
	<lastBuildDate>Sun, 20 Jun 2010 10:03:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Jikkyo Generator and Youtube API</title>
		<link>http://blog.jactionscripters.com/2009/06/25/jikkyo-generator-and-youtube-api/</link>
		<comments>http://blog.jactionscripters.com/2009/06/25/jikkyo-generator-and-youtube-api/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 07:33:19 +0000</pubDate>
		<dc:creator>bA</dc:creator>
				<category><![CDATA[Showcase]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Download]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=741</guid>
		<description><![CDATA[
Hi, my name is Yasuhiko Nishimura and I am an interactive designer at Business Architects.
The Jikkyo Generator 2010 website build by us went live in May. 
The previous  version Jikkyo Generator 2008 was integrated with eyeVio for the videos but to enable more users to enjoy the website the new release features integration with [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.jactionscripters.com/wp-content/uploads/2009/06/capture.png" alt="Jikkyo Generator 2010" title="Jikkyo Generator 2010" width="640" height="396" class="alignnone size-full wp-image-742" /></p>
<p>Hi, my name is <a href="http://twitter.com/yasnis">Yasuhiko Nishimura</a> and I am an interactive designer at <a href="http://www.b-architects.com/">Business Architects</a>.<br />
The <a href="http://www.projectblue.sony.jp/jikkyo/">Jikkyo Generator 2010</a> website build by us went live in May. </p>
<p>The previous  version Jikkyo Generator 2008 was integrated with <a href="http://eyevio.jp/">eyeVio</a> for the videos but to enable more users to enjoy the website the new release features integration with <a href="http:///www.youtube.com/">YouTube</a>. </p>
<p>In this entry I will explain a bit more about the integration with the YouTube API.<br />
(This entry will be about AS2)</p>
<p><span id="more-741"></span></p>
<p><strong>0.Prepare to use the YouTube API.</strong></p>
<p>YouTube allows the use of the Data API or the Player API, however for a full Flash based site like this one you need to use the <a href="http://code.google.com/intl/en/apis/youtube/flash_api_reference.html">chromeless player</a> which allows you to create your own player. Also you need to have developer key to use the YouTube API.<br />
To get your developer key register at the following url: <a href="http://code.google.com/apis/youtube/dashboard/">http://code.google.com/apis/youtube/dashboard/</a></p>
<p><strong>1.Classes to use</strong></p>
<p>Source Code: <a href="http://www.b-architects.com/lab/YTPlayer_sample.zip">download from here</a>.<br />
(The sources comments are written in Japanese language)</p>
<p>The following 3 classes are used.</p>
<dl style="padding-left:2em;">
<dt><span style="font-family:monospace;color:#000;">com.b_architects.lab.youtube.YTPlayer</span></dt>
<dd style="text-indent:2em;">This class load the chromeless player.</dd>
<dt><span style="font-family:monospace;color:#000;">com.b_architects.lab.youtube.YTData</span></dt>
<dd style="text-indent:2em;">This class receives and manages the information abou the video from the Data API</dd>
<dt><span style="font-family:monospace;color:#000;">com.b_architects.lab.youtube.YTConstant</span></dt>
<dd style="text-indent:2em;">This contants class holds the developer key and other YouTube related  parameters.</dd>
</dl>
<p></p>
<p>Inside the <span style="font-family:monospace;color:#000;">YTConstant.as</span> the following need to be registered<br />
<span style="font-family:monospace;color:#000;">PRODUCT_NAME,CLIENT_ID,DEVELOPER_KEY</span><br />
(You can also initialize these at execution time without rewriting the sourcecode)</p>
<p><strong>2.Create and initialize the player</strong></p>
<p>To create a player execute the following command:</p>
<p><code-style>
<pre name="code" class="as3">
    YTPlayer.getPlayer(target:MovieClip);
</pre>
<p></code-style></p>
<p><span style="font-family:monospace;color:#000;">target</span> here is the <span style="font-family:monospace;color:#000;">MovieClip</span> instance which creates the player. First create an empty <span style="font-family:monospace;color:#000;">MovieClip</span> instance and the replace the <span style="font-family:monospace;color:#000;">__proto__</span> property with <span style="font-family:monospace;color:#000;">YTPlayer.prototype</span>. By doing so, you create an instance of the <span style="font-family:monospace;color:#000;">YTPlayer</span> from script without having to create linkage from the library. (You can also do this by setting up a linkage to the <span style="font-family:monospace;color:#000;">MovieClip</span> symbol from the library) </p>
<p>The <span style="font-family:monospace;color:#000;">YTPlayer</span> is embedding the chromeless player from the YouTube servers and might take some time to load.<br />
Once the player is loaded and ready to be used the <span style="font-family:monospace;color:#000;">YTPlayer.EVENT_PLAYER_READY</span> event is issued.</p>
<p>the actual code look like:</p>
<p><code-style>
<pre name="code" class="as3">
    import com.b_architects.lab.youtube.YTPlayer;
    var player:YTPlayer = YTPlayer.getPlayer(this);
    player.addEventListener(YTPlayer.EVENT_PLAYER_READY,onPlayerReady);
    function onPlayerReady(e:Object) {
        //The process for once the initialization is finished
    }
</pre>
<p></code-style></p>
<p>and the player is ready.</p>
<p><strong>3. Control and playback the video</strong></p>
<p>To playback the video execute the following code:</p>
<p><code-style>
<pre name="code" class="as3">
    player.loadVideoById("2L0nGWDPt6A");
</pre>
<p></code-style><br />
this exectution load the video based on the ID passed on the the <span style="font-family:monospace;color:#000;">loadVideoById</span>.</p>
<p>For other video controls reference the following url: <a href="http://code.google.com/intl/en/apis/youtube/flash_api_reference.html#Operations">http://code.google.com/intl/en/apis/youtube/flash_api_reference.html#Operations</a></p>
<p>The <span style="font-family:monospace;color:#000;">YTPlayer</span> implements the chromeless player's methods under the same method name.</p>
<p><strong>4. Load Youtube data</strong></p>
<p>By using the <span style="font-family:monospace;color:#000;">YTData</span> class you can check wether the video for that ID exists, if you can use the API or not, thumbnail path and other usefull information for creating the site. When passing the ID with the String to the constructor the data gets initialized. Once the initialization is done the <span style="font-family:monospace;color:#000;">YTData.VIDEO_CHECK</span> event is issued.</p>
<p>The basic usage is:<br />
<code-style>
<pre name="code" class="as3">
    import com.b_architects.lab.youtube.YTData;
    var data:YTData = new YTData("http://www.youtube.com/watch?v=2L0nGWDPt6A");
    data.addEventListener(YTData.VIDEO_CHECK,onChecked);
    function onChecked(e:Object):Void {
        trace(e.target.id);
    }
</pre>
<p></code-style></p>
<p><strong>5. Conclusion</strong></p>
<p>As stated above this is a general overview on how to use the YouTube API.<br />
The Jikkyo Generator website uses the concepts stated above as its core and has additional features such as playback control, adding narations and other playback functions. The YouTube API has been altered over the years and it can easily change again soon.<br />
When that change occures hopefully changes required on the website will be minimal because the API part stands alone from the website. </p>
<p>Although creating what we have created is not difficult it can be cumbersome and I hope by sharing this information it might benefit others.<br />
If you have a chance, try this out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/06/25/jikkyo-generator-and-youtube-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Introduction of Business Architects Inc.</title>
		<link>http://blog.jactionscripters.com/2009/05/16/introduction-of-ba/</link>
		<comments>http://blog.jactionscripters.com/2009/05/16/introduction-of-ba/#comments</comments>
		<pubDate>Fri, 15 May 2009 17:01:10 +0000</pubDate>
		<dc:creator>bA</dc:creator>
				<category><![CDATA[Hello]]></category>

		<guid isPermaLink="false">http://blog.jactionscripters.com/?p=90</guid>
		<description><![CDATA[Business Architects (called &#8220;bA&#8221;) is a leader in interactive communications. We strengthen our clients’ brands by creating online experiences that go beyond user expectations.
We are fortunate to have some of Japan’s most powerful global brands come to us for long-term relationships. By bringing new technology into established companies that wish to rejuvenate their business, we [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.b-architects.com/" target="_blank">Business Architects</a> (called &#8220;bA&#8221;) is a leader in interactive communications. We strengthen our clients’ brands by creating online experiences that go beyond user expectations.</p>
<p>We are fortunate to have some of Japan’s most powerful global brands come to us for long-term relationships. By bringing new technology into established companies that wish to rejuvenate their business, we help to strengthen their brand value.</p>
<p>Our specialties: Online Branding, Interactive Content Creation, User Interface Design,  Web Standards Design, Rich Internet Applications, Strategic Consulting, Web Globalization</p>
<p>Twitter is here: <a href="http://twitter.com/bArchitects" target="_blank">@bArchitects</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jactionscripters.com/2009/05/16/introduction-of-ba/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
