ActionScript 2.0 class scripts may only define class or interface constructs.

This is driving me nuts. I have an old AS1 project which I
upgraded to AS2. It uses an include file, settings.as, which has
stuff like this:
settings = new Object();
settings.property = 'some value';
Then I include it on the main timeline like this:
#include "settings.as"
Every time I render, I get a million and one Compile Errors
stating:
"ActionScript 2.0 class scripts may only define class or
interface constructs."
But it isn't an ActionScript 2.0 class! It's just a regular
include. How do I avoid the bogus Compile Errors?

Okay, I found why the compiler is getting confused.
In my settings.as file I create an object named 'settings' as
mentioned. Later in my code elsewhere on the timeline, I refer to
settings.property. When Flash sees that, I guess it sees that I
refer to an object 'settings' and that there's a .as file called
'settings' and it erroneously assumes it should be a class or
something. I concluded this because if I change the object or .as
name so that they do not match, the compile errors go away. As far
as I know there's no way to tell the compiler that settings.as is
not a class, despite the fact I'm not telling Flash that it is a
class.

Similar Messages

  • Error "You may only define methods within "CLASS class IMPLEMENTATION"

    We have code in LMIGOSMC so that the vendor batch number appears in the MIGO transaction for certain movement types.  We have created another, custom movement type in which this functionality should be available so I need to add it to LMIGOSMC.  When I go in and try to make the modification I am getting the following error:
    "You may only define methods within "CLASS class IMPLEMENTATION ...ENDCLASS".
    What am I doing wrong?

    Hi,
    You are not doing anything wrong with regard to the syntax error you are getting.  During the syntax check of include program LMIGOSMC, the system is not aware of the CLASS... ENDCLASS statements within the program LMIGOSM4.  Try the syntax check at the LMIGOSM4 program level (or even better, at the SAPLMIGO level) and you will see that the error is not given.
    Regards,
    Jamie

  • Restricting class access to only some classes.

    Hi Guys,
    I want my classes to be accessed by only my defined classes. Is it possible?
    Say I have public class defined test. I want that this class should be accessed by only the classes I want not by any other class by any mean. If somebody tries to access the class it should result in SecurityException. How can I do that???
    Thanks,
    Rajan

    maybe a package private class will do it, ie package the classes in the same package. define the particular class as protected, it will be visible to other classes in the package, the other classes maybe public.
    otherwise maybe it is an protected abstract class that the others extend?
    otherwise have this particular class take as arguments the other classes in overloaded methods?
    otherwise maybe a strategy pattern and default is a do nothing class (ie throws)?
    ...

  • Classes may only be defined in external ActionScript 2.0 class scripts.

    i try to use the BitmapExporter 2.2.
    i inserted the .as file into the first frame in my fla but
    when i try to test movie i get
    "Classes may only be defined in external ActionScript 2.0
    class scripts."
    since i am not expert in extensions - what did i do wrong and
    hoe can i properly use this extension?

    remove the .as file code from your fla. put the .as file in
    the same directory with your flash files. when you publish your
    swf, flash will incorporate the .as code in your swf when you use
    the new BitmapExporter() statement.

  • Specify the GUI declaratively in ActionScript like in JavaFX Script instead of MXML

    After reading a bit about JavaFX Script (which is actually remarkebly close to ActionScript 3) as a developer I thought the way one can specify the GUI declaratively in JavaFX Script via JSON-like notation for the components is pretty cool. It would be nice to have something like that in Flex/ActionScript too. The advantages I see over MXML are:
    1) a more compact notation than XML which is nice from a developers view point who actually writes this kind of code. Of course the idea would be that designers still design the GUI with graphical tools that generate this code but if you have to dive in and edit the code it's nice not to have to deal with verbose XML and I think even designers can easily understand JSON-like code; don't just assume that designers love XML because HTML was based on SGML! I'm not so sure if today many designers really still know raw HTML that well (like in 1997, the early days...). Server side developers probably know it better because they have to adapt it to jsp or asp or whatever framework.
    2) The fact that it's all ActionScript gives a seamless integration between just composing the components to form the GUI and adding scripts to add additionial behavior instead of mixing XML with actionscript code => no more need for those nasty CDATA blocks! It would also be easy for development tools like Flexbuilder to give a seamsless experience with code completion and zooming in on the code because it's all Actionscript! There's also no need for a separate expression language to tie the MXML to the underlying Actionscript. It would it also make easier to create custom components (not just simple composition components which is really easy in MXML) because you don't have to implement separate XML tags.
    here's a short JavaFX Script example:
    Frame {
    content: GroupPanel {
    var myRow = Row { alignment: BASELINE }
    var label_col = Column { alignment: TRAILING }
    var field_col = Column { alignment: LEADING }
    rows: [myRow]
    columns: [label_col, field_col]
    content:
    [SimpleLabel {
    row: myRow
    column: label_col
    text: "Type your text here:"
    TextField {
    row: myRow
    column: field_col
    columns: 50
    visible: true
    Note that this shouldn't be confused with programmatically specifying the GUI in Actionscript (which is possible today as an alternative to MXML). What I propose is at a (slightly) higher level: you don't give a detailed sequence of methods/functions to call to construct the GUI (i.e. HOW to do it) but just specify WHAT you want.
    Hopefully some Adobe Flex will see this and think about it. Although I think MXML is not too bad and I can live with it if I have to ;)

    I like that idea Sean. A standard and well-supported way to separate MXML and code would be good. I'd love to have builder support a MVC style triad for MXML files, with the
    model.as being simply an all-public-all-bindable class full of VOs and view-specific information, any view-manipulation and view<->app communications in the
    controller.as, and nothing but bindings and layour in the MXML. There's (almost) nothing stopping you doing this by hand at the moment, but it's a pain, and developers wouldn't stick to it for very long, when they need to create and maintain 3 separate files for that simple "error dialog" without a hand from Builder.
    Then again, I'd rather Adobe spent the time that would take on opening and better-documenting builder's APIs, so we can write our own plugins easily, but that's my greedy side- A standard builder-supported MVC pattern for custom MXML components would be aweseome for people that aren't me :)
    -Josh
    As for JavaFX, I don't care for it.
    On Tue, Sep 30, 2008 at 7:56 AM, Sean Christmann
    <
    [email protected]> wrote:
    A new message was posted by Sean Christmann in
    Developers --
      specify the GUI declaratively in ActionScript like in JavaFX Script instead of MXML
    Jason you bring up a good point on a concept that I think Adobe should
    poach from a different framework, Silverlight. In Silverlight the
    code-behind pattern is automatic and very nice to work with. Every
    interface can be composed of both a layout file and a script file, and
    they get composited into the SAME class at compile time. So you can
    have both a FileDialog.mxml and FileDialog.as file that know about each
    other automatically, without the need to subclass one from the other.
    Sean
    Jason Stafford wrote:
    A new message was posted by Jason Stafford in
    Developers --
      specify the GUI declaratively in ActionScript like in JavaFX Script instead of MXML
    Personally, I like the separation between the MXML and ActionScript.
    We're working on a large project, and so we have all the ActionScript
    separate from the MXML files.  For example we'll have something like
    filedialoglayout.mxml, and then
    filedialog.as that is a subclass of
    filedialoglayout.  All event handlers and the like are setup in the
    filedialog.as file - the mxml file doesn't know about any function names.
    Advantages:
    MXML files become layout only - and are more easily shared and worked on
    with non-technical people
    ActionScript is all in *.as files: no CDATA blocks and no FlexBuilder
    quirks where editing ActionScript inside a CDATA block doesn't work
    quite like in a real AS file.
    For simple experiments, and for learning, it's obviously nice to have
    everything in one mxml file, but in a big project like ours, the
    separation helps keep things clearer and more maintainable.
    Why use the mxml at all?  The MXML files are nice to edit with the
    visual editor in Flex Builder, and it's much easier to apply styles and
    embed assets in MXML than it is in pure ActionScript.
    I think two ways to talk about the same thing (XML and ActionScript) is
    already almost one too many - adding a third (JSON) would really be too
    much.
    Just my thoughts.
    -Jason Stafford
    Sean Christmann wrote:
    A new message was posted by Sean Christmann in
    Developers --
    specify the GUI declaratively in ActionScript like in JavaFX Script
    instead of MXML
    This reminds me of a certain workflow pattern that has emerged for us
    which might help provide some insight on this topic. I'm working on a
    project with a couple other developers which connects to a webservice
    for supplying clientside data. This data is available in both json
    notation and xml notation. The thing is, while the developers have
    overwhelmingly agreed that we should be consuming the json version
    since it can be parsed faster and provide more meaningful context for
    objects (ie strings vs ints vs arrays etc...), all these same
    developers rely exclusively on the xml notation when asking questions
    about the data or passing structures around to discuss.
    I see the same thing when looking at JavaFX and MXML. JavaFX might
    allow for more accurate structures and might be able to be compiled
    faster, but MXML is better for being self documenting even if it
    requires more verbosity.
    Sean
    Matt Chotin wrote:
    A new message was posted by Matt Chotin in
    Developers --
      specify the GUI declaratively in ActionScript like in JavaFX Script
    instead of MXML
    I'd be curious what other people think.  I see MXML as a distinct
    advantage over doing the pseudo-script stuff.  I really don't like
    the JavaFX system actually.
    Matt
    On 9/28/08 10:33 AM, "neo7471"
    <[email protected]> wrote:
    A new discussion was started by neo7471 in
    Developers --
      specify the GUI declaratively in ActionScript like in JavaFX Script
    instead of MXML
    After reading a bit about JavaFX Script (which is actually remarkebly
    close to ActionScript 3) as a developer I thought the way one can
    specify the GUI declaratively in JavaFX Script via JSON-like notation
    for the components is pretty cool. It would be nice to have something
    like that in Flex/ActionScript too. The advantages I see over MXML are:
    1) a more compact notation than XML which is nice from a developers
    view point who actually writes this kind of code. Of course the idea
    would be that designers still design the GUI with graphical tools
    that generate this code but if you have to dive in and edit the code
    it's nice not to have to deal with verbose XML and I think even
    designers can easily understand JSON-like code; don't just assume
    that designers love XML because HTML was based on SGML! I'm not so
    sure if today many designers really still know raw HTML that well
    (like in the 1997, the early days...). Server side developers
    probably know it better because they! have to adapt it to jsp or asp
    or whatever framework.
    2) The fact that it's all ActionScript gives a seamless integration
    between just composing the components to form the GUI and adding
    scripts to add additionial behavior instead of mixing XML with
    actionscript code => no more need for those naster CDATA blocks! It
    would also be easy for development tools like Flexbuilder to give a
    seamsless experience with code completion and zooming in on the code
    because it's all Actionscript! There's also no need for a separate
    expression language to tie the MXML to the underlying Actionscript.
    It would it also make easier to create custom components (not just
    simple composition components which is really easy in MXML) because
    you don't have to implement separate XML tags.
    here's a short JavaFX Script example:
    Frame {
        content: GroupPanel {
        var myRow = Row { alignment: BASELINE }
        var label_col = Column { alignment: TRAILING }
        var field_col = Column { alignment: LEADING  }
        rows: [myRow]
        columns: [label_col, field_col]
        content:
        [SimpleLabel {
        row: myRow
        column: label_col
        text: "Type your text here:"
        TextField {
        row: myRow
        column: field_col
        columns: 50
        visible: true
    Note that this shouldn't be confused with programmatically specifying
    the GUI in Actionscript (which is possible today as an alternative to
    MXML). What I propose is at a (slightly) higher level: you don't give
    a detailed sequence of methods/functions to call to construct the GUI
    (i.e. HOW to do it) but just specify WHAT you want.
    Hopefully some Adobe Flex will see this and think about it. Although
    I think MXML is not too bad and I can live with it if I have to ;)
    View/reply at specify the GUI declaratively in ActionScript like in
    JavaFX Script instead of MXML
    <
    http://www.adobeforums.com/webx?13@@.59b69b42>
    Replies by email are OK.
    Use the unsubscribe
    <
    http://www.adobeforums.com/webx?280@@.59b69b42!folder=.3c060fa3>
    form to cancel your email subscription.
    View/reply at
    <
    http://www.adobeforums.com/webx?13@@.59b69b42/0>
    Replies by email are OK.
    Use the unsubscribe form at
    <
    http://www.adobeforums.com/webx?280@@.59b69b42!folder=.3c060fa3> to
    cancel your email subscription.
    <div><div></div><div>
    Jason Stafford
    Principal Developer
    Inspiration Software, Inc.
    The leader in visual thinking & learning
    Now available - Kidspiration(r) 3, the visual way to explore and understand words, numbers and concepts.
    Learn more at
    www.inspiration.com/kidspiration.
    503-297-3004 Extension 119
    503-297-4676 (Fax)
    9400 SW Beaverton-Hillsdale Highway
    Suite 300
    Beaverton, OR 97005-3300
    View/reply at
    <
    http://www.adobeforums.com/webx?13@@.59b69b42/2>
    Replies by email are OK.
    Use the unsubscribe form at
    <
    http://www.adobeforums.com/webx?280@@.59b69b42!folder=.3c060fa3></div>
    </div> to cancel your email subscription.
    Sean Christmann | Experience Architect | EffectiveUI | 720.937.2696
    View/reply at
    specify the GUI declaratively in ActionScript like in JavaFX Script instead of MXML
    Replies by email are OK.
    Use the
    unsubscribe form to cancel your email subscription.
    "Therefore, send not to know For whom the bell tolls. It tolls for thee."
    http://flex.joshmcdonald.info/
    :: Josh 'G-Funk' McDonald
    :: 0437 221 380 ::
    [email protected]

  • Identifying APIs & user-defined classes

    I have a class name in a string variable. Is it possible to identify whether that class is a Java API or user-defined class ? Please note that the identification has to be done thru code not manually.

    There is no clear distinction between Java API and user defined classes. What I mean is there is no rule to limit user to use java.util as their package name and create their own classes like java.util.CustomCollection. Although that is not recommended at all, but nothing prevents it. There is sun.* package which implements most of the java.* classes, do you consider those Java API? And there are third party classes such as org.omg.* etc. All these classes including user defined classes are treated equally with the JVM.
    So there is no clear distinction. The only thing you can do is to define a list of class names you consider Java API.
    Why do you want to seperate them if I may ask? Since the JVM doesn't care.
    --lichu                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Cash Discount may only be granted up to 3%

    Hi Guys,
    Im new to FI. While posting an invoice in MIRO, we encounter an error "Cash Discount may only be granted up to 3%".  Payment term we are using has cash discount of 5%. I want to take out the limit of the cash discount, how will I do it? What transaction codes to be used? Thanks.

    this is held in tolerances
    This is in SPRO "Define Tolerances Vendors"
    You have groups, and the tolerance group is assigned to the Vendor

  • Defining Classes

    I posted this question in the JSP section but I didn't get enough attention. I thought I will post here and find if any help is on the way.
    I am trying to develop a sample banking application on the web.I have a basic question --> SOme of the products offered in this banking applications are checking account, savings accounts etc. Each products will be in diferent tables. While defing classes am I supposed to define Checking as a class and have all the fields in the table (atleast 200 fields are there in the checking table) as the variable. Hope I am not showing myself as a stupid. The basic question is in this scenario what is the logical way of defining classes.
    Thanks for your support.

    This is odd. I posted my reply to this yesterday
    (8/18) but right before posting this reply, the"Last
    Post" shows today's date, of just a few minutesago
    from now. Somehow this one magically got "bumped"to
    the top.I think that can happen when they delete
    threads/posts and users.
    /KajI don't believe this thread had been "invaded" by anyone else though. I believe I always had the one-and-only reply (until I replied today with reply #2). I have noticed that when replies are deleted on other topics, the "Last Post" has also been adjusted correctly, not to the current timestamp. This one is just funky.

  • Runtime error (already defined class)

    I get a runtime error which says:
    Class com.pictoflex.app.RecordPanel already defined in RecordPanel. It could be that your source file is not in the correct package..
    The package defined for that class is com.pictoflex.app, the source file is placed in the right directory, and there is only one class definition (public abstract class ... extends JPanel). What is wrong (probably something very stupid I didn't see)?

    Maybe you first compiled a RecordPanel class without package name, and now there exist two class files with the same name in different packages.

  • Class Data Sharing for User Defined Classes

    i am using jdk 5.0 . JDK 5.0 supports class data sharing for system level classes. Is there any way a class data sharing be done for a user defined class?

    Samantha10 wrote:
    Is this class data sharing possible for user defined classes also? i have a singleton class which i am invoking through a script. The script has been scheduled to run every 1 sec . Since it is being invoked every 1 sec hence the singleton pattern is failing . Hence if the this class data sharing is possible then the singleton pattern can be made applicable.If you have a single process and you have a single class loaded by two different ClassLoader instances
    in some respects they will be two different classes
    if (class1 instanceof class2.getClass())returns false.
    This is not the case for Java core classes because they are always loaded by the SystemClassLoader.
    You write you
    have a singleton class which i am invoking through a script. What approach to you use to invoke the singleton?
    I am trying to figure out if you launch a new JVM every second...
    Maybe you can use Nailgun.

  • User defined classes

    Hi,
    I need to create a project which requires the application to have user defined classes. I am thinking of creating a Timer class which is imported into the main application and shown on the screen. Is this what a user defined class is, by importing another made class into the main class of the application?
    Thanks for your help.

    There are two basic types of classes in Java, ones written by someone else, and ones written by you.
    The ones you write may use the ones other people write (like the classes that come with the SDK) or may use the other ones you write, or even better, both.
    In Java there is no concept of a "main application". But there is a static method in a class your write that you call "main" and is special because it's the method that gets called by the java runtime when you tell it to load your class. i.e., it's the starting point of your application. In fact, you can have many classes in your collection of classes that make up an application with a main method and you can have java start with any one of these classes.
    Hope this helps.

  • User defined class objects for a ADF component (button,inputfield)

    How do I define a user defined class object for ADF objects?
    My requirement is that when I do a modification to the class object, it should get reflectected to all the instances on my page.
    E.g:- I'm having class object clsInputField, and all my input fields in my pages are based on this object. So when I change clsInputField it should get reflected to all my controls based on this class object.
    Please help!!!

    Hi Timo,
    In our client server environment, we have a custom control for managing the zip code (used a Custom InputText field which extends the actual TextField) . All zip code specific validations are written in this custom class. In our application many of the pages uses this Custom component. So if any of the zipcode specific behaviour changes, we could implement this by only changing the Custom InputText field class.
    We need to implement this behaviour in our ADF applications. Please advise.
    Thanks,
    Vishnu

  • Message "You may only enter amounts up to" creating document in FB60

    Hi
    We are facing this message "You may only enter amounts up to VEF 10.000.000,00" when user is creating document in FB60, where do we check in SPRO to change the amount.
    Thanks in advance.

    Hi,
    That is probably the document tolerance for employees.
    Check the tolerance groups are maintained per company code in tx OBA4. Tolerance group <blank>  is used if you have not assigned specific tolerance groups to users.
    The 'Amount per document' is probably the issue here. System checks this againts total debits of the document.
    You may have assigned users to specific tolerance groups. Check that with OB57.
    You can find this in the IMG by searching for searching for  ''Define Tolerance Groups for Employees" and "Assign User/Tolerance Groups".
    Regards,
    Rob

  • Clone a user defined class..

    Hello all,
    just curious to know how can I copy/clone an instance of a class that I cant change/rebuild? I have gone thru the forums and I understand that to be able to clone a class-instance, the class itself should implement Cloneable or apply the deep-copy technique as mentioned in one of the JavaWorld pages but, as I said, what happens in a case where one has no access to the class code?
    however, if these are the only ways to have a user defined class cloned then, it should be possible to avoid a clone/copy situation... I dont know how. Does anyone else know?
    I have tried with few examples to understand what a shallow/deep copy is.
    the curiosity is terribly grown once I heard from one of my colligues that this is very much (easily) possible in c++ and delphi!!!
    please clarify. thanks in advance!

    Object.clone() is native and create a copy by ignoring all access checks (native code have access to everything by default), therefore copying all fields in the new object. All you have to do is implements Cloneable. Overload the method if you want it to be public and then just call super.clone() or if you don't want to copy everything you have to deal with it manually, copy all the fields you need. If you don't have access to all members you have to use reflection and suppress the access checks.

  • Step by step procedure to Define Class

    Hi Experts!!
    Anybody please tell me step by step procedure do develop the class.
    Thanks
    Anee

    Hi
    Classes are templates for objects. Conversely, you can say that the type of an object is the same as its class.
    components of the class describe the state and behavior of objects.
    Local and Global Classes: Classes in ABAP Objects can be declared either globally or locally. You define global classes and interfaces in the Class Builder (Transaction SE24) in the ABAP Workbench. They are stored centrally in class pools in the class library in the R/3 Repository.
    Local classes are defined within an ABAP program. Local classes and interfaces can only be used in the program in which they are defined.
    When you use a class in an ABAP program, the system first searches for a local class with the specified name. If it does not find one, it then looks for a global class.
    Apart from the visibility question, there is no difference between using a global class and using a local class.
    Certain restrictions apply when you define the interface of a global class, since the system must be able to guarantee that any program using an object of a global class can recognize the data type of each interface parameter.
    Defining Local Classes:
    A complete class definition consists of a declaration part and, if required, an implementation part.
       The declaration part of a class <class>
       CLASS <class> DEFINITION.  ... ENDCLASS.
    It contains the declaration for all components (attributes, methods, events) of the class.
    The declaration part belongs to the global program data.
    If you declare methods in the declaration part of a class, you must also write an implementation part for it. This consists of a further statement block:
         CLASS <class> IMPLEMENTATION. ... ENDCLASS
    The implementation part of a local class is a processing block. Subsequent coding that is not itself part of a processing block is therefore not accessible.
    REPORT  YSUBOOPS17  .
    CLASS c1 DEFINITION.
    PUBLIC SECTION.
    data : w_num type i value 5.
      methods : m1.
    ENDCLASS.
    CLASS c1 IMPLEMENTATION.
    METHOD M1.
      WRITE:/5 'I am M1 in C1'.
    ENDMETHOD.
    ENDCLASS.
    START-OF-SELECTION.
    DATA : oref1 TYPE REF TO c1 .
    CREATE OBJECT : oref1.
    write:/5 oref1->w_num.
    CALL METHOD : oref1->m1 .
    Defined in the global area of a local program :-
    CLASS <class name> DEFINITION.
    ENDCLASS.
    All the attributes , methods, events  and interfaces are declared here.
    Cannot be declared inside a subroutine/function module.
    Class definition cannot be nested.
    REPORT  YSUBOOPS17  .
    CLASS c1 DEFINITION.
    PUBLIC SECTION.
    data : w_num type i value 5.
      methods : m1.
    ENDCLASS.
    CLASS c1 IMPLEMENTATION.
    METHOD M1.
      WRITE:/5 'I am M1 in C1'.
    ENDMETHOD.
    ENDCLASS.
    START-OF-SELECTION.
    DATA : oref1 TYPE REF TO c1 .
    CREATE OBJECT : oref1.
    write:/5 oref1->w_num.
    CALL METHOD : oref1->m1 .
    Local class in a program is implemented as follows:-
          CLASS <class name> IMPLEMENTATION.
           ENDCLASS.
    Methods used by the class are described here.
    A class can be implemented
    At the end of the program( like subroutines).
    After the class definition.
    If the latter is adopted, one must then assign subsequent non-declarative statements explicitly to a processing block, such as START-OF-SELECTION, so that they can be accessed.

Maybe you are looking for

  • Can't view photos to load in book

    Am I missing something obvious here? this is my first time creating a book. After selecting a theme, I am only given the option of loading 1 picture into the book.I can't figure out how to view any pictures to load. I click on the blue 'view unplaced

  • Non Working 13 Character WEP Passwords

    I tried connecting my iPhone to my Wi-Fi network, that currently uses a 13 character password for its 128 bit WEP security. However, the phone keeps saying the password is incorrect, despite the fact that I have entered it correctly. I changed the pa

  • Codepage in SQL query?

    Trying to create a form in InfoPath and publish it to SharePoint. In the form one field receives the code, the rest on the basis of code filled by information from the SQL database. When filling out forms via InfoPath Filler on the client everything

  • Not all photos in icloud restore

    I have just restored my new iphone 5 to icloud but not all my photos have turned up. There are a few from a couple of years ago and some recent photos, but its still missing the ones inbetween.  How can i get these if possible??  This restore has tak

  • Problem printing since Yosemite update.

    We run iMacs on 10.10.2. We run an HP 55100 Photosmart printer wirelessly from a BT Home Hub 3. The iMacs run on an ethernet via a router. This has been working fine for a long time but since the most recent Yosemite update we can't print until we re