Book a Demo

Author Topic: Actionscript inheritance/interface help  (Read 2889 times)

sunetos

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Actionscript inheritance/interface help
« on: February 08, 2006, 01:12:18 pm »
Hey, I need my generated AS2.0 code to do one of the following to compile correctly:

1) Fully qualify the package/namespace heirarchy of all class/interface names, such as:
Code: [Select]
class Data.HashMap implements Data.ICollection instead of
Code: [Select]
class Data.HashMap implements ICollection and
Code: [Select]
public function iterator(): Data.IIterator; instead of
Code: [Select]
public function iterator(): IIterator;

OR

2) Correctly realize which files need to be imported at the top of the class source file to resolve the namespaces, etc. of each class/interface:
Code: [Select]
import Data.ICollection;
class Data.HashMap implements ICollection


Either of these should work fine, but I would rather have the 2nd (since it's more flexible/powerful IMHO).  Any ideas?
« Last Edit: February 08, 2006, 01:40:54 pm by sunetos »

sunetos

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Actionscript inheritance/interface help
« Reply #1 on: February 09, 2006, 07:49:45 am »
Well, I ended up forcing it to always list all associated classes as imports by removing the conditional from the top of the "Import" template:

Code: [Select]
%if importInFile=="T" or importPackagePath=="" or importPackagePath==packagePath%
%endTemplate%


Apparently one of the last two conditional statements (I removed the first of the 3 and it didn't help) is false, causing it to never do any imports.  Not sure why this would be the case.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Actionscript inheritance/interface help
« Reply #2 on: February 09, 2006, 02:16:05 pm »
You've been busy, although I'm glad to know the actionscript support is being used.

I can answer both of your questions, and I prefer the second solution too.

1) Fully qualified names can be generated by using the 'qual' macros.
  • attType -> attQualType
  • opReturnType -> opQualReturnType
  • paramType -> paramQualType
  • linkAttName -> linkAttQualName
  • linkParentName -> linkParentQualName
2) The importPackagePath==packagePath condition appears to be wrong.  And would likely be causing the problem because at least for all of your examples the required package is the same as the package of the class being generated.

sunetos

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Actionscript inheritance/interface help
« Reply #3 on: February 24, 2006, 07:10:35 am »
Thanks, and again, the build 787 updates fixed all of my difficulties.