Link to home
Start Free TrialLog in
Avatar of hankknight
hankknightFlag for Canada

asked on

ActionScript: Syntax Error/Packages Cannot be Nested

I would like to use the attached ActionScript to encode and decode text.  When I try to include the code I get two errors:
              Syntax Error
              Packages Cannot be Nested
base62.fla
base62.as
Avatar of moagrius
moagrius
Flag of United States of America image

you don't use #include for packages in AS3.

remove that line from the timeline actions.

normally, a class like that would use static members, but apparently that's not the case, so you'd just create an instance and use it's methods that way.

var base62:Base62 = new Base62();

trace(base62.toNumber("whatever"));
Avatar of hankknight

ASKER

Thanks, but how should I include a packages in AS3?  My code does not work.  It should put the Base62 value for 'xyz' in the Dynamic Text named "encodedMessage"

But I don't think that the ActionScript is even being loaded.
import 'base62.as';
var Base62:Base62 = new Base62();
encodedMessage.text=Base62.toNumber("xyz");

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of moagrius
moagrius
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial