`
wsliujian
  • 浏览: 95099 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

AS3中的loading与stage

阅读更多
在AS3中如果用loading在主flash中是不能使用stage的,因为stage是顶层容器,那么如果你的flash要做出自适应的,只能在loading的flash中使用了,还有种办法就是在把flash做成两帧,第一帧场景中只有loading的文字,当整个loading加载完成后在调到第二帧。入下面是在自身中加载loading
stop();
import flash.display.LoaderInfo;
import flash.events.ProgressEvent;
import flash.text.TextField;
var loadText:TextField=new TextField();
addChild(loadText);
this.loaderInfo.addEventListener(ProgressEvent.PROGRESS,myloadmovie);
this.loaderInfo.addEventListener(Event.COMPLETE,myover);
function myloadmovie(event:ProgressEvent):void {
   var hl:Number=event.bytesLoaded/event.bytesTotal;
   var n:Number=Math.round(hl*100);
   loadText.text=n+”%”;
}
function myover (event:Event):void {
this.loaderInfo.removeEventListener(ProgressEvent.PROGRESS,myloadmovie);
    nextFrame();
}

我的网站设计 web design home page
http://www.webdesign-cn.com
http://www.webdesign-china.cn
分享到:
评论

相关推荐

    【个人收集】as3实用小例

    AS3中的Stage3D API允许开发者利用GPU进行硬件加速图形渲染,提高性能。`AS3调用GPU渲染.txt`可能讲解了如何设置Stage3D上下文,创建显卡加速的图层,并使用星形几何、纹理映射等技术进行高效渲染。 4. **二维数组...

    bootloader基本概念及U-Boot启动过程

    stage1 Usually contains CPU-dependent code, such as device initialization code, which can be written in assembly language. Stage2 is usually written in C language, which can implement complex ...

    iPhone例子源代码 Code Sample : Lazy Table Images

    It begins by loading the relevant text from an RSS feed so the table can load as quickly as possible, and then downloads the images for each row asynchronously so the UI is more responsive.

    flash常用代码,欢迎大家下载

    在学习Flash编程的过程中,理解ActionScript的语法和对象模型,以及如何与舞台上的元素交互,是至关重要的。通过实践这些基本的代码示例,初学者可以逐步建立起对Flash开发的全面理解。在"flash代码积累"这个压缩包...

    最新ejschart ——javascript图形库

    The options described below affect the loading/initialization stage of the library. ejsc-src-path Specifies the base path of the EJSChart.js and other library files. Setting this option is sometimes ...

    pano2VR二次开发接口(API)相关说明

    该软件提供了一个强大的 API,允许开发者使用 Flash AS2 或 AS3 语言对全景图进行二次开发和自定义。 关于 Pano2VR 二次开发接口(API)的使用,需要具备 Flash AS2 或 AS3 语言的开发经验。该 API 提供了详细的...

    OFDMMIMOMATLAB仿真程序MIT研究人员贡献-MIMO_OFDM.rar

    the transmitter and receiver as well as adaptive modulation, OFDM proves to be robust against channel delay spread. Furthermore, it leads to signicant data rates with improved bit error performance ...

    Python-halo用Python实现一个漂亮的终端加载器

    with Halo(text='Loading...', color='cyan') as spinner: # 模拟一些耗时的操作 for _ in range(10): spinner.text = f'Loading... ({_+1}/10)' spinner.spinner = 'dots3' # 更改加载器样式 spinner.color = ...

    SSM2135 数据手册

    A unique output stage permits output swing approaching the rail under moderate load conditions. Under severe loading, the SSM2135 still maintains a wide output swing with ultralow distortion. ...

    二级减速器课程设计说明书reducer design specification.doc

    (3) in addition, it cultivates our ability to consult and use manuals, atlas and other relevant technical data, as well as the ability in calculation, drawing data processing and computer, aided ...

    Intelligent Adaptive Control: Industrial Applications

    3 Describing Vehicle Loading States 4 Fuzzy Reasoning 5 Simulation Experiment 6 Summary References Chapter 9—Intelligent Control of Air Conditioning Systems 1 Fuzzy Controlled Air ...

    Practical Mod Perl

    References Chapter 3. Installing mod_perl Section 3.1. Configuring the Source Section 3.2. Building mod_perl (make) Section 3.3. Testing the Server (make test) Section ...

    MySQL 5.6 Reference Manual

    Table of Contents Preface, Notes, Licenses . . . . . . . . ....1. Licenses for Third-Party Components ....1.1. FindGTest.cmake License ....1.2. LPeg Library License ....1.3. LuaFileSystem Library License ....

Global site tag (gtag.js) - Google Analytics