Volledige versie bekijken : AS3 Website slaat op pauze na preloaden
Elmo
%Europe/Berlin %604 %2009, 14:30
Hallo,
De website is (bijna) af, er hangt een preloader voor, alles in AS3.
En nu begint het probleem. Lokaal doet ie het goed maar zodra hij op de server staat dan hangt de website nadat de preloader de website heeft geladen. Rechtermuisknop en klik op play, dan gaat hij weer verder.
Dit is de tweede preloader die dat doet.
En in IE en Safari doet ie dit.
In Firefox doet ie het goed..
Iemand tips en suggesties?
URL: newsite.raspberryfilm.com (http://newsite.raspberryfilm.com)
Groet,
Martijn
niekheemskerk
%Europe/Berlin %683 %2009, 16:24
maby staan wat links hard linked naar locale dingen? bij mij gaat hij niet verder dan 1%.
wat gebruik je als preload script?
Elmo
%Europe/Berlin %695 %2009, 16:40
Ja klopt, als je dan rechtermuisknop doet en dan op play klikt gaat ie verder.
code van preloader.
MovieClip(parent).stop();
var total:Number;
var loaded:Number;
var percentage:Number;
loading_animation.gotoAndStop(1);
MovieClip(parent).loaderInfo.addEventListener (ProgressEvent.PROGRESS, content_loading);
function content_loading(event:ProgressEvent):void
{
loaded = event.bytesLoaded;
total = event.bytesTotal;
percentage = Math.round( loaded / total*100);
loading_animation.gotoAndStop(percentage);
loading_animation.numbers.gotoAndStop(percentage);
if(percentage == 100)
{
MovieClip(parent).play();
}
}
Nidd
%Europe/Berlin %625 %2009, 15:00
Hey,
En zo..?
percentage = Math.round((loaded / total) * 100);
Grtz!
Niels.
Elmo
%Europe/Berlin %667 %2009, 16:01
Maakt hier niets uit helaas.
Misschien bij jou? Ik heb de Engelse versie vernieuwd.
Update:
Ik heb nog eens wat zitten zoeken op inet.
Heb hierdoor het een en ander wat veranderd.
Dit is het huidige scripts:
// First we stop our main Flash movie, so we don't see anything else except what is in frame 1
//MovieClip(parent).stop();
stop();
//************************** Variables **************************************//
var total:Number; // this variable will hold the total kb of our flash movie
var loaded:Number; // this one will hold the actual loaded kb of our movie
var percentage:Number; // this variable just performs some basic math to get the loaded percentage instead of the loaded kb vs the total kb
// Now, we put our animation of the loading bar at the frame 1
// The animation consists of 100 frames, each one will be shown when that percentage is reached during the loading process
loading_animation.gotoAndStop(1);
//we need a listener to track the loading progreess
MovieClip(parent).loaderInfo.addEventListener (ProgressEvent.PROGRESS, content_loading);
//This variable is used to define the color of our preloader
/*var loader_color:ColorTransform = loading_animation.transform.colorTransform;
loader_color.color = selected_color;
loading_animation.transform.colorTransform = loader_color;*/
//This function is repeatedly called by the listener during the loading process
function content_loading(event:ProgressEvent):void
{
//update the variables each time we enter this function...
loaded = event.bytesLoaded;
total = event.bytesTotal;
//calculate percentage loaded
//percentage = Math.round( loaded / total*100);
percentage = Math.round((loaded / total) * 100);
//move the animation of the bar and the numbers according to the percentage loaded
loading_animation.gotoAndStop(percentage);
loading_animation.numbers.gotoAndStop(percentage);
//When the content is fully loaded...
if(percentage >= 100)
{
MovieClip(parent).play();
}
}
Ik heb:
MovieClip(parent).stop(); veranderd naar stop();
if(percentage == 100) veranderd naar if(percentage >= 100)
xolix
%Europe/Berlin %676 %2009, 16:14
Maakt hier niets uit helaas.
Misschien bij jou? Ik heb de Engelse versie vernieuwd.
taal zegt niet zoveel over de action script, wat het verschil is tussen:
percentage = Math.round((loaded / total) * 100);
en
percentage = Math.round( loaded / total*100);
is dat bij de bovenste eerst "loaded / total" word uitgevoerd voordat hij het vermenigvuldigt. en bij de onderste doet hij alles in 1x.
edit:
kan hij wel je "loading_animation" vinden?
this.loading_animation.gotoAndStop(1);
Elmo
%Europe/Berlin %685 %2009, 16:26
Hey Xolix,
this.loading_animation.gotoAndStop(1);
Doet inderdaad een hoop meer.
Alleen bij ons loopt het balkje niet vol.
Zou jij / zouden jullie eens willen kijken?
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.