action script 3.0 帮助文档

http://help.adobe.com/zh_CN/as3/components/index.html

scrollpan与movieclip

import fl.containers.ScrollPane;
import fl.controls.ScrollPolicy;
import fl.controls.DataGrid;
import fl.data.DataProvider;
import flash.events.Event;
import flash.external.*;

var aSp:ScrollPane = new ScrollPane();
var aBox:FF = new FF();
drawBox(aBox, 0xFFFFFF); //draw a red box

aSp.x=0;
aSp.y=0;
aSp.source = aBox;
aSp.setSize(550, 350);

aSp.move(0, 0); // 滚动区域的位置

addChild(aSp);

function drawBox(box:MovieClip,color:uint):void {
box.graphics.beginFill(color, 1);
box.graphics.drawRect(0, 0, 1000, 400);
box.graphics.endFill();
}


btnExp.addEventListener(MouseEvent.CLICK, clickHandler);

function clickHandler(event:MouseEvent):void
{
if(ExternalInterface.available)
{
aSp.setSize(1000, 350);
ExternalInterface.call("setSize","100");
}
}

ExternalInterface.addCallback("test",test);

function test(zi:String):void
{
aSp.setSize(1000, 350);
}

posted @ 2013-05-28 10:15  V.Wang  阅读(226)  评论(0编辑  收藏  举报