用代码排出自己的名字

                                                                      名字排序

package

{

        import flash.display.MovieClip;

        import flash.net.URLLoader;

       import flash.net.URLRequest;

       import flash.events.Event;

 public class Main extends MovieClip  

{

      private var loader:URLLoader;

       public function Main()   

            {

                 loader =  new URLLoader();

                 loader.load(new URLRequest("xml.XML"));

                 loader.addEventListener(Event.COMPLETE,OnLoaderHandler);

          }  

 private function OnLoaderHandler(e:Event):void   

{

                   var Name:XML = new XML(loader.data);

                  //trace(Name);

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

                          {

                                       var md:MD=new MD();

                                      stage.addChild(md);

                                     md.x = Name.x[i] + 300;   //md为元件的名字

                                     md.y = Name.y[i] + 400;

                                    //trace(Name.x[i]);

                                  //    trace(Name.y[i]);

                           }  

}

 }

}

 

————————————————————————————————————————————————————————————————————————————

xml中写出组成名字的各个像素的坐标

posted @ 2012-11-04 21:51  泡沫小灰灰  阅读(428)  评论(0编辑  收藏  举报