开发者

Making a image load before the preloader starts in Adobe Flash

Basically I have a background image which is loaded while开发者_JAVA百科 the rest of the flash file is loaded. So once the preloader has finaly appeared its already half way through which I dont want.

Is there a way I can specify a certain image to be loaded before everything else in the flash file and before the first frame to start?


You can either embed it in the swf:

AS3

[Embed(source='../images/background.jpg')]
private const _imageClass:Class;
...
var background:Bitmap = new _imageClass() as Bitmap;
addChild(background);

or preload it in your webpage since Flash uses the same cache as the browser.


Create a separate preloader flash file that first loads your image, then your main file. This preloader can be very small as it requires very little in the way of graphics.

You will also get a much more accurate preloader if you take this approach and use a library like Greensock's LoaderMax.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜