You must be logged in to post Login Register
Search 

1084: Syntax error: expecting identifier before var. help me please

User Post

7:31 am
April 8, 2010


kaw.k

New Member

posts 1

1

I follow from this tutorial

http://tutorials.flashmymind.c…..lery-menu/ and It doesn't work and show that

1084: Syntax error: expecting identifier before var.

here is the code

//Import TweenMax
import com.
 
//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.05 * (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;
 }
 
}

Topic RSS 
Search