as3 loading screen

前端 未结 3 1705
旧巷少年郎
旧巷少年郎 2021-01-16 05:08

How do you create these \"loading, please wait\" splash screens with a loading bar and percentage for your swf? Does as3 have some built-in methods or should it be designe

3条回答
  •  被撕碎了的回忆
    2021-01-16 05:44

    There's a few different ways to do this.

    Either you can have a two step process - create a swf file that simply loads in the main file, reporting progress (by listening to the progress-event on the loader) and then adding the loaded swf as a child.

    Or, you can place all your content on frame 2, and stay on frame 1, checking the root.loaderInfo.bytesLoaded compared to root.loaderInfo.totalBytes values, reporting the percentage and then moving on to frame 2 when done.

    Personally, I think method 1 is better, since you don't need to sully yourself with frames.

    There is also a third way which uses some weird meta-data tags to simulate the second way, but without frames. It's a bit messy, but should be googleable.

提交回复
热议问题