<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>bute_lab.</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/" />
    <link rel="self" type="application/atom+xml" href="http://www.bute-studio.com/lab/atom.xml" />
    <id>tag:www.bute-studio.com,2008-01-15:/lab/5</id>
    <updated>2010-03-07T00:17:31Z</updated>
    <subtitle>bute_lab.は、FlashのActionscriptやHTML,CSSなど、web制作に関する研究成果を記録するためのブログです。</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Publishing Platform 4.01</generator>

<entry>
    <title>bute-lab.の各記事にretweetボタンを設置 // tweetmeme</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2010/03/bute-tweetmeme.html" />
    <id>tag:www.bute-studio.com,2010:/lab//5.210</id>

    <published>2010-03-06T23:10:40Z</published>
    <updated>2010-03-07T00:17:31Z</updated>

    <summary>最近twitterのAPIを使ったサイトを作っているので、APIを使って自作JS...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="雑記" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="api" label="API" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="javascript" label="Javascript" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="retweet" label="retweet" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tweetmeme" label="tweetmeme" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="twitter" label="twitter" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ヘルプ" label="ヘルプ" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[最近twitterのAPIを使ったサイトを作っているので、APIを使って自作JSやphpでもいいかなと思いましたが、時間もなかったので、<a href="http://tweetmeme.com/" target="_blank">tweetmeme</a>を使ってつけてみました。<br /><a href="http://tweetmeme.com/" target="_blank">http://tweetmeme.com/</a><br /><br />
tweetmemeでは、特に登録とかもいらず、単純にJavascriptを入れたい位置に読み込むだけでボタンが入ります。ただ、標準の場合には、retweet数を表示したりして領域を大きめにとられるので、下のようなパラメーターを渡すことで簡単に小さいものにも出来ます。<br /><br />
<code>
&lt;script type="text/javascript"&gt;<br />tweetmeme_style = 'compact';<br />&lt;/script&gt;<br />&lt;script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"&gt;&lt;/script&gt;
</code>
<br /><br />いろいろいじってみましたが、上のソースを入力し、ひとまず小さくしたのみで落ち着きました。<br />tweetmemeのヘルプページに英語ですがいろいろと説明してあります。
<br /><a href="http://help.tweetmeme.com/2009/04/06/tweetmeme-button/" target="_blank">http://help.tweetmeme.com/2009/04/06/tweetmeme-button/</a>]]>
        
    </content>
</entry>

<entry>
    <title>FirefoxでFlashエリアやaタグ内の点線枠を消す//CSS</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2010/03/firefox-focus.html" />
    <id>tag:www.bute-studio.com,2010:/lab//5.209</id>

    <published>2010-03-04T21:12:07Z</published>
    <updated>2010-03-05T07:13:56Z</updated>

    <summary>Firefox3.5(windows)で、ページ内にswfobjectで貼ったF...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="CSS" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="firefox" label="Firefox" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="flash" label="Flash" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="aタグ" label="aタグ" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="focus" label="focus" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="outline" label="outline" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="swf" label="swf" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="フォーカス" label="フォーカス" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="枠線" label="枠線" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="消し方" label="消し方" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="点線" label="点線" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[Firefox3.5(windows)で、ページ内にswfobjectで貼ったFlashや、aタグでくくった画像にフォーカスがあたったときに点線が出ます。<br />aタグ内はそんなに気になりませんでしたが、Flashでは、どこまでがFlashエリアかが一目瞭然で、いまいちだったので、この枠線の消し方をいろいろ試してみました。<br /><br />下のサンプルはFlashを貼った部分のdivのID名がflashだった場合です。<br />念のため、:focusでないときも入れてみました。<br /><br /><br />
<code>
#content,<br />#content:focus{<br />&nbsp;&nbsp;&nbsp; outline:none;<br />}<br />
</code>
<br /><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>Flash内テキストフィールドにCSSを設定する //AS3.0</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2010/03/flashcss-as30.html" />
    <id>tag:www.bute-studio.com,2010:/lab//5.208</id>

    <published>2010-03-02T21:11:31Z</published>
    <updated>2010-03-03T07:14:19Z</updated>

    <summary>Flash内で使えるCSSはあまり多くはありませんが、基本的なテキストの装飾など...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="AS3" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="CSS" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="css" label="CSS" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="object" label="Object" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="stylesheet" label="StyleSheet" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ahover" label="a:hover" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="color" label="color" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="new" label="new" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="textdecoration" label="text-decoration" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="textdecoration" label="textDecoration" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[Flash内で使えるCSSはあまり多くはありませんが、基本的なテキストの装飾などは簡単につけることが出来ます。<br />下の例では、test_txtの&lt;a&gt;にcolorとマウスオーバー時のtext-decorationを設定します。<br />CSSではtext-decorationですが、ActionScriptで書くときはtextDecorationなので気をつけます。(他にもActionscriptで使う場合に普通のCSSと異なるものがあります)<br /><br /><br />
<code>
import flash.text.StyleSheet;<br /><br />function setStyleSheet(txt){<br />&nbsp;&nbsp; &nbsp;var style:StyleSheet = new StyleSheet();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var main_a:Object = new Object();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; main_a.color = "#ff0000";<br />&nbsp;&nbsp;&nbsp; &nbsp;var main_a_hover:Object = new Object();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; main_a_hover.textDecoration = "underline";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; style.setStyle("a", main_a);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; style.setStyle("a:hover", main_a_hover);&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br />&nbsp;&nbsp; &nbsp;txt.styleSheet = style;<br />}<br />
<br />//上の関数setStyleSheetでスタイルを規定し、あとは引数でtest_txtを投げるだけで反映されます。<br />setStyleSheet(test_txt);</code><br /><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>AIRでのnativeWindowの操作 //AS3.0</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2010/02/airnativewindow-as30.html" />
    <id>tag:www.bute-studio.com,2010:/lab//5.207</id>

    <published>2010-02-15T22:29:02Z</published>
    <updated>2010-02-16T08:32:30Z</updated>

    <summary>AIR制作の時には、Flashと違って、アプリ自体のwindowの操作の制御があ...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="Air" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="air" label="AIR" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="flash" label="Flash" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mouseevent" label="MouseEvent" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="addeventlistener" label="addEventListener" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="close" label="close" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="nativewindow" label="nativeWindow" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="stage" label="stage" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="startmove" label="startMove" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="window" label="window" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[AIR制作の時には、Flashと違って、アプリ自体のwindowの操作の制御があります。<br />最低限必要なのは、ドラッグして移動させることと、終了させることです。<br />これらはnativeWindowを使って制御します。<br /><br />アプリ自体の移動は、<br />
<code>？？？.addEventListener(MouseEvent.MOUSE_DOWN, windowMove);<br />function windowMove(event:MouseEvent):void{ <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stage.nativeWindow.startMove(); <br />} 
</code>
<br /><br /><br />アプリの終了は、<br />
<code>？？？.addEventListener(MouseEvent.MOUSE_DOWN, exitWindow);<br />function exitWindow(event:MouseEvent):void {<br />&nbsp;&nbsp;&nbsp; &nbsp;stage.nativeWindow.close();<br />}
</code><br /><br />だけです。<br />コピペのために保存しておきます。<br />]]>
        
    </content>
</entry>

<entry>
    <title>Safariでaタグのbackgroundの画像が表示されない//CSS</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2010/02/safariabackground-bug.html" />
    <id>tag:www.bute-studio.com,2010:/lab//5.206</id>

    <published>2010-02-09T21:00:19Z</published>
    <updated>2010-02-10T07:03:25Z</updated>

    <summary>下のサンプルのようにCSSを設定したところ、aタグの通常の状態では背景画像が入り...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="CSS" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="firefox" label="Firefox" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ie" label="IE" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="safari" label="Safari" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="_" label="_" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="a" label="a" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="background" label="background" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="charset" label="charset" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="hover" label="hover" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="internetexplorer" label="internetExplorer" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="png" label="png" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="バグ" label="バグ" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ファイル名" label="ファイル名" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ロールオーバー" label="ロールオーバー" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="画像" label="画像" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="規定" label="規定" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[下のサンプルのようにCSSを設定したところ、aタグの通常の状態では背景画像が入りますが、ロールオーバー状態では画像が表示されません。<br />いろいろとググったところ、全角スペースの混入や@charsetを消すなど、どれを試しても相変わらずIEやFirefoxなどは問題ないのに、Safariのみうまくいきませんでした。<br /><br />試しにa:hoverのbackgroundを背景色にすると、ちゃんと規定サイズの12×12pxの正方形に色がつきました。<br /><br />結局は、ロールオーバー用の画像の"_"を一つとって、allow_r1.pngにしたところうまく表示されました。<br /><br />Safariでは"_"の数に規定があるのか、ファイル名の長さに問題があるんでしょうか？それともSafariのバグ?<br />よくわかりませんが、ひとまず解決です。<br /><br />こんなことで小一時間かかりました。<br /><br />
//このサンプルでは、Safariでロールーバー時に画像が表示されません。<br />
<code>a .allow {<br />&nbsp;&nbsp;&nbsp; width: 12px;<br />&nbsp;&nbsp;&nbsp; height: 12px;<br />&nbsp;&nbsp;&nbsp; background:url(../images/allow_r.png);<br />}<br /><br />a:hover .allow {<br />&nbsp;&nbsp;&nbsp; background:url(../images/allow_r_1.png);<br />}
</code><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>テキストをビットマップにする //AS3.0</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2010/02/txt-bitmapdata.html" />
    <id>tag:www.bute-studio.com,2010:/lab//5.205</id>

    <published>2010-02-08T23:20:49Z</published>
    <updated>2010-02-09T09:59:17Z</updated>

    <summary>ダイナミックテキスト(textfield)は、そのままではalphaやrotat...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="AS3" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="bitmap" label="Bitmap" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="bitmapdata" label="BitmapData" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="_txt" label="_txt" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="alpha" label="alpha" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="draw" label="draw" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="rotation" label="rotation" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="textfield" label="textfield" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ダイナミックテキスト" label="ダイナミックテキスト" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="テキスト" label="テキスト" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="回転" label="回転" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="角度" label="角度" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="透明度" label="透明度" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[ダイナミックテキスト(textfield)は、そのままではalphaやrotationなどが変えることが出来ません。<br />というよりも、変えると、パッと消えてくれます。<br /><br />そこで、TextをBitmapにdrawしてしまい、textfield自体は消しておけば、あたかもそれらのalphaやrotationが変えられたような表現が出来ます。<br /><br /><br />
<code>
//BitmapDataを新規生成して、bitmapにdrawする<br />//今回はtest_txtをBitmapにします<br />var myBitmap:BitmapData = new BitmapData(600, 150,true,0x333333);<br />myBitmap.draw(test_txt);<br />var bmp:Bitmap = new Bitmap(myBitmap);<br />bmp.x = 100;<br />tmp_mc.addChild(bmp);<br />tmp_mc.alpha = 0;<br />test_txt.visible = false; 
</code>
<br />]]>
        
    </content>
</entry>

<entry>
    <title>traceで改行させる場合//AS2.0 AS3.0</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2010/02/trace-newline.html" />
    <id>tag:www.bute-studio.com,2010:/lab//5.204</id>

    <published>2010-02-06T22:09:25Z</published>
    <updated>2010-02-07T22:36:54Z</updated>

    <summary>traceで出力させて、見やすいように出力ウィンドウで改行させる(空白1行を入れ...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="AS2" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="AS3" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="newline" label="newline" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="trace" label="trace" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="出力" label="出力" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="改行" label="改行" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[traceで出力させて、見やすいように出力ウィンドウで改行させる(空白1行を入れる)場合、AS2までなら、<br /><code>trace(newline);</code><br />と打っていましたが、AS3.0だとnewlineが怒られることに今日知りました。<br />代わりに、<br /><code>trace('');</code><br />と入力して改行させます。<br /> ]]>
        
    </content>
</entry>

<entry>
    <title>実行するクラス名を配列(Array)などから指定する//AS3.0</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2010/02/getdefinitionbyname.html" />
    <id>tag:www.bute-studio.com,2010:/lab//5.203</id>

    <published>2010-02-04T20:16:31Z</published>
    <updated>2010-02-05T05:26:46Z</updated>

    <summary>いろいろなムービークリップの中から、ランダムで配置する場合、ひとまずリンゲージで...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="AS3" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="class" label="Class" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="getdefinitionbyname" label="getDefinitionByName" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="new" label="new" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="クラス名" label="クラス名" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="リンゲージ" label="リンゲージ" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="配列" label="配列" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[いろいろなムービークリップの中から、ランダムで配置する場合、ひとまずリンゲージで指定したクラス名を配列に入れ、それらの中から、乱数により抽出したものを new Class();のように配置させます。<br /><br />今回は、その配列からnewで実行するまでです。<br />今回の肝は、getDefinitionByNameを使うことです。<br /><br />
<code>
var myShape:Array = ["class1","class2","class3"];<br />
var ShapeNo:Number = 1;//本来は乱数などですが、今回は割愛<br />
var class_str:String=myShape[ShapeNo];<br />
var myClass:Class=Class(getDefinitionByName(class_str));<br />
mc = new myClass(); 
</code><br /><br />]]>
        
    </content>
</entry>

<entry>
    <title>iframe内のJSの関数を親HTMLから実行する //JavaScript</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2010/01/iframejs-iphone.html" />
    <id>tag:www.bute-studio.com,2010:/lab//5.202</id>

    <published>2010-01-11T20:31:09Z</published>
    <updated>2010-01-12T08:33:16Z</updated>

    <summary>iPhone用サイト内で、iframeを使った場合、window.orienta...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="HTML" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="iPhone" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="iphone" label="iPhone" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="iframe" label="iframe" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="windoworientation" label="window.orientation" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[iPhone用サイト内で、iframeを使った場合、window.orientationで画面縦横変更のトリガーがiframe内ではうまく動作しませんでした。<br />そこで、代わりに親htmlから縦横が変わった際にiframe内のJSを実行させることで、iframe内でも縦横によって違う動作をさせる(CSSでパーツの幅を変えるなど)ことができました。<br /><br /><br />
<code>
//親html内<br />//iframe_idは、iframeのid名<br />document.getElementById("iframe_id").contentWindow.setOrientation_i(引数);<br /><br />//iframe内<br />function setOrientation_i(dl) { <br />&nbsp;&nbsp;&nbsp; //処理をココへ<br />}
</code><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>iPhoneサイトで使うJSフレームワーク // Javascript</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2009/12/iphone-ajax.html" />
    <id>tag:www.bute-studio.com,2009:/lab//5.201</id>

    <published>2009-12-17T20:46:41Z</published>
    <updated>2009-12-18T10:59:31Z</updated>

    <summary>iPhoneサイトを作る際に、Flashが使えないので、Javascriptに頼...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="AJAX" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="iPhone" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="ajax" label="AJAX" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ui" label="UI" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="webアプリケーション" label="Webアプリケーション" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="iphone" label="iPhone" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="itunes" label="iTunes" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="iui" label="iui" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="javascript" label="javascript" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="jqtouch" label="jqtouch" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="jquery" label="jquery" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="js" label="js" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="フレームワーク" label="フレームワーク" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[iPhoneサイトを作る際に、Flashが使えないので、Javascriptに頼ることになります。<br />今回は、iPhoneのiTunesなどのように、ページ遷移などをiPhoneのUIのように動くWebアプリケーションを作りたいので、下の2つのフレームワークが候補になりました。<br /><br />
<a href="http://code.google.com/p/iui/" target="_blank">iui<br />http://code.google.com/p/iui/</a>
<br /><br />
<a href="http://code.google.com/p/jqtouch/" target="_blank">jqtouch(jquery拡張)<br />http://code.google.com/p/jqtouch/</a>
<br /><br />どちらを使っても、サンプルをいじるだけで、iPhoneライクなUIや動きが表現できます。<br />ｊqtouchでは、サイト内でXMLをパースして表示させるのにJQueryも使うので、仲良く出来そうかなということや、日本では今のところ関係ありませんが、G1やPreなどにもそのまま対応できるらしいのが気になりました。。<br />ただし、今回はjqtouchのbetaというところに引け目を感じ、iuiを研究して使って見ることにしました。<br /><br />iuiの詳細に関しては後々アップ予定です。<br /> ]]>
        
    </content>
</entry>

<entry>
    <title>iPhone用サイトで、画像を縦横ともに画面幅いっぱいにリサイズさせる //iPhone</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2009/11/iphone-imgwidth.html" />
    <id>tag:www.bute-studio.com,2009:/lab//5.200</id>

    <published>2009-11-29T20:41:51Z</published>
    <updated>2009-11-30T08:48:05Z</updated>

    <summary>iPhone用サイトを作る場合は、画面サイズが縦横で異なります。画面解像度は32...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="CSS" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="JavaScript" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="iPhone" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="iphone" label="iPhone" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ipodtouch" label="iPodTouch" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="img" label="img" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="orientation" label="orientation" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="orientationchange" label="orientationchange" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="resize" label="resize" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="window" label="window" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="リサイズ" label="リサイズ" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="切替" label="切替" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="画像" label="画像" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="縦横" label="縦横" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[iPhone用サイトを作る場合は、画面サイズが縦横で異なります。<br />画面解像度は320×480なので、コンテンツの幅が320と480の両方に対応して作ります。<br /><br />表示の際の幅はmeta内のviewportで設定しますが、画面閲覧中に縦横を切り替えた場合の画像サイズの切替を行いたくていろいろ調べました。<br />下のサンプルでは、SitePoint内の記事を参考に、div#mainimage内のimg1.jpgの幅を、縦の場合は320×160、横の場合、480×240で表示します。<br />その他レイアウト等もCSS内に同様に記述することで、縦横で分岐することが出来ます。<br />
今回のキーポイントは、iPhoneの表示角度を利用するときに使う、window.orientationです。window.orientationchangeで、縦横切替の際のトリガーになります。
<br /><br />
<code>
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;<br />&lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry"&gt;<br />&lt;head&gt;<br /><br />&lt;meta name="viewport" content="initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /&gt;<br />&lt;script type="text/javascript"&gt;<br />window.addEventListener('load', setOrientation, false);&nbsp; <br />window.addEventListener('orientationchange', setOrientation, false);<br /><br />function setOrientation() {&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;var orient = Math.abs(window.orientation) === 90 ? 'landscape' : 'portrait';&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;var cl = document.body.className;&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;cl = cl.replace(/portrait|landscape/, orient);&nbsp; <br />&nbsp;&nbsp;&nbsp; &nbsp;document.body.className = cl;&nbsp; <br />}<br />&lt;/script&gt;&nbsp;&nbsp;&nbsp; <br /><br />&lt;style&gt;<br />body.portrait #main_image img{<br />&nbsp;&nbsp;&nbsp; width:320px;<br />&nbsp;&nbsp;&nbsp; height:160px;<br />}<br />body.landscape #main_image img{<br />&nbsp;&nbsp;&nbsp; width:480px;<br />&nbsp;&nbsp;&nbsp; height:240px;<br />}<br />&lt;/style&gt;<br />&lt;/head&gt;<br /><br />&lt;body class="portrait"&gt;<br />&lt;div id="main_image"&gt;<br />&nbsp; &lt;img src="img1.jpg" width="320" height="160" /&gt;<br />&nbsp; &lt;/div&gt;<br />&lt;/body&gt;
</code>
<br /><br />参考記事<br /><a href="http://articles.sitepoint.com/print/iphone-development-12-tips" target="_blank">Sitepoint : New Articles, Fresh Thinking for Web Developers and Designers<br />http://articles.sitepoint.com/print/iphone-development-12-tips</a><br /><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>FuseKitでBlurさせる // Flash</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2009/10/fusekitblur-flash.html" />
    <id>tag:www.bute-studio.com,2009:/lab//5.199</id>

    <published>2009-10-29T22:18:44Z</published>
    <updated>2009-10-30T08:27:44Z</updated>

    <summary>今更ですが、AS2でブラー処理させる機会があり、忘れかけていたので、久しぶりのA...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="AS2" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="fuse" label="Fuse" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="blur" label="blur" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="trigger" label="trigger" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ブラー" label="ブラー" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[今更ですが、AS2でブラー処理させる機会があり、忘れかけていたので、久しぶりのAS2.0のエントリーです。<br />座標やalphaなどの一般的なFuseと使い方は変わりません。<br /><br />下のサンプルは、mcにX,Y軸両軸方向に0.5秒でじわーっとブラーをかけるサンプルです。<br /><br />
<code>
var f:Fuse = new Fuse();<br />&nbsp;&nbsp;&nbsp; f.push({Blur_blur:20, seconds:.5, ease:"easeOutQuad", trigger:true});<br />&nbsp;&nbsp;&nbsp; f.target = mc;<br />&nbsp;&nbsp;&nbsp; f.start();
</code>
<br /> 
※ActionScript2.0ですよ！]]>
        
    </content>
</entry>

<entry>
    <title>AIRのアプリをウィンドウ内でドラッグできるようにする // Flash</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2009/10/air-flash.html" />
    <id>tag:www.bute-studio.com,2009:/lab//5.198</id>

    <published>2009-10-28T20:23:46Z</published>
    <updated>2009-10-29T01:29:46Z</updated>

    <summary>AIRのアプリを書き出す際に、「AIR-アプリケーションとインストーラーの設定」...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="AS3" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="Air" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="air" label="AIR" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="as3" label="AS3" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mouseevent" label="MouseEvent" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="addeventlistener" label="addEventListener" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="nativewindow" label="nativeWindow" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="startmove" label="startMove" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ウィンドウスタイル" label="ウィンドウスタイル" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="カスタムクローム" label="カスタムクローム" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[AIRのアプリを書き出す際に、「AIR-アプリケーションとインストーラーの設定」で「ウィンドウスタイル」をカスタムクローム(透明)を選ぶと制作したもののみで、余計なウィンドウにくるまれなくなります。<br />と同時に、そのままの場合はドラッグして移動させることもままならなくなるので、下のように記述します。<br />基本ですが、コピペのために記録しておきます。<br /><br />
<code>
btn.addEventListener(MouseEvent.MOUSE_DOWN, windowMove);<br />btn.buttonMode = true;<br /><br />function windowMove(Evt:MouseEvent):void {<br />&nbsp;&nbsp;&nbsp; stage.nativeWindow.startMove(); <br />}
</code><br />
<br />
<a href="http://www.bute-studio.com/lab/air/">AIRに関する他の記事はコチラ</a> 

]]>
        
    </content>
</entry>

<entry>
    <title>Live HTTP Headers // Firefox addon</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2009/10/livehttpheaders.html" />
    <id>tag:www.bute-studio.com,2009:/lab//5.197</id>

    <published>2009-09-30T20:07:06Z</published>
    <updated>2009-10-01T09:16:26Z</updated>

    <summary>   Flash制作の際に、ローカルで動くものであれば、traceを使い、いろい...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="Flash" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="ブラウザ" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="firefox" label="Firefox" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="flash" label="Flash" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="htmlヘッダ" label="HTMLヘッダ" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="php" label="php" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="trace" label="trace" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="アドオン" label="アドオン" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="エラー" label="エラー" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="パス" label="パス" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="画像" label="画像" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="確認" label="確認" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="連携" label="連携" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[  <a href="https://addons.mozilla.org/ja/firefox/addon/3829" target="_blank"><img src="http://www.bute-studio.com/lab/imgs/livehtml.jpg" alt="LiveHTMLHeader" class="thumb" /></a><br />
<br />Flash制作の際に、ローカルで動くものであれば、traceを使い、いろいろな値を出力させて確認しながら制作しますが、phpやjsなどと連携させる場合、なかなか見ることが出来ません。<br />そこで、アップされたサイト内のflashの動きの動向を見る際には、このFirefoxのアドオンのLive HTTP Headersを使い、HTMLヘッダを監視すると便利です。<br />外に読みに行く画像パスやエラーなどについても返してくれます。<br /><br /><br />
ダウンロードはコチラから<br /><a href="https://addons.mozilla.org/ja/firefox/addon/3829" target="_blank">Live HTTP Headers - Firefox addon</a><br /> ]]>
        
    </content>
</entry>

<entry>
    <title>ExternalInterfaceを使って、FlashからCSSのbackgroundを変える //AS3 &amp; JS &amp; CSS</title>
    <link rel="alternate" type="text/html" href="http://www.bute-studio.com/lab/2009/09/externalinterface-as3.html" />
    <id>tag:www.bute-studio.com,2009:/lab//5.195</id>

    <published>2009-09-24T20:16:00Z</published>
    <updated>2009-09-25T09:26:33Z</updated>

    <summary>Flash内からHTML内の背景色を変更したい場合に、ActionScript3...</summary>
    <author>
        <name>ウサミタク</name>
        <uri>http://www.bute-studio.com</uri>
    </author>
    
        <category term="AS3" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="CSS" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="JavaScript" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="externalinterface" label="ExternalInterface" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="id名" label="ID名" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="background" label="background" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="classname" label="className" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="div" label="div" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="document" label="document" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="getelementbyid" label="getElementById" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="import" label="import" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="クラス名" label="クラス名" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="サンプル" label="サンプル" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://www.bute-studio.com/lab/">
        <![CDATA[Flash内からHTML内の背景色を変更したい場合に、ActionScript3.0とJavaScript、CSSの連係プレーで実装します。<br />FlashからJavaScriptへは、AS2でもよく使ったExternalInterfaceを使い、JavaScriptからCSSへは、document.getElementByIdを使ってdivのID名を探し、.className="クラス名"でクラス名を設定します。<br /><br />下のサンプルでは、#idname内のbackgroundを3色の中から変更できる仕様です。<br /><br />
<code>
//Flash内AS3.0<br />import flash.external.ExternalInterface;<br /><br />colorID = no;&nbsp;&nbsp;&nbsp; <br />var result:uint = ExternalInterface.call("callJS", no);
</code><br /> <br /> 
<code>
//JavaScript<br />function callJS(str) {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp; switch(str){<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; case 1: document.getElementById("idname").className = "color1";break;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; case 2:&nbsp;&nbsp;&nbsp; document.getElementById("idname").className = "color2";break;<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; case 3:&nbsp;&nbsp;&nbsp; document.getElementById("idname").className = "color3";break;<br />&nbsp;&nbsp; }&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; return str; <br />}
</code>
<br /> <br /> 
<code>

//CSS<br />.color1{<br />&nbsp;&nbsp;&nbsp; width:100px;<br />&nbsp;&nbsp;&nbsp; height:200px;<br />&nbsp;&nbsp;&nbsp; background:#ff6600;<br />}<br /><br />.color2{<br />&nbsp;&nbsp;&nbsp; width:100px;<br />&nbsp;&nbsp;&nbsp; height:200px;<br />&nbsp;&nbsp;&nbsp; background:#ffffff;<br />}<br /><br />.color3{<br />&nbsp;&nbsp;&nbsp; width:100px;<br />&nbsp;&nbsp;&nbsp; height:200px;<br />&nbsp;&nbsp;&nbsp; background:#333333;<br />}<br /><br /> </code>
最近忙しさのせいにして、ブログのアップを怠っています。反省して、来月からまた頑張ります。]]>
        
    </content>
</entry>

</feed>
