ÂÛ̳½»Á÷
Ê×Ò³°ì¹«×Ô¶¯»¯| ÍøÒ³ÖÆ×÷| ƽÃæÉè¼Æ| ¶¯»­ÖÆ×÷| Êý¾Ý¿â¿ª·¢| ³ÌÐòÉè¼Æ| È«²¿ÊÓƵ½Ì³Ì
Ó¦ÓÃÊÓƵ: Windows | Word2007 | Excel2007 | PowerPoint2007 | Dreamweaver 8 | Fireworks 8 | Flash 8 | Photoshop cs | CorelDraw 12
±à³ÌÊÓƵ: CÓïÑÔÊÓƵ½Ì³Ì | HTML | Div+Css²¼¾Ö | Javascript | AccessÊý¾Ý¿â | Asp | Sql ServerÊý¾Ý¿âAsp.net  | Flash AS
µ±Ç°Î»Öà > ÎÄ×Ö½Ì³Ì > Flash AS½Ì³Ì
Tag:2.0,3.0²ËÄñ,ÓÎÏ·,Àà,cs,¼¼ÇÉ,Ô´Âë,²ã,Îı¾,ÎÄ×Ö,º¯Êý,ÒôÀÖ,Ëæ»ú,ÍÏק,asp,access,xml,mc,ÊÓƵ½Ì³Ì

flashͶƱϵͳԴÂë½Ì³Ì

ÎÄÕÂÀà±ð£ºFlash AS | ·¢±íÈÕÆÚ:2010-4-25 9:01:01

Flash AS½Ì³Ì_flashͶƱϵͳԴÂë½Ì³Ì

²»Ê¹ÓÃÊý¾Ý¿â£¬ÐÅÏ¢±£´æÔÚÎı¾ÎļþÀºǫ́ÓõÄÊÇphp

import mx.transitions.*;
import mx.transitions.easing.*;
class vote extends MovieClip {
    //ͶƱÈËÊý
    public var person_arr:Array = new Array();
    //ͶƱ°Ù·Ö±È
    public var percent_arr:Array = new Array();
    //³õʼ»¯
    public function vote() {
        //Ö¸Ïòµ±Ç°À࣬Õâ¸öÖ¸ÏòºÜÓÐÒâ˼£¬ºÜʵÓÃ
        var app = this;
        //½«½ø¶ÈÌõµ÷Ϊ0
        for (var i = 1; i<4; i++) {
            _root.main["item"+i+"_percent_bar_mc"]._xscale = 0;
        }
        
        //»ñÈ¡ºǫ́Êý¾Ý
        var send_lv:LoadVars = new LoadVars();
        send_lv.fetch_data = "yes";
        var result_lv:LoadVars = new LoadVars();
        send_lv.sendAndLoad("deal.php",result_lv,"GET");
        result_lv.onLoad = function(s) {
            if (s) {
                
                //µÃµ½Óû§Êý¾ÝºÍ°Ù·Ö±ÈÊý¾Ý
                person_arr = result_lv.person.split("|");
                percent_arr = result_lv.percent.split("|");
                //½«µÃµ½Óû§Êý¾ÝºÍ°Ù·Ö±ÈÊý¾ÝÌîдµ½flashÀ²¥·Å¶¯»­½ø¶ÈÌõ
                app.gen_person_data(person_arr);
                app.gen_percent_data(percent_arr);
                app.animation(percent_arr);
            }
        };
        
        //¶Ô°´Å¥¼àÌý
        btn_listener();
    }
    //²¥·Åpercent_bar_mc
    public function animation(percent_data) {
        //¶¯»­½ø¶ÈÌõ
        for (var i = 1; i<4; i++) {
            new Tween(_root.main["item"+i+"_percent_bar_mc"], "_xscale", Strong.easeOut, 0, percent_data[i-1], 2, true);
        }
    }
    
    //Éú³Éͳ¼ÆÈËÊýÊý¾Ý
    public function gen_person_data(data_arr) {
        for (var i = 1; i<4; i++) {
            _root.main["item"+i+"_person_txt"].text = data_arr[i-1];
        }
    }
    
    //Éú³Éͳ¼Æ°Ù·Ö±ÈÊý¾Ý
    public function gen_percent_data(data_arr) {
        for (var i = 1; i<4; i++) {
            _root.main["item"+i+"_percent_txt"].text = data_arr[i-1]+"%";
        }
    }
    
    //¼àÌý°´Å¥
    public function btn_listener() {
        var app = this;
        for (var i = 1; i<4; i++) {
            _root.main["item"+i+"_btn"].i = i;
            _root.main["item"+i+"_btn"].onRelease = function() {
                app.vote_click(this.i);
            };
        }
    }
    
    //ÌύͶƱ
    public function vote_click(index) {
        var app = this;
        var obj:Object = new Object();
        obj.i = index;
        var send_lv:LoadVars = new LoadVars();
        send_lv.index = index;
        var load_lv:LoadVars = new LoadVars();
        send_lv.sendAndLoad("deal.php",load_lv,"GET");
        load_lv.onLoad = function(s) {
            if (s) {
                //µÃµ½Óû§Êý¾ÝºÍ°Ù·Ö±ÈÊý¾Ý
                person_arr = load_lv.person.split("|");
                percent_arr = load_lv.percent.split("|");
                //½«µÃµ½Óû§Êý¾ÝºÍ°Ù·Ö±ÈÊý¾ÝÌîдµ½flashÀ²¥·Å¶¯»­½ø¶ÈÌõ
                app.gen_person_data(person_arr);
                app.gen_percent_data(percent_arr);
                app.animation(percent_arr);
                app.disable_btn();
            }
        };
    }
    
    //½ûÓð´Å¥
    public function disable_btn() {
        for (var i = 1; i<4; i++) {
            _root.main["item"+i+"_btn"].enabled = false;
        }
    }
}

ÊÓƵ½Ì³ÌÁбí
ÎÄÕ½̳ÌËÑË÷
 
Flash ASÍƼö½Ì³Ì
Flash ASÈÈÃŽ̳Ì
¿´È«²¿ÊÓƵ½Ì³Ì
¹ºÂò·½Ê½/¼Û¸ñ
¹ºÂòÊÓƵ½Ì³Ì: ×Éѯ¿Í·þ
tel:15972130058