ActionScript基本語法講解

2021-09-08 10:11:20 字數 3698 閱讀 9708

var a:int = 3;

var b:int = 4;

b = 9;

trace ("a的值為:"+a);

trace ("b的值為:"+b);

var x1:array = new array(1,2,3);

var y1:array = x1;

y1[0] = 4;

trace ("a現在的值為:"+x1);

trace ("b現在的值為:"+y1);

var q:array = new array("aaaaa","cccccccc","******x");

var s:array = q;

s = new array (111,222,333);

s[0] = 222;

trace ("q現在的值為:"+q);

trace ("s現在的值為:"+s);

const foo:array = new array(1,2,3);

var b1:array = foo;

b1[0] = 2;

trace ("foo陣列的值為:"+foo);

trace ("b陣列的值為:"+b1);

var bx:boolean;

trace (bx);

trace (bx == false);

var d:int = 2;

var f:int = d/3;

trace (f);

var g:number = d/3;

trace (g);

var floata:number = 1.0;

var floatb:number = 0;

for (var i:int = 0; i < 10; i++)

trace (floatb);

trace (floata == floatb);

var stringsample:string = "123456";

var stringlength = stringsample.length;

trace (stringlength);

var as1:array;

var bs1:array = ;

var cs1:array = new array();

var ds1:array = [1,2,3,4]

var es1:array = new array(1,2,3,4,5,6);

var fs1:array = new array(5);

trace (as1);

trace (bs1);

trace (cs1);

trace (ds1);

trace (es1);

trace (fs1);

var obj:object = new object();

obj.name = "xss";

obj.gender = "male";

obj.age = 9;

obj.hello = function()

trace (obj.name);

trace (obj.gender);

trace (obj.age);

obj.hello();

var sample1:array = [[1,2,3],[4,5,6],[7,8,9]];

trace (sample1[2]);

trace (sample1[2][2]);

var sample2:array = new array(new array(1,2,3),new array(4,5,6),new array(7,8,9));

trace (sample2[2]);

trace (sample2[2][2]);

var sample3:array = new array(3);

sample3[0] = [1,2,3];

sample3[1] = [4,5,6];

sample3[2] = [7,8,9];

trace (sample3[2]);

var aq:int;

var bq:uint;

var cq:number;

var dq:string;

var eq:boolean;

var fq:array;

var gq:object;

var hq;

var iq:*;

trace (aq);

trace (bq);

trace (cq);

trace (dq);

trace (eq);

trace (fq);

trace (gq);

trace (iq);

trace (9 is number);

trace (9 as number);

trace (0.1 is number);

trace (0.1 as number);

var ax:array = ["q","w","e","r"];

trace (2 in ax);

trace (3 in ax);

var objx:object = new object();

objx.element = "xss";

objx.tags = "csrf";

delete objx.element;

trace (objx.element);

objx = null;

trace (objx);

var box:array = new array("123","456","789");

var target:string = "789";

for (var ss:int = 0; ss < box.length; ss++)

if (ss == box.length + 1)

}var xss_1:object = ;

for (var k in xss_1)

for each (var l in xss_1)

輸出結果:

a的值為:3

b的值為:9

a現在的值為:4,2,3

b現在的值為:4,2,3

q現在的值為:aaaaa,cccccccc,******x

s現在的值為:222,222,333

foo陣列的值為:2,2,3

b陣列的值為:2,2,3

false

true

00.6666666666666666

0.9999999999999999

false

6null

1,2,3,4

1,2,3,4,5,6

,,,,

xssmale

9hello world!!!

7,8,9

97,8,9

97,8,900

nannull

false

null

null

undefined

true

9true

0.1true

true

undefined

null

第3次才找到789

鍵key3值zzzzz

鍵key2值yyyyy

鍵key1值***xx

值zzzzz

值yyyyy

值***xx

mysql degree MySQL的基本語法

今天是開學第三天,算是正式開始學習了吧。第一天基本是老師在向我們介紹軟體測試要了解什麼方面的知識,以後要做些什麼。第二天主要是練習了一下怎麼寫需求文件,感覺這個確實挺難寫的,畢竟我文字表達能力感覺不是太好,只能說以後慢慢練習吧。今天學了mysql的幾個基本語法,感覺確實挺蛋疼的,最主要是沒有提示這一...

Action script學習筆記。

action script基本語法 1 建立變數 var 變數名 型別 var a int 1 2.類的概念 action script中的類和其他物件導向中的類差不多,今天看到乙個基本的類object,很是通用。3.super 語句 呼叫方法或建構函式的超類或父版本。用法 super arg1,a...

python語 Python 基本語法

python 語法 1 列印 輸入用print 例如 print hello word python 3中可以直接列印中文,並且語法不一樣,python 3中有 2 如何定義變數名 定義變數名有以幾個條件 1 開頭必須是字母 or 下劃線 2 變數名必須是由字數 or 數字 or 下劃線的組成,不可...