Syntax Highlighting library in ActionScript - apache-flex

I let user enter some code in my Flex3 (Flash 10) app and I want to do syntax highlighting.
Is there any open-source library that would help me?
I'll need a Lua syntax support, but I can add it myself if library has a resonable interface to do this.

Update on 21 Jan, 2009:
Check out Anirudh's port of google-code-prettify to ActionScript3, it has a very good example app as well.

I guess this wasn't even feasible till now.
With the new Flash Text Engine, maybe such text-based features will start showing up, and hopefully open source libraries that work like the FlashEff library.

I also wanted to do syntax highlighting, I found a example which works
http://labs.searchcoders.com/text/
You will need to take their actionscript code and when people change the text in your text area then you will need to re-draw the syntax highlighting.
Basically I am doing this as I'm making my own IDE/Language in FLEX.

Try this: http://www.flashtexteditor.com/ftf/
or this:
http://www.matthijskamstra.nl/blog/index.php/2008/06/04/actionscript-syntax-highlighting/

Related

Displaying Actionscript Documentation in Eclipse

This is probably a very basic question, but how does one enable the actionscript documentation to appear properly in Eclipse? For example, if you hover over addChild, the ASDoc view brings up the class hierarchy with flash.display.DisplayObjectContainer.addChild(child:DisplayObject):DisplayObject, but does not give any of the details, descriptive text, parameters, etc. If I write my own documentation using the /** */ format, it does appear in there. What have I done wrong? :P
I'm using the Helios version of Eclipse with Flash Builder 4. Thanks!
If you are talking about something like following:
then, it is available in Flash Builder. You might want to try it.

Few basic questions on flex/AS

Guys i have struggling with flex since a day or two.I havent found a nice short tutorials.Actually i also have been struggling with FLEX IDE too.Please indicate a nice good tutorials for this
I basically have questions like
Cannot use Alert in AS
Including a AS file in mxml file
org.com.structure and the as file in it.Why do we need to say pacakage org.com inside the as file
You can use flex Alert class. In pure AS, unlike JavaScript, there is no alert().
<mx:Script source="script.as"/>. But script.as will not know about MXML file, it's better to use class defined in as file as a control in MXML.
Because packages are compiler-enforced design decision, and who we are to discuss it.
Flex in a week!
http://www.adobe.com/devnet/flex/videotraining.html
This video series helped me a lot..

Change icon of Alert buttons

How do I change the icons to Alert buttons like OK, CANCEL etc?
If you look at the source code for Alert there really isn't a lot there once you get past the comments and properties. What I've done in the past is to just copy the Alert class and modify my custom version however I see fit. That way you don't have to deal with the mx_internal stuff. If you are using Flex 4, there is no spark version of Alert, so another thing you can do is create your own spark version, which will give you even more control over skinning your alerts using skins etc. Sounds like a big deal, but it's actually much easier than you'd think (speaking from experience here.)
Just specify the iconClass paremeter of the Alert class. A detailed example can be found here.
You can find a complete source code and application example here

Flex Text to Speech Program

I am developing a Adobe Flex Application which speeches some given text inside a text box.
Here am supposed to use an inbuilt function or something else, because I dont want to give an outside link to convert the text to speech since Internet connection will not be available.
Sample program written in Air are also applicable
Can any one post some sample code or link?
Thanks in Advance
I ported a HMM based TTS engine to Flash using the Alchemy compiler. Demos, explanation and code are here:
http://www.edobashira.com/2010/01/flitehts-engine-for-flash-hmm-speech_22.html
http://www.lvcsr.com/hts/
https://github.com/edobashira/Flite-hts_engine-for-Flash
I expect that the simplest way will be get some external executables and wrap them into Air or even rewrite in like http://labs.adobe.com/technologies/alchemy/ but look to platform you are oriented, the best choice will be MS TTS engine or something open source like Festival TTS engine.

How to design a text editor in QT?

I want to design a text editor in QT and planning to implement the following basic features,
1) Basic editing features like cut,paste,formatting,indentation etc.
2) Auto completion based on the context.(Based on some xml input file)
3) Syntax highlighting ( based on some xml input file )
Can you please suggest some approaches for the overall architecture/design?
How about:
Application Example
Completer Example or Custom Completer Example
Syntax Highlighter Example
All this things are stored in one single place, in you Qt SDK examples
This post is in 2015. NO DEAD LINKS
As #mosg mentioned.
In the menu bar. Go to Help > Index:
and in the search field look for:
Application Example
Completer Example
QSyntaxHighlighter
That would help you to begin.
If using Python is an option for you, you might find my Qt Text Editor example on GitHub useful. It uses PyQt5 (but you can also use PySide2) to implement a minimal text editor. Some screenshots:
It doesn't do formating, autocompletion or syntax highlighting but should still be a pretty good starting point. Maybe you can use QTextEdit and QSyntaxHighlighter to get these features.

Resources