FLASH 全屏ACTION 代码

本文介绍了一个使用ActionScript实现的Flash加载器,通过监听舞台尺寸变化来调整加载界面的位置,并确保背景尺寸始终与舞台匹配。此外,还实现了加载进度的显示与更新,以及完成加载后的播放功能。

// Action script...

// [Action in Frame 1]
Stage.scaleMode = "noScale";
Stage.align = "TL";
var stageListener = new Object();
stageListener.onResize = function ()
{
    loading.onEnterFrame = function ()
    {
        this._x = this._x + (Stage.width / 2 - this._x) * 3.000000E-001;
        this._y = this._y + (Stage.height / 2 - this._y) * 3.000000E-001;
    };
    bg._width = Stage.width;
    bg._height = Stage.height;
};
Stage.addListener(stageListener);
loading._x = Stage.width / 2;
loading._y = Stage.height / 2;
bg._width = Stage.width;
bg._height = Stage.height;
onEnterFrame = function ()
{
    var _loc2 = getBytesLoaded();
    var _loc1 = getBytesTotal();
    percent = Math.round(_loc2 / _loc1 * 100);
    loading.percenty = percent + "%";
    if (_loc2 == _loc1)
    {
        delete onEnterFrame;
        play ();
    } // end if
};

// [Action in Frame 2]
stop ();
var stageListener = new Object();
stageListener.onResize = function ()
{
    mainAnim.onEnterFrame = function ()
    {
        this._x = this._x + (Stage.width / 2 - this._x) * 3.000000E-001;
        this._y = this._y + (Stage.height / 2 - this._y) * 3.000000E-001;
    };
    bg._width = Stage.width;
    bg._height = Stage.height;
};
Stage.addListener(stageListener);
mainAnim._x = Stage.width / 2;
mainAnim._y = Stage.height / 2;
bg._width = Stage.width;
bg._height = Stage.height;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值