たまには簡単な Flash の話題を。初心者向けの内容です。 ActionScript2でも使えるTweenerライブラリを使って、一枚の画像をすっごく簡単に演出をつけてみました。 trick7さんのところにあった、『Tweener を使って「手を抜いて作ってる割にはそれっぽい」かつ「使いまわしがきく」ようなボタン』のようなものです。(参考) 画像クリックでFlashデモページが開きます。 マウスプレス時にも演出が加わっていると気持ちいいですよね。以下、具体的な実装方法です。 こんな感じにフレームアクションを書きます // Tweenerライブラリをインポート import caurina.transitions.* import caurina.transitions.properties.* // カラーショートカットを登録 ColorShortcuts.init() // ボタン(b
// ActionScript2 import caurina.transitions.Tweener; Tweener.addTween([instance],{_x:100, time:1, transition:'easeOutQuint', onComplete:handler}); function handler(){ trace("テスト";); } TweenerはActionScript3.0とActionScript2.0で使用する事ができ、インスタンスに対して「だんだんゆっくり止まる」「どんどん勢いよく移動」「びょーんびょーん(?)」と、いろんなイージングが設定できるトウィーン制御ライブラリです。とても簡単なScriptで実現できます! 導入手順まずはGoogle Codeに公開されているライブラリをダウンロード。 配布元:http://code.google.com
基本の使い方から、それを応用した使い方まで、紹介されているサイトを自分の勉強用にまとめていきます。基本の使い方から、それを応用した使い方まで、紹介されているサイトを自分の勉強用にまとめていきます。 (見つけたら増やしていくかも、なので、記事の内容がコロコロ変わるかもです。あしからず) SCRATCHBRAIN.BLOG ver.2様 Tweener.addTween(ver.1.25.57)の使い方 feb19.jp blog様 AS3でTweener 1.31.67を使う Tweener Documentation and Language Reference様 イージング設定をビジュアルで確認Transition Types 各プロパティIntroduction fladdict»様 Tweener拡張で、MovieClipをMatrixで変形をできるようにした。 Tweener
Flashで始めるActionScript3.0(AS3)入門、オブジェクト指向(OOP)の基礎知識、サンプルコードなど 正規表現は文字の出現パターンを定義し、文字列のチェックや操作などに使います。 正規表現を使うには、まずパターンをインスタンス化します。 次の2行は同じ意味です。 private var num :RegExp = /^[0-9]+$/; private var num :RegExp = new RegExp("^[0-9]+$"); 上のパターンはすべて数値かをチェックするためのものです。 test()メソッドを使い、文字列をチェックすると、パターンに一致した場合はtrue、不一致の場合はfalseを返します。 trace(num.test("ab1"));// 出力 false trace(num.test("123"));// 出力 true trace(
// ¤É¤Á¤é¤Ç¤â²Ä var MyArray:Array = new Array("hoge", "foo"); var MyArray:Array=["hoge","foo"]; ÇÛÎó¤Ï²ÄÊÑĹ¡£ ¤É¤Î·¿¤À¤í¤¦¤¬Æþ¤ë¡£ ¤³¤ì¤ÏÁ´¤Æ¤ÎÂçËܤǤ¢¤ëObject·¿¤ÎÇÛÎó¤Ç¤¢¤ë¤¿¤á¡£ ¤Ê¤ª¡¢ÌÀ¼¨¤·¤¿Í×ÁÇ¿ô¤òĶ¤¨¤ÆÇÛÎó¤Ë¥¢¥¯¥»¥¹¤·¤Æ¤â¡¢ActionScript¤Ç¤Ï¤½¤Î¤Þ¤Þ»ÈÍѤǤ¤ë(Èò¤±¤¿¤Û¤¦¤¬ÌµÆñ¤À¤¬) // Èϰϳ°¥¢¥¯¥»¥¹Îã var MyArray:Array=["hoge","foo"]; MyArray[3]="bar"; for(var i:int=0; i<MyArray.length;i++)
当ブログではFlashの3Dに関する記事を数多く書いていますが、この度それらの記事をこの1ページにまとめてみました。系統別にまとめたので、目的とする解説やサンプルが探しやすくなったのではないかと思います。それぞれの記事でソースファイルをダウンロードできますので、学習の理解にお役立てください。 Flashの3Dエンジンで最もメジャーな「Papervision3D」を中心にブログ記事を書いています。 Papervision3D – チュートリアル クリックで再生できます フレームア クションで覚える PV3D チュートリアル Vol.01 フ レームアクションで覚える PV3D チュートリアル Vol.01 (補足) フ レームアクションで覚える PV3D Vol.02 : Primitiveを理解する フ レームアクションで覚える PV3D Vol.03 : Materialを理解する フ
「 0.0 から 1.0 まで(1.0 は含まない)の小数値」にさらに好きな値を乗算すると、乱数を好きな範囲まで広げる事ができます。
Flash 8/Mac OS Xで、つぎのスクリプトを実行してみます(図001)。 図001■[アクション]パネルに記述したスクリプト 1. "\n"が改行コードと認識されない 期待するのは、以下のような[出力]です。 // [出力]: line0 line1 ===== line0 ところが、実際の[出力]は、こうなります(図002)。 図002■[出力]パネルの表示 "\n"が改行コードと認識されておらず、そのまま文字として出力されています。newline定数を使えば改行はされるものの、String.split()メソッドで"\r"を区切り文字に指定して、ふたつのエレメントからなる配列に変換することができません。 2. エスケープ文字は全角バックスラッシュ? [デバッグ]メニューから[変数のリストアップ]を確認すると、[出力]パネルにはつぎのように表示されます(図003)。 図003■
Warning: Use of undefined constant user_level - assumed 'user_level' (this will throw an Error in a future version of PHP) in /home/rontan/www/wp-content/plugins/ultimate_ga_1.6.0.php on line 524 ちょっとした小ネタですが、アプリケーション起動時に、TextInputにフォーカスして編集状態にする方法について。 みなさんご存知の通り、フォーカスの制御はsetFocusを使えば出来ますが、このsetFocusをどのタイミングで実行するかによって挙動が変わってきます。 実行するタイミングとして、creationComplete か applicationCompleteで実行することになると思いますが、
for each文 ― リストを1つずつ取り出して ― AS 3からfor each文が使えるようになりました。for文に似ていますが、for each文は配列変数などの要素を、1つ1つ読み出すときなどに便利です。 package { import flash.display.*; import flash.text.*; public class Lesson3_2 extends Sprite { public function Lesson3_2 () { var myObj:Object = {aaa:"111", bbb:"222"}; 【1】 var textField:TextField = new TextField(); for each (var value:String in myObj) { 【2】 textField.app
ActionScript 3.0 ではObjectを連想配列として使える var map:Object = new Object(); // キーを指定して値を登録 map["one"] = 1; map["two"] = 2; map["three"] = 3; // この書き方でもOK map.four = 4; map.five = 5; // キーを指定して値を参照 trace(map["one"]); trace(map["two"]); trace(map["three"]); trace(map.four); trace(map.five); // キーの列挙 for (var s:String in map) trace(s); // 値の列挙 for each (var i:int in map) trace(i); // キーと値を列挙して初期化 var map2:Ob
3-2. FlashVarsによる指定方法 以下の方法でHTMLからFlashに変数を送ってます。 記述ルール: <param name="FlashVars" value="変数名1=値1&変数名2=値2&変数名3=値3" /> "変数名=値" SWFのURL指定とほぼ同じ。 "&"もしくは"&"で繋げることで複数の変数を連続で指定できる HTMLでの記述方法 HTMLソース //2カ所のSWFのパス指定に同じ内容で記述する <object data="swf/flashvars.swf" type="application/x-shockwave-flash" id="mySwf" width="300" height="200"> <param name="movie" value="swf/flashvars.swf" /> <param name="Fl
ActionScript 3.0 で開発中、何気に FlashVars の変数を取得しようと思ったんだけど、そういえば! 従来のActionScript 2.0 で FlashVars で渡ってきた変数を _root からアクセスして簡単に取得するやり方は ActionScript 3.0 だったら_root が removed されてるから当てはまらないですよね。どうするんだっけと思い検索したらやっぱり変更していたのでメモ。 Shape, Sprite, Bitmap, SimpleButton, TextField, MovieClip class 等は DisplayObject(display list に見なされるすべてのクラスの基盤クラス)の subclass に当たり、この DisplayObject が読み込まれる大本の swf の loaderInfo プロパティ から
1. FlashVarsプロパティを使った変数の指定 FlashVarsプロパティは、HTMLドキュメントに<object>および<embed>要素で指定します。SWFファイルtest.swfに変数myVarに値"test"を設定して渡したいときは、つぎのように記述します[*2]。 <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,0,0" width="240" height="180" id="test" align="middle"> <param name="allowScriptAccess" value="sameDomain"
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く