Welcome to WebmasterWorld Guest from 54.226.238.178

Forum Moderators: open

Message Too Old, No Replies

Frustrating error message when importing classes

     
6:56 pm on Jul 16, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:Nov 24, 2006
posts: 193
votes: 0


Sorry to be back in here asking questions again so soon, but I can't for the life of me figure out why I can't get this code to work (I'm using Flash CS3):


import mx.transitions.Tween;
import mx.transitions.easing.*;
new Tween(hntitle_mc,"_y",Elastic.easeOut,hntitle_mc._y,181,15,false);

I keep getting syntax errors for the lines of code importing my classes but don't know how to change it to reference these classes correctly.

Apologies if this is a stupid question, I have tried looking at the directory struct. in the Adobe app folder and using that as my directory path...

8:55 pm on July 16, 2008 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
posts:7999
votes: 0


Couple things to check, whether or not they will help, don't know. :-)

Make sure your publication settings are set for AS3, not AS2. It's possible (probably?) the class you're using is AS3. If it's set for AS2, it wil do nothing or error.

Second, the class files need to be either in the same directory or in the directory path you specify. When uploading, make sure this structure remains consistent. So I **THINK** this

import mx.transitions.Tween;

Means you have a directory in the same directory as your fla/swf named mx, which contains a directory transitions, which contains the class Tween.as.

directory/mx/transitions/Tween.as

9:51 pm on July 16, 2008 (gmt 0)

Junior Member

5+ Year Member

joined:Nov 24, 2006
posts:193
votes: 0


rocknbil, you're a ninja.

It was the publication settings that were on AS1 not AS2.

Muchos thankos