J'ai ce code que j'ai trouvé en ligne qui fait une galerie tournante infinie, maintenant mon problème est qu'en entrant dans le cadre il saute et trop vite. Je veux qu'il soit aussi rapide après avoir quitté le logo.Comment ralentir une animation dans AS3 sans diminuer le fps
Voici le code:
//Import TweenMax
import com.greensock.TweenMax;
//Save the horizontal center
var centerX:Number = stage.stageWidth/2;
//Save the width of the whole gallery
var galleryWidth:Number = infiniteGallery.width;
//Speed of the movement (calculated by the mouse position in the moveGallery() function)
var speed:Number = 0;
//Add an ENTER_FRAME listener for the animation
addEventListener(Event.ENTER_FRAME, moveGallery);
function moveGallery(e:Event):void {
//Calculate the new speed
speed = -(0.02 * (mouseX - centerX));
//Update the x coordinate
infiniteGallery.x+=speed;
//Check if we are too far on the right (no more stuff on the left edge)
if (infiniteGallery.x>0) {
//Update the gallery's coordinates
infiniteGallery.x= (-galleryWidth/2);
}
//Check if we are too far on the left (no more stuff on the right edge)
if (infiniteGallery.x<(-galleryWidth/2)) {
//Update the gallery's coordinates
infiniteGallery.x=0;
}
}
et est ici le demo »
merci mais je suis nouveau à tout cela chose actionscript serait vous pensez copier coller le code entier avec les changements. S'il vous plaît. –
Je suis nouveau à toute cette programmation. Pourriez-vous venir chez moi et faire mon travail/mes devoirs/mon projet? Kthxbye –
Merci, mais il y a une erreur Erreur de syntaxe: "else" est non-respecté –