More tutorial problems

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default More tutorial problems

    In another tutorial I get the following compile error:

    Error /tutorials/tutorial2.mxml
    A file found in an source-path must have the same package structure '',
    as the definition's package, 'samples.contact'.

    There is a file called Contact.as, but I don't know where it should be
    located to be in a flex classpath.

    The file tutorial2.mxml contains the line:

    import samples.contact.Contact;

    Anybody know how to solve this problem?

    Doug
    doug777 Guest

  2. Similar Questions and Discussions

    1. Tutorial environment problems
      I'm stuck on something basic. Running through CF Getting Started tutorial I could not connect successfully to Access db with standard Access...
    2. Coldfusion- problems with previewing pages of tutorial
      Hey, I'm a total newbie to Coldfusion (mostly working with Html and flash) and I've been following the tutorials for getting started (the...
    3. Blend problems with Adobe Tutorial
      I'm having a blending problem with one of the Illustrator tutorials. Instead of creating such a lengthy note here, I've explained my problem on my...
    4. [FLA MX] Map tutorial
      Hello I'm currently looking for a map tutorial under flash Mx (or 5) with possibility of zoom and scale it. thank you P.A.
    5. WZ2K Tutorial Update - Latest Dynamic Dreamweaver video tutorial
      Hi, The latest Dreamweaver video tutorial has been added this evening, covering the following techniques: Expanding the MySQL database...
  3. #2

    Default Re: More tutorial problems

    I think Contact.as must have its packge defined :
    package samples.contact {

    Does it? I am just getting used to this package concept myself.

    Tracy
    ntsiii Guest

  4. #3

    Default Re: More tutorial problems

    Yes you are right I think (can't be absolutely certain as I still have
    an error). Adding the mxml files to a correctly defined project (see
    below) gets rid of the error I had before.

    I am confused though about the difference between a project and a package.

    I have found that if I use the same name for an mxml file in different
    projects, any errors that occur in either file are all shown in the
    problems panel when either file is selected, and neither will run. Both
    generate a page can't be found error e.g. tutorial1.html cannot be found
    (followed by the location) whereas I can see that this file definitely
    does exist at this location. Deleting either of the files allows the
    other to run correctly.

    In the project definition, I had to change from the default server
    (default\flex) to default\samples - I think this is what the tutorial
    writer means when he talks about a 'samples web application'.

    For anyone else trying to follow these tutorials:
    Put the Contact.as file into a contact folder in the default\samples
    directory and then in that file and any other mxml file where it is
    mentioned, change samples.contact.Contact to just contact.Contact.

    However, I still have an error:

    In the completed1.mxml file downloaded from MM, there is the following code:

    public function changeHandler(event:ObjectEvent)
    {
    log.text = noteProxy.noteText;
    }

    This generates the error:

    Type was not found or was not a compile-time constant: ObjectEvent

    I think this tutorial was written for an earlier beta and has not been
    amended to reflect the changes in later betas. It looks as though there
    is no longer a type called ObjectEvent in beta3. Does anyone know what
    this should be changed to?

    Doug
    doug777 Guest

  5. #4

    Default Re: More tutorial problems

    I seem to have overcome the ObjectEvent problem by changing this type to
    Event. Whether this will ultimately work or not I don't yet know, as I
    still have a problem.

    In my last post I wrote:
    > I have found that if I use the same name for an mxml file in different
    > projects, any errors that occur in either file are all shown in the
    > problems panel when either file is selected, and neither will run. Both
    > generate a page can't be found error e.g. tutorial1.html cannot be found
    > (followed by the location) whereas I can see that this file definitely
    > does exist at this location. Deleting either of the files allows the
    > other to run correctly.
    The errors from two same named files from different projects all
    appearing in the problems panel for either file is NOT connected to the
    error 404 problem.

    I am still getting this problem and I think that although the required
    html file is at the location shown, it is derived from the server 'flex'
    whereas I think it should be using the 'samples' server.

    I have changed every server reference from flex to samples that I can
    find in the project properties and this has certainly allowed the file
    to compile with no errors, but it seems that something above the project
    level is still pointing the browser to the flex server.

    Does anyone know how to solve this problem?

    Doug
    doug777 Guest

  6. #5

    Default Re: More tutorial problems

    Having now read through most of the help files in Flex, I now understand
    what a project is and can see that it is nothing to do with packages
    which are just collections of classes.

    I also realize that the problems panel displays the errors in any file
    in any open project. I didn't know that you can close projects that are
    not being used to stop irrelevant errors showing up. (File/Close Project).

    These tutorials were I think not written for AS3, so I have stopped
    trying to get them to work.

    What would help a lot is a list of all the properties in AS2 that are
    not included in AS3 each with a list of the possible alternatives that
    could potentially serve the same purpose in AS3.

    For example in the 'Use ColdFusion Event Gateway Adapter' tutorial
    (which I would particularly like to get working) there is the following
    line:

    import mx.messaging.messages.Message;

    But there is no Message property in mx.messaging.messages in AS3. Anyone
    know what this should be changed to?

    In addition, the following lines generate a weird error:

    pro = new mx.messaging.Producer();
    pro.destination = "gateway1";
    pro.resendAttempts = 5;
    pro.resendInterval = 5000;

    resendAttempts and resendInterval are valid read/write properties of
    mx.messaging.Producer, and yet generate the error:

    Access of possibly undefined property resendAttempts through a reference
    with static type mx.messaging:Producer.

    and the same for resendInterval.

    destination, which is inherited from a superclass, does not error, yet
    it otherwise looks to be identical to the other two in the way it is to
    be used.

    Anyone know how to solve this error?

    Doug
    doug777 Guest

  7. #6

    Default Re: More tutorial problems

    P.S I have tried changing this (since the error implies that these are
    static properties):
    > pro.resendAttempts = 5;
    > pro.resendInterval = 5000;
    to this:

    mx.messaging.Producer.resendAttempts = 5;
    mx.messaging.Producer.resendInterval = 5000;

    but the error is unchanged.

    Doug
    doug777 Guest

  8. #7

    Default Re: More tutorial problems

    Check out this page ofr some good resources for migrating:
    [url]http://labs.adobe.com/wiki/index.php/Flex:Migrating[/url]

    Note especially the Migration Guide pdf, the Actionscript 2 to 3 comparison,
    and the Tips for Learning Actionscript.

    Tracy

    ntsiii Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139