Flash display QQ online chat-turn

Source: Internet
Author: User
package {      import flash.display.Sprite;      import flash.events.Event;      import flash.events.MouseEvent;      import flash.globalization.StringTools;      import flash.net.URLRequest;      import flash.net.navigateToURL;      import flash.display.Bitmap;      import flash.display.Loader;      import flash.ui.Mouse;      import flash.ui.MouseCursor;      public class Main extends Sprite      {                      private var qq: String = "278919507" ;          private var loader:Loader = new Loader();          private var bit:Bitmap ;          private var box:Sprite;                    public function Main(): void          {              if (stage) init();              else addEventListener(Event.ADDED_TO_STAGE, init);          }           private function init(e:Event = null ): void          {              removeEventListener(Event.ADDED_TO_STAGE, init);                     box = new Sprite();              upData();          }                    public function upData(): void          {                   loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onCom);               var sUrl: String = "http://wpa.qq.com/pa?p=2:" + qq + ":41?" + Math.random();              trace (sUrl);                         loader.load( new URLRequest(sUrl));          }                      private function onCom(e:Event) : void          {                         bit = Bitmap(loader.content);                bit.height = 22 ;              bit.width = 74 ;                  box.addChild(bit);                       addChild(box);                       box.x = box.y = 10 ;                            // Click the icon and switch the mouse              box.addEventListener(MouseEvent.CLICK, onClick);              box.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);              box.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);                        }                        private function onClick(e:MouseEvent): void          {              var sUrl: String = "http://wpa.qq.com/msgrd?v=3&uin=" + qq + "&site=qq&menu=yes" ;              navigateToURL( new URLRequest(sUrl), "_blank" );              trace ( "test" );          }                    private function onMouseOver(e:MouseEvent): void          {              Mouse.cursor=MouseCursor.BUTTON;          }                    private function onMouseOut(e:MouseEvent): void          {              Mouse.cursor=MouseCursor.ARROW;          }                 }  }Make a note to avoid finding Yang Guo under the bodhi tree
Source: http://yjmyzz.cnblogs.com
The copyright of this article is shared by the author and the blog Park. You are welcome to repost this article. However, you must retain this statement without the author's consent and provide a clear link to the original article on the article page. Otherwise, you will be held legally liable.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.