トップへ戻るニュースフォーラムFLASH-ML 過去ログBak@Flaダウンロードよくある質問と答
ログイン
ユーザ名:

パスワード:


パスワード紛失

新規登録
メインメニュー
メイン
   ActionScript 3.0 特設会議室
     構造体の初期化パラメータ
投稿するにはまず登録を

フラット表示 前のトピック | 次のトピック
投稿者 スレッド
mayor
Åê¹ÆNo.46448
投稿日時: 2010-11-27 15:08
ちょんまげら
居住地: 東京砂漠
投稿: 4403
使用環境:
Re: 構造体の初期化パラメータ
引用:
flammingさんは書きました:
if(col == null)col = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);の1行を書かなくても済むよう、

なぜ、この1行を回避したいのか、その目的などを記された方が良いように思いますが。

if文を嫌ってのことであれば、こんな方法もありますね。
package {

	import flash.display.Sprite;
	import flash.geom.ColorTransform;

	public class Main extends Sprite {
		private var default_trans:ColorTransform = new ColorTransform(1, 1, 1, 1, 0, 0, 0, 0);

		public function Main() {
			init();
		}

		private function init():void {
			trace(colorize());
			trace(colorize(new ColorTransform(2, 2, 2, 2, 0, 0, 0, 0)));
		}
		public function colorize(trans:ColorTransform = null):ColorTransform {
			var colorTrans:ColorTransform = trans || default_trans;
			return colorTrans;
		}

	}

}
論理和演算子


----------------
質問する際は、回答者に具体的な情報を与えてください。

フラット表示 前のトピック | 次のトピック

題名 投稿者 日時
   構造体の初期化パラメータ flamming 2010-11-27 12:55
     Re: 構造体の初期化パラメータ Fumio 2010-11-27 13:45
       Re: 構造体の初期化パラメータ flamming 2010-11-27 15:05
         Re: 構造体の初期化パラメータ mayor 2010-11-27 15:15
         Re: 構造体の初期化パラメータ Fumio 2010-11-27 18:15
           Re: 構造体の初期化パラメータ flamming 2010-11-28 10:56
   » Re: 構造体の初期化パラメータ mayor 2010-11-27 15:08

投稿するにはまず登録を
 
Copyright (C) 2003 FLASH-japan. All rights reserved.
Powered by Xoops