Book a Demo

Author Topic: Issues / errors importing actionscript 3 source  (Read 9846 times)

goliatone

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Issues / errors importing actionscript 3 source
« on: February 21, 2008, 09:54:21 pm »
Hi there!
Im traying to import actionscript 3 source code to generate diagrams and i get the following error:

There was an error parsing D:\RECURSOS\FLASH\AS3\hiveFramework\src\org\hive\managers\Scene3DManager.as on line 27.  Unexpected symbol: class
It will also find unexpedted symbols with:
  • interface

public
import
[/list]
Any ideas?!

regards,
goliatone

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Issues / errors importing actionscript 3 sourc
« Reply #1 on: February 21, 2008, 10:15:15 pm »
Perhaps EA does not know you are working with AS 3. Open your modes - this option is scoped to each model - and on the Tools | Options | Source Code Engineering | Actionscript dialog check the default version setting. Click on the box to invoke a drop-down, and choose 3.0.

David
No, you can't have it!

goliatone

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Issues / errors importing actionscript 3 sourc
« Reply #2 on: February 21, 2008, 10:35:14 pm »
Hi David,
thnxs for your fast answer.

I do have AS3 selected as default version (3.0)

When i generate code, it does, more or less, export actionscript 3 class files.

More or less, because in all code generated there is a Class Model. added to any path generated in the code:
so, instead of having
import com.example.folder.Class.as
class com.example.folder.Class
its
import Class Model.com.example.folder.Class.as
class Class Model.com.example.folder.Class

I have to say that it adds that to code generated in both, as2 and as3. But i dont have isues to import code in as2.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Issues / errors importing actionscript 3 sourc
« Reply #3 on: February 22, 2008, 03:12:43 am »
Strange...

Perhaps you could send in a support request. I suggest you wait a day or two first - if you can bear the delay - to see if someone else knows the solution. Surely you're not the first to have seen this.

David

[AS is not really my forte, so I'll leave it to the other members to tell us what to do.]
No, you can't have it!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8088
  • Karma: +118/-20
    • View Profile
Re: Issues / errors importing actionscript 3 sourc
« Reply #4 on: February 22, 2008, 07:52:45 am »
Sounds like you didn't set Class Model as your namespace root.  See http://www.sparxsystems.com.au/EAUserGuide/namespaces.htm

Mode 7 James

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Issues / errors importing actionscript 3 sourc
« Reply #5 on: February 22, 2008, 12:53:00 pm »
Yup, I get the same error when trying to reverse engineer some external classes.  I haven't ever gotten it with "class" or "public" though, just "namespace".

@Simon - I don't quite understand that link you posted.  It deals with Java, which I'm not sure how Java handles namespaces or actionscript 3 handles namespaces.  AS2 doesn't have the namespace keyword.  Perhaps you can help discern if there is a difference with this example:

AS3 sample package:

package com.mode7.core
{
      import com.mode7.events.SlideShowEvent;
      import com.mode7.events.TransitionEvent;
      import flash.display.Sprite;
      import flash.events.Event;

      public class ImageControl extends Sprite
      {
            protected var model:SiteModel;
            protected var controller:SiteController;
            protected var view:SiteView;
            
            public var _WIDTH:int = 0;
            public var _HEIGHT:int = 0;
            
            public function ImageControl()
            {
                  super();
                  [highlight]use namespace[/highlight] image_global;

            }
      }
}

Currently AE is "workable" with its Actionscript 3 integration, however not that good.  I would be happier if the syntax was correct when exporting and importing, and round-tripping would be nice.

Oh, also, a place to put initial "include" code in each package definition.  Currently you can do that only when you export.  It doesn't stay with the package in the diagram.

-James

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8088
  • Karma: +118/-20
    • View Profile
Re: Issues / errors importing actionscript 3 sourc
« Reply #6 on: February 22, 2008, 02:52:36 pm »
The link that I sent doesn't just apply to Java.  It does apply to Actionscript and if you haven't done it you will get problems like what you have described.

Just try setting the package 'Class Model' in your code to a Namespace root.  It will solve that problem.  There have been some other issues fixed in the first beta of 7.1, and there will be a couple more in the second.

Mode 7 James

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Issues / errors importing actionscript 3 sourc
« Reply #7 on: February 22, 2008, 03:24:58 pm »
Ahh, thanks Simon.  That makes more sense now, I'll try that.

Currently I'm testing AE for the 30 day trial, to see if I should incorporate it into my workflow, is there a way I can test the beta of 7.1 with a trial code?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8088
  • Karma: +118/-20
    • View Profile
Re: Issues / errors importing actionscript 3 sourc
« Reply #8 on: February 22, 2008, 04:09:09 pm »
No, the current beta (as with most beta versions we release) is only available to registered users.  There may be a later beta build that is generally available but I can't promise anything.

If your trial had expired by the time 7.1 was release you would usually be able to get a trial extension. (But that's not my department so again I can't promise anything.)

Mode 7 James

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Issues / errors importing actionscript 3 sourc
« Reply #9 on: February 22, 2008, 04:27:14 pm »
Unfortunately I'm still getting the same error - "Unexpected symbol: namespace"

I did rename the Class Model to "image_global" as you suggested, however it appears that I can't name the namespace after the root, but rather I need to create a package first, which gives me a "image_global.image_global" namespace.  There's no way to edit this, that I can see.

Also, another odd thing, in that article it mentions the ability to right-click a namespace entry, allowing you to "Locate Package in Browser", along with clearing the attribute, however when I right-click nothing happens.

No worries about getting in on the beta, hopefully 7.1 can be released soon so I can test it out :)

goliatone

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Issues / errors importing actionscript 3 sourc
« Reply #10 on: February 22, 2008, 09:01:30 pm »
Quote
The link that I sent doesn't just apply to Java.  It does apply to Actionscript and if you haven't done it you will get problems like what you have described.

Just try setting the package 'Class Model' in your code to a Namespace root.  It will solve that problem.  There have been some other issues fixed in the first beta of 7.1, and there will be a couple more in the second.

thanks for the reply, i did solve the Class Model issue. Obviously, im still traying to figure out this great piece of software.

What about the unexpedted symbols with class, interface, and so on?

regards,
goliatone

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8088
  • Karma: +118/-20
    • View Profile
Re: Issues / errors importing actionscript 3 sourc
« Reply #11 on: February 25, 2008, 06:51:54 am »
Quote
What about the unexpedted symbols with class, interface, and so on?
I would hope that they were caused by the invalid 'Class Model' appearing in the code.  That error is shown at the first symbol that EA can't parse in any way and is very rarely the symbol that is actually causing the problem.

If it still occurs I would recommend sending in a sample file that you get the problem for.

goliatone

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Issues / errors importing actionscript 3 sourc
« Reply #12 on: February 25, 2008, 08:57:44 pm »
Well, i did set up the name space, and it still not importing as3...

I dont understand why before, it did import as2 files without issues but not as3 files.