Skip to main content
May 24, 2010
Answered

Missing right paren and left brace

  • May 24, 2010
  • 2 replies
  • 3348 views

Hello !

I can't rid of  :

1084: Erreur de syntaxe : rightparen est attendu devant semicolon.

1084: Syntax error : expecting rightparen before if

1084: Syntax error : expecting rightbrace before leftbrace

The code :

import fl.transitions.Tween;

import fl.transitions.easing.*;

var tween:Tween = new Tween(texte, "y", Strong.easeOut, 0, 0, 30);

var tween:Tween = new Tween(texte2, "y", Strong.easeOut 0, 0, 60);

tween.stop()

var urlLoader:URLLoader = new URLLoader()
urlLoader.addEventListener(Event.COMPLETE, completeXMLHandler)
function completeXMLHandler(evt:Event)
{
var xml:XML = new XML(evt.target.data)
texte.texte.htmlText = xml.descendants("texte")[0].text()
texte2.texte2.htmlText = xml.descendants(("texte2")[0].text()
if(texte.height>masque.height){
if(texte2.height>masque2.height){
stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler)
}
}
urlLoader.load(new URLRequest("xml.xml"))
texte.texte.autoSize = TextFieldAutoSize.LEFT
texte2.texte2.autoSize = TextFieldAutoSize.LEFT
texte.y = masque.y
texte2.y = masque2.y
texte.mask = masque
texte2.mask = masque2
function mouseMoveHandler(evt:MouseEvent)
{
/*on recupere la position de la souris par rapport au masque*/
var p:Number = (mouseY-masque.y)/masque.height
var p:Number = (mouseY-masque2.y)/masque2.height
if(p<0)p=0
if(p>1)p=1
tween.continueTo(masque.y-p*(texte.height - masque.height),30)
tween.continueTo(masque2.y-p*(texte2.height - masque2.height),30
}
Part of the code must be bad... but I'm not able to fix it !
I have two texts... A mouse scroll animation is added based on the mouse position... So, I can scroll through all text...

Message was edited by: danae830

This topic has been closed for replies.
Correct answer

Additionally, there is no coma in the second tween declaration, after Strong.easeOut


2 replies

Correct answer
May 24, 2010

Additionally, there is no coma in the second tween declaration, after Strong.easeOut


Inspiring
May 24, 2010

your function completeXMLHandler doesn't close.

inside that function, you have 2 if's - nested one inside the other, both of them have a closing '}', but your function doesn't have a closing '}', hence the errors you recieve.

eRez

May 24, 2010

Thanks for your answer but it still doesn't work...

Inspiring
May 24, 2010

in order for you code to work it should look like this:

import fl.transitions.Tween;
import fl.transitions.easing.*;

var tween:Tween = new Tween(texte, "y", Strong.easeOut, 0, 0, 30);
var tween1:Tween = new Tween(texte2, "y", Strong.easeOut, 0, 0, 60);

tween.stop()
var urlLoader:URLLoader = new URLLoader()
urlLoader.addEventListener(Event.COMPLETE, completeXMLHandler)
function completeXMLHandler(evt:Event)
{
    var xml:XML = new XML(evt.target.data)
    texte.texte.htmlText = xml.descendants("texte")[0].text()
    texte2.texte2.htmlText = xml.descendants("texte2")[0].text()
    if(texte.height>masque.height)
    {
        if(texte2.height>masque2.height)
        {
            stage.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler)
        }
    }
}
urlLoader.load(new URLRequest("xml.xml"))
texte.texte.autoSize = TextFieldAutoSize.LEFT
texte2.texte2.autoSize = TextFieldAutoSize.LEFT
texte.y = masque.y
texte2.y = masque2.y
texte.mask = masque
texte2.mask = masque2
function mouseMoveHandler(evt:MouseEvent)
{
    /*on recupere la position de la souris par rapport au masque*/
    var p:Number = (mouseY-masque.y)/masque.height
    var p:Number = (mouseY-masque2.y)/masque2.height
    if(p<0)p=0
    if(p>1)p=1
    tween.continueTo(masque.y-p*(texte.height - masque.height),30)
    tween1.continueTo(masque2.y-p*(texte2.height - masque2.height),30)
}

first - why did you give to both of your tween objects the same name?

in the line -

texte2.texte2.htmlText = xml.descendants("texte2")[0].text()

there was a redundant '('.

and in the line -

tween1.continueTo(masque2.y-p*(texte2.height - masque2.height),30)

there was a missing ')' (i've also renamed the tween object to 'tween1')

that should do it i think