Book a Demo

Author Topic: Constructor in ActionScript  (Read 3496 times)

laschmoove

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Constructor in ActionScript
« on: July 04, 2006, 04:21:43 am »
Hi everybody,

I am not able to generate a default constructor for a class in Actionscript, allthough in the Object Options under Object Lifetimes the Generate Constructor box is checked.

Am I missing something?
Can anybody help?

Thanks in advance,
laschmoove

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Constructor in ActionScript
« Reply #1 on: July 04, 2006, 03:19:20 pm »
It looks like the class body template for actionscript does not use that option at all.

You can modify that tempalte yourself if you really want it added.
« Last Edit: July 04, 2006, 03:19:45 pm by simonm »

laschmoove

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Constructor in ActionScript
« Reply #2 on: July 04, 2006, 11:43:14 pm »
Thank you. I'll give it a try...
laschmoove

laschmoove

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Constructor in ActionScript
« Reply #3 on: July 05, 2006, 12:05:40 am »
Hi again,
here's another, I suppose related issue:

If I generate an interface in Actionscript, I always get a class and extending an interface results in an extends- keyword instead of an implements- keyword.

Again, I appreciate any advice...
laschmoove

laschmoove

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Constructor in ActionScript
« Reply #4 on: July 05, 2006, 04:37:12 am »
Hi there,

the class/interface/implements issue was due to wrong usage. Sorry.
For the constructor issue I added this:
Code: [Select]

%PI="\n\n\n"%
%if genOptGenConstructor == "T" and genOptGenConstructorInline != "T" and classHasConstructor != "T"%
\tfunction $consPrefix%className%()\n\t{\n\n\t}
%endIf%


to the Class Body code template. Seems to work fine. Maybe somebody'd like to do do the same.
Thanks for the help to help myself,
laschmoove