原创 Flash AS3 學習11 - 拖動

1.新建一個影片剪輯 , 實例名稱爲:an_mc; 2.代碼: an_mc.addEventListener(MouseEvent.MOUSE_DOWN,anxia); an_mc.buttonMode = true; function

原创 C++學習6 - 按值傳遞,按…

1.按值傳遞: #include<iostream> using namespace std; void swap(int a, int b){  int c;  cout << "swap交換前,a:" << a << "b:" <

原创 Flash AS3 學習9 - 時鐘的製作

時鐘的製作 製作好鐘面及指針,時針,分針,秒針均爲MC,註冊點在底部正中,實例名稱分別爲sz_mc,fz_mc,mz_mc 年月日星期共4個動態文本框,實例名稱分別爲:y_txt,m_txt,d_txt,w_txt   截圖:   代

原创 C++學習4 - 內聯函數

#include<iostream> inline int print(int); int print(int x){  return x; } int main(){  int x;  cout<<"Cin:"<<endl;  ci

原创 Flash AS3 學習12 - 事件處理機制

先來看個例子: 地點:飯館類(extend Sprite or UIcomponent...,是個容器就行) 人物:客人類(extend EventDispatcher,會說話就行)、廚師類(extend Object,能 滿足客人

原创 C++學習7 - 按別名傳遞對象

#include<iostream>using namespace std; class A{ public:  A(){ cout << "構造函數!" << endl; }  A(A&){ cout << "複製夠造函數"<<end

原创 JSON

JSON簡介   [plain] viewplaincopy JSON指的是JavaScript對象表示法(JavaScript Object Notation)   JSON用來存儲和交換文本信息   JSON是純文本的

原创 Flash AS3 學習10 …

SoundMixer.stopAll 停止當前正在播放的所有聲音。  此方法不停止播放頭。 ///////////////////////////////////////////// SoundChannel 類控制應用程序中的聲音。

原创 Flash AS3 學習16 …

public function btnMovePiece(e:MouseEvent) { trace("實例名稱:"+e.currentTarget.name) //獲取當前點擊對象的名稱 trace(

原创 Flash AS3 學習8 - 旋轉的小球

1.在舞臺新建一個元件ball;用橢圓工具畫一個圓。 2.代碼: this.addEventListener(Event.ENTER_FRAME , onEnterframe); var shift:Number = 0; var st

原创 C++學習1 - 第一個C++程序

#include<iostream> using namespace std; //使用命名空間 int main() {  cout << "Hello Zing!";  //輸出 Hello Zing!  cout << 1 + 2

原创 C++學習3 - 定義一個對象

#include<iostream> using namespace std; class People{ public:  void getStature(){   cout <<"Zing的升高爲:"<<stature<<"cm"

原创 Flash AS3 學習15 …

ArgumentError: Error #2025: 提供的 DisplayObject 必須是調用者的子級。   解決方法: 1.可以在移除之前先做個判斷 if (this.contains(要移除的對象)){this.rem

原创 C++學習2 - 枚舉型常量

#include<iostream> using namespace std; int main(){  enum day{sun,mon,tue,wed,thu,fri,sat};  day today;  today = sat;

原创 Flash AS3 學習7 - 計時器

1、新建Flash文檔 2、在圖層1的第1幀,創建一個實例名爲time的動態文本實例。 3、添加as圖層,單擊第1幀,打開動作面板輸入代碼: //定義時間間隔 var interval:uint = 100; //重複次數 var re