I'm finally reading up on commenting code with ASDoc (http:url]....) but the way ASDoc is set up doesn't seem to agree with the way I write my getter/setters.Here is how I write them:
Code:
//I want to add the ASDoc tags here, before this chunk of code
private var _enabled:Boolean = true;
public function get enabled():Boolean[code]...
if I ad the tags where I want them, if I understand correctly, they will comment the private variable instead. Bummer.So, either I change the coding style I have been using for the past three years, or insert the tags inside of my code, making it ugly and less structured. I'm leaning towards option A.how do YOU write your getter/setters so they are ASDoc friendly?
Does anyone know if you can write your own pages that asdoc will recognize and use? For instance, I'd like to write some "Getting Started","Support" and "FAQ" kind of pages that will help understanding what my actionscript classes are about.
Does anybody know of a tool that will allow me to create ASDoc style documentation with a Flash CS4/AS3 application? From what I hear ASDoc only works with Flex.
My operation system is Window XP in Chinese. I'm running flex sdk > asdoc in command line. Asdoc picks up the system default language. How can I force it to be run in English language environment?
How do you add sample xml to asdoc function/class comments in Flex? They can obviously be added, but they wont show in the hover asdoc comments in Flash Builder 4. [code]...
I have a canvas based component, so when I check the asdoc comments, they have inherited comments of Canvas. can we remove that inherited comments, and add our own AsDoc comments..
I could sift through all HTML pages and write code that extracts the information, or even start from scratch and do the same for AS files, but I'd rather not.
I would like to use the ASDoc information from one set of classes in another SWF. Is there any way to export all the ASDoc information to XML format, or something that is easy to parse?
Is there a way to synthesize getters/setters in AS3? It's very common that you have a class with lots of variables, especially in math calculations (Model in MVC pattern), that you'd like to expose. Is there something like synthesize property in Objective-C, that allows to generate getters/setters?
Is there a way to use getters and setters for Vectors?Say, in my Main class, I would like to write
myVector.push(item);
and in another class, I have written:
public function get myVector():Vector.<int> { return _opponentCardList; } public function set myVector(myVector:Vector.<int>):void { _myVector = myVector; }
This doesn't really work as you have to set _myVector to a Vector. But what if you just want to push(), pop() or splice?
public class AbstractTarget extends Sprite [codee]................
And then I have a class called "Target" that extends AbstractTarget...how do I access the __movement property? Do I have to write the getter and setter in my Target class also and override both functions/methods?
I need to change a text field every time values in an array is updated, and I tried putting the code in the setter. However, the code is not being called. Even if I do this
public function set resources(value:*) { //this function does not seem to matter at all }
Nothing happens. I think AS3 overrides setters for arrays, how do I get the functionality other than inserting a changeTextFields(); every time I change the array?
I'm using the asdoc.exe program that came with Flex Builder 3 to generate documentation for FlashMOG. I want to put in my google analytics javascript before the closing body tag of each file. Is there some way to get asdoc to do this?
I'm running ASDoc to document my code. (The command line tool shipped with Flex that generates documentation of your code.)I'm running into a problem. I created a project targeting Flash Player 10 and the project compiles just fine in Eclipse, but when running ASDoc, one of the classes I use contains methods that are NOT available to flash players lower than Flash Player 10. Thus the ASDoc tool is generating an error, b/c it doesn't know I am targeting Flash Player 10.How do I tell ASDoc that I wish to target Flash Player 10?
I am trying to use AsDoc on the code of one of my projects in flash. Some of the classes that I use inside the code are "exported for actionscript" classes from my FLA file. Of course the AsDoc compiler complains that those classes are not defined anywhere. Does anyone know how to make it ignore these class types?
I want to add a comment to some elements in a Flex document, and process the comments using ASDoc. I can easily do this for the script portion, but I end up with a ton of ugly "This property can be used as the source for data binding." messages for each element I declared in Flex. Is there any way to embed a comment into a flex element so that it can be read by ASDoc? I have tried using the standard
<!-- -->
notation, but that didn't seem to work.
EDIT: The notation seems to be swallowed up as an HTML comment..
I am using ASDoc tool for action script3.0 using flash develop's document ation generator. I have also tried it using command line . I have included external swc library. The problem i am facing is..when i generate documentation than i will get following error
" Error: Type was not found or was not a compile-time constant: "...as far as i did some R&D , this is not a synatx error. I am guessing that ASDoc is not able to detect those classes oif SWC which i included in my project.
I've started using ASDoc to document my latest project. But for some reason, it will only document one package function per package. This means that it documents one function in my utils package and then skips all the others.
Has anybody here successfully documented a utils-like package, with a ton of package functions?
What's the best way around this problem with interfaces?
public interface ITest { function set testField(test:String):void; }[code]......
Test does have a setter for testField (an implicit one).I don't want to define an explicit one for every single field I have defined in my interface.There doesn't seem to be a way to define getters/setters in interfaces (or the syntax just escapes me).Do I have to do this explicit getter/setter nonsense in order to use interfaces in this way?
In the following: //track of whether the player has the key public function get hasKey():Boolean { return _hasKey; } public function set hasKey(keyState:Boolean) { //trace(keyState); _hasKey = keyState; } These functions don't even work until a value is passed to keyState in the set function correct? As you can see I did a trace keyState and the trace didn't return anything until it was true.
I've came across this compilation error a while ago.. As there's an easy fix and I didn't find anything relevant at the time, I eventually let it go.I just remembered it and I'm now wondering if this is really part of the language grammar (which I highly doubt) or if it's a compiler bug. I'm being purely curious about this -- it doesn't really affect development, but it would be nice to see if any of you have seen this already.
package view { import flash.display.Sprite; public class Main extends Sprite {
I have a class (Wall) that inherits from Sprite.Sprite already has width and height properties. But for wall, I need to do some other additional calculations when the properties change (f.e. make sure the new size won't cause it to overlap any other walls).So, how do I set the width property inherited from the Sprite class from within the width setter of the Wall? (or perhaps there is an alternative way to do my bounds checking whenever width is set?)[code]
The following code seems to create an ambiguity for the compiler (please see error commented near the bottom). Is it not possible to have getters and setters split between interfaces?
if getters and setters are the best option in a specific case. The case is when I have class 'A' instantiating classes 'B' and 'C'. Class A contains public getters and setters for classes B and C to access so data is centralised.Is this best practice or would it be best to pass the data to classes B and C through parameters?