This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//CaptureToPNG(ファイル, ファイル名に付与する数字, 数字桁数 ,ドットを含む拡張子); | |
void CaptureToPNG(String fileURL, int num, int digits ,String fileType){ | |
//指定した桁数に満たない数字の右側に0を追加 | |
String numString = nf(num, digits); | |
// フレーム枚にpngへキャプチャ | |
String pngName = fileURL + numString + fileType; | |
save(pngName); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//MovieMakerライブラリをインポート&宣言 | |
import processing.video.*; | |
MovieMaker mm; | |
void setup() { | |
size(640, 480); | |
frameRate(30); | |
//その他の初期設定ここに書く | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//外部テキストから変数値を読み込むコード | |
//変数名=数値 の形式で1項目ごとに改行して記入された外部テキストを読み込む | |
//↓こんなかんじで記入しておく(コンマは不要) | |
//aaa=123 | |
//bbb=456 | |
//すると、配列settingに、setting["aaa"] = 123, setting["bbb"] = 456, といった感じで読み込まれる。 | |
import flash.net.URLLoader; | |
import flash.net.URLRequest; | |
import flash.net.URLVariables; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var swfNum = 3; //読み込むswfファイルの数 | |
//読み込むswfの受け皿を作っておく | |
var mcSWF:Array = new Array(); | |
mcSWF["aaa"] = new Loader(); | |
mcSWF["bbb"] = new Loader(); | |
mcSWF["ccc"] = new Loader(); | |
//外部swfの読み込み | |
function loadSWF(swfName:String){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cTime:int = getTimer(); | |
this.addEventListener(Event.ENTER_FRAME,timerStart); | |
function timerStart(evt:Event):void{ | |
var countSec = (getTimer() - cTime)/1000; | |
var countMin = countSec/60; | |
var sec:int = countSec%60; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//obj1の現在の深度をチェック | |
trace(getChildIndex(obj1)); | |
//obj1の深度を2にセット | |
setChildIndex(obj1, 2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 連想配列を使った場合の例 | |
private function getData():Object | |
{ | |
var result:Object = new Object(); //resultという結果を格納するための配列を用意。 | |
result["age"] = 26; | |
result["name"] = "mahny"; | |
return result; | |
} | |
private function test():void |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//(2) getTimer関数を利用する方法 の例 | |
function countTimeFunc(){ | |
// 指定したい秒数(時間単位はミリ秒) | |
// ex. 3秒を指定したい場合 → 3000 | |
var waitTime:int = 3000; | |
// 現在の時間を一時的に格納 | |
var nowTime:int = getTimer(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//(1) Flashを実行してからのフレーム数をカウントする方法 の例 | |
//ただし、このまま使うと無限ループに陥るので注意。 | |
// フレームレートを指定 | |
stage.frameRate = 12; | |
// 指定したいフレーム数 | |
// ex. フレームレート12のとき、3秒を指定したい場合 → 36 | |
var waitTime:int = 36; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// パッケージのインポート | |
import fl.transitions.Tween; | |
import fl.transitions.easing.*; | |
import fl.transitions.TweenEvent; | |
// 設定用の変数を準備 | |
var twMc:MovieClip; //トゥイーン対象のムービークリップ | |
var twValue:String; //トゥイーン対象の値(ex. X座標をトゥイーンさせたい場合は"x"を指定) | |
var twType; //イージング種類(ex. Bounce.easeOut) | |
var twStart:Number; //Tweenの開始値 |
NewerOlder