Copy link to clipboard
Copied
Hi,
I upload a website and I have problems with the preloader did it in AS3. It starts after two or three minutes. I have a MC with an animation of 100 frames and the dynamic text of the percent. The preloader is located in the 1 frame to the 10, I mean, first frame with the actions and the other three layers (text, MC and background) with a lenght of 10. The movie has 525 frames. Here is the code:
stop();
addEventListener(Event.ENTER_FRAME, lodeando);
function lodeando(event:Event):void
{
var bytesTotales = stage.loaderInfo.bytesTotal;
var bytesCargados = stage.loaderInfo.bytesLoaded;
var porcentaje = Math.round(bytesCargados * 100 / bytesTotales);
textoPorcentaje.text = porcentaje + "% Cargados";
cargaAnimada_mc.gotoAndStop(porcentaje);
if (bytesCargados == bytesTotales)
{
removeEventListener(Event.ENTER_FRAME, lodeando);
gotoAndPlay(2);
textoPorcentaje.text = "";
removeChild(textoPorcentaje);
removeChild(cargaAnimada_mc);
}
}
Please, Could you help me?.
Copy link to clipboard
Copied
your preloader will start to display AFTER all embedded fonts are loaded and AFTER all items exported for use with actionscript are loaded unless you take specific steps to prevent those objects from loading in frame 1. ie, you must mark classes to export in a frame other than 1 (file>publish settings>swf>advanced as settings) and you must untick those library items you do not want to export in frame 1.
Copy link to clipboard
Copied
Thanks kglad, Please, Could you explain it more detailed?, I do not understand at all. Sorry. I go to file>publish settings> but there are not a swf>advanced as settings. In the settings are only the formats and flash tabs. I use a CS4 version. I change the frame 1 in export document class to 10 and the preloader takes a lot of time and it produces the following errors:
ReferenceError: Error #1065: No se ha definido la variable sprite3_4.
ReferenceError: Error #1065: No se ha definido la variable sprite2_5.
ReferenceError: Error #1065: No se ha definido la variable sprite3_4.
ReferenceError: Error #1065: No se ha definido la variable sprite2_5.
How can I untick those library items that I do not want to export in frame 1?.
Copy link to clipboard
Copied
you have to fix those errors, first.
click file>publish settings>swf and tick "permit debugging". retest.
the problematic line numbers that contain those undefined variables will be in the new error messages.
Copy link to clipboard
Copied
I did the export frame class to 10, ticked permit debugging and again the preloader is ok but still delays a lot from the main animation. How must I do to solve that?, Is it a problem of code?. Remember that it preload an animation of 525 frames.
Copy link to clipboard
Copied
if you did that correctly, the only delay (before the preloader appears) is the time it takes to download the assets used by the preloader. again, there are two panels where you must change the export frame: the advanced actionscript settings panel and (in possibly multiple places) in the library panel.
Copy link to clipboard
Copied
Kglad thanks, Where I must change the settings?, I did not find them. How I can change the library panel?. Can you attach a screen capture of those?. Is an error of the code?.
Copy link to clipboard
Copied
If I clicked the info in the library panel selecting the objects and ticked the export for action script and export to frame 2 there is an error that says that:
There are the following JavaScript errors
, however there are not appearing the fails.
Here are the screen captures:
ActionScript configuration:
Library information selecting objects except the preloader ones:
Copy link to clipboard
Copied
And Publish settings:
Copy link to clipboard
Copied
you're not exporting your needed library items. tick that exportar para actionscript box and tick to export in frame 10 for all items that need to be exported for use by actionscript.
Copy link to clipboard
Copied
When I did it (tick that exportar para actionscript box and tick to export in frame 10), I understood excluding the preloader objects, suddenly an error appears saying:
Have produced the following JavaScript errors
, and those not appear to know them.
Other thing the movie, after the preloader, starts in frame 10.
Copy link to clipboard
Copied
This is the JavaScript error window:
Copy link to clipboard
Copied
There is a thing that I do not have cleared, What I must export to ActionScript and frame 10?. The whole library or only the preloader items?. I can do it manually by clicking in Properties of each component of the library.
There are items that I do not edit the properties too export them such as the graphics. Is that correct?.
Copy link to clipboard
Copied
your preloader should not use anything exported for actionscript (including fonts).
Copy link to clipboard
Copied
Did you mean that I must export ActionScript and frame10 all the objects except the preloader folder?.
I did it and I totally destroy the website. I think that not all objects must be exported. Is that correct?.
Let me resume:
- Preloader in frames 1 to 10. Has a gotoAndPlay in frame (2)
- Animation in frames 10 to 525.
Publishing settings:
- Allow debugging ticked.
ActionScript settings:
Export class to frame 10 ticked, Is that correct?. If the preloader has a gotoANdPlay in frame 2 Why I must put this on 10?.
Is possible to send you the .fla to correct the preloader error via We Share service?.
Thanks again, and excuse me.
Should I export the same class as it is described in the various ActionScripts codes that I have in the website?.
I mean if it matchs as btn_oza I must put in the class the same.
Copy link to clipboard
Copied
Please kglad, help me.
I must to export all the objects that appear in the different ActionScript codes?, Including the pictures?.
Copy link to clipboard
Copied
anything you want to use in your preloader has to be exported in frame 1 where your preloader exists. anything not needed by the preloader should be exported in a later frame so it does not download and delay the appearance of your preloader.
Copy link to clipboard
Copied
These screen captures show the library of the movie. As you can see I export the most of them. However I have doubts about if I must convert to symbol the graphics. I have the preloader in the "presentación" folder without any exportation.
Please, Could you correct the website?. Please, tell me an e-mail address and I send you the website via WeTransfer.
Copy link to clipboard
Copied
you can send me an email via: http://www.kglad.com > contact.
Copy link to clipboard
Copied
Thanks for the reply. I mean a valid e-mail address from you to send the .fla file via WeTransfer service. Is right the screen captures?.
Copy link to clipboard
Copied
send me an email via my website and i'll reply so you have my email address without me exposing it or encrypting it here.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now