简体   繁体   English

在AS3 Flash Builder中为SWF创建预加载器

[英]Creating Preloader for SWF in AS3 Flash Builder

I'm a relatively new developer in AS3 using Flash Builder. 我是使用Flash Builder的AS3中相对较新的开发人员。 My objective is to create a quick/fast loading small SWF preloader for a larger (30mg) SWF application. 我的目标是为大型(30mg)SWF应用程序创建快速/快速加载的小型SWF预加载器。 I can't include the larger SWF inside the preloader, but I can use external interface calls to get jquery to tell me what the speed of internet the users are using and figure out how long it should take to load based on the size of the larger SWF. 我不能在预加载器中包含较大的SWF,但可以使用外部接口调用来获取jquery,以告诉我用户使用的互联网速度如何,并根据加载文件的大小确定加载所需的时间更大的SWF。

Right now, we have a large web application that takes around 5 mins to load if the client has a slow internet connection. 现在,我们有一个大型的Web应用程序,如果客户端的互联网连接速度较慢,则需要大约5分钟的时间来加载。 So, we wanted to use a small SWF preloader that will display a loading circle or loading bar, and display options if the SWF takes longer than 5 mins to load. 因此,我们想使用一个小的SWF预加载器,该预加载器将显示加载圆圈或加载条,并在SWF加载时间超过5分钟时显示选项。 Kind of like error handling. 有点像错误处理。 For instance, for Safari, sometimes the player actually has to click the SWF in order for it to load. 例如,对于Safari,有时播放器实际上必须单击SWF才能加载。 Is it possible to have a button on the SWF that will make it start loading?... Is it easier to create the preloader in jQuery? SWF上是否可以有一个按钮使其开始加载?...在​​jQuery中创建预加载器是否更容易? I'm just wondering if it's just going to create more issues using a SWF to load a SWF. 我只是想知道是否会使用SWF加载SWF来创建更多问题。 Any ideas?... 有任何想法吗?...

Any ideas on how to tackle this beast? 关于如何应对这种野兽的任何想法? I've read almost every article about preloaders but there is nothing that references preloaders created in Flash Builder. 我读过几乎所有关于预加载器的文章,但是没有任何文章引用Flash Builder中创建的预加载器。

I can't use Flash Professional or timeline. 我不能使用Flash Professional或时间轴。 It has to be in Flash Builder. 它必须在Flash Builder中。

So I tried to use the below tutorial and I wasn't able to actually get anything to appear when I test it. 因此,我尝试使用下面的教程,但是当我对其进行测试时,我实际上无法显示任何内容。 I'm getting an error at the "run()" function: 我在“ run()”函数中遇到错误:

Error: Error #2136: The SWF file http://local.myproj.com/MyProject.swf contains invalid data. 错误:错误#2136:SWF文件http://local.myproj.com/MyProject.swf包含无效数据。 at Preloader/run()[/Development/MyProject/src/Preloader.as:109] at Preloader/onEnterFrame()[/Development/MyProject/src/Preloader.as:46] 在Preloader / run()[/ Development / MyProject / src / Preloader.as:109]在Preloader / onEnterFrame()[/ Development / MyProject / src / Preloader.as:46]

References: http://fortheloss.org/how-to-preloader-in-flash-builder-4-7/ 参考: http : //fortheloss.org/how-to-preloader-in-flash-builder-4-7/

I worked until two years ago with a lot of these things and I know I have a few good scripts in my databases, but you are talking about Preloaded & activated loading were as in a preloader it is out of the hands of say a visitor what he or she can or cannot do, and in using a button (possible of course) the visitor has a choice to download or not! 直到两年前,我一直在处理很多这类事情,而且我知道我的数据库中有一些不错的脚本,但是您所谈论的是预加载和激活加载,就像在预加载器中一样,访问者无法控制什么。他或她可以做或不能做,并且通过使用按钮(当然可以),访客可以选择是否下载! From memory there was never really a lot published yet over years of using Flex Builder I have collected some good AS3 scripts and modified them (including a progress-bar - but without time Indicator) to download in web Apps. 从内存来看,使用Flex Builder多年来并没有真正发布过很多东西,我收集了一些好的AS3脚本并对其进行了修改(包括进度条-但没有时间指示器)以下载到Web Apps中。 or FLEX AIR etc. with AS3. 或带有AS3的FLEX AIR等。 The small problem would only be to adapt any of it from mx to fx depending on what FLEX Builder you use! 小问题只能是根据使用的FLEX Builder将其中的任何一个从mx修改为fx! I used my scripts mainly to download high resolution Images, Calendars, SWFs etc. with up to compressed 22 mB! 我主要使用脚本来下载分辨率高达22 mB的高分辨率图像,日历,SWF等! Anyway, if Interested I have to look up my FLEX databases & Application to get it to you! 无论如何,如果有兴趣,我必须查找我的FLEX数据库和应用程序才能将其提供给您! rgs Aktell rgs Aktell

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM