3 Replies Latest reply on Jan 28, 2007 5:09 PM by Newsgroup_User

    Tween/Transition import code gives a syntax error

    SuperRoach
      Basicly, I'm using Tweens and transitions, and am having trouble making them appear in some parts.

      On a multipage website, pasting in the code:
      import mx.transitions.Tween;
      import mx.transitions.easing.*;

      Gives me a syntax error for where the two lines appear. - This will make any transitions and tweens not appear (the two lines above need to be commented out for it to compile). However, when a page is loaded that contains the code (and gives no syntax error), the transitions and tweens in the first movie as well as the loaded clip all work fine.

      What would cause a synax error when trying to use the import code?
      The actual site itself you can see in progress at
      http://cressaid.brettjamesonline.com/us . The drop down menus just appear, until you load either the logos, corporate id or brochures section in folio. Then they smoothly roll down
        • 1. Re: Tween/Transition import code gives a syntax error
          Level 7
          SuperRoach,

          > On a multipage website, pasting in the code:
          > import mx.transitions.Tween;
          > import mx.transitions.easing.*;
          >
          > Gives me a syntax error for where the two lines appear.

          What's that error, word for word?

          > What would cause a synax error when trying to use the
          > import code?

          Could be anything. So far, it sounds as if you've narrowed it down to
          those two import statements, but until we hear what the error is, it's
          anyone's guess.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: Tween/Transition import code gives a syntax error
            SuperRoach Level 1
            I think I found the solution - which was to use Actionscript 2.0 in the publish settings. This got rid of the error, and made it work fine. What makes this a bit cloudy however, is all the other clips are actionscript 1 :o

            The exact error message for future reference incase anyone else gets this:

            **Error** Scene=Scene 1, layer=Code, frame=1:Line 16: Syntax error.
            import mx.transitions.Tween;

            **Error** Scene=Scene 1, layer=Code, frame=1:Line 17: Syntax error.
            import mx.transitions.easing.*;

            Total ActionScript Errors: 2 Reported Errors: 2
            • 3. Re: Tween/Transition import code gives a syntax error
              Level 7
              SuperRoach,

              > I think I found the solution - which was to use Actionscript 2.0
              > in the publish settings. This got rid of the error, and made it
              > work fine.

              Yes, that makes sense, then. You can look up these classes and
              keywords, by the way, in the ActionScript 2.0 Language Reference and
              Components Language Reference. Both sets of documentation indicate the
              availability of everything you look up. For example, the "import statement"
              entry says:

              Availability: ActionScript 2.0; Flash Player 6


              David Stiller
              Adobe Community Expert
              Dev blog, http://www.quip.net/blog/
              "Luck is the residue of good design."