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);
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
;
//点击图标,以及切换鼠标
box.addEventListener(MouseEvent.CLICK, onClick);
box.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
box.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
}
private
function
onClick(e:MouseEvent):
void
{
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;
}
}
}
flash显示qq在线聊天 - 转,布布扣,bubuko.com
原文:http://www.cnblogs.com/xhmf/p/3880061.html