display mxml tag as text - apache-flex

i am new to flex,i want to disply mxml code as a text on mxml page(i dont want to evalute mxml tag it should be display as text only).something like shown in below link
http://examples.adobe.com/flex2/inproduct/sdk/explorer/explorer.html
how can i do this?
thanks

You can always compile your project with the view source option enabled, and then your project code will be visible with out any additional fiddling.

Use a TextArea control and set its text property. If this text is properly indented, if will be shown as the example you refer to.
Note that you cannot just read the MXML code at runtime since it is compiled down to ActionScript code. You'll need to copy the code into a string.

Related

How to access the selected text in a Flex mx:HTML control

I am using mx:HTML to display HTML files. I want to get selected text like text area using selectionBeginIndex,selectionEndIndex.
I got solution using html loader
html.htmlLoader.window.getSelection();

Text Input Remove Button like Tag in Flex

In Flex Application how to add Remove tag ?
Another Ex: StackoverFlow Tags Section.. when type Fx then hit Space some image will be adding..
Just i want some suggestion....
use a library "flex-autocomplete" which is much useful for tag. you can change a skin of tag because you have full source code of it. you can take a demo of this library from here
http://flex-autocomplete.com/demo/#
you can download Source code of this library from here
http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&loc=en_us&extid=1721530
May this will help you..!
I think you can use a dataGroup for this purpose, add an itemRenderer in dataGroup.
and as JK Patel said add a textInput which have auto-complete functionality, add a BorderContainer for border styling around textInput. Bind a list of tags in datagroup.
here some help regarding dataGroup.
(http://help.adobe.com/en_US/flex/using/WS64909091-7042-4fb8-A243-8FD4E2990264.html)
search by yourself for more help...
here an other example.
(http://www.hufkens.net/2009/06/flex-4-datagroup-and-itemrenderers/)
Have a look in to this Auto complete component which looks same as what u want. Change the style to facebook in the drop down list
DEMO
Facebook like AutoComplete text input demo
SOURCE
Source
Developer site Hillel Coren AutoComplete

Qt can I drag and drop from widget to Qwebkit?

I'm developing simple HTML editor and I like to be able to drag and drop from a button that for example represent HTML text line and in the Qwebkit the HTML text line will be created does Qt support such action?
How should I approach such thing?
I believe it does, yes.
What you need to do is set the mime type of your drag event. See here for details. Then on the webkit side, you can read the drops mime type to see what it was.
You can then try one of the following approaches:
Subclassing QWebView to implement dragEnterEvent and dropEvent. You can use event->pos() in the dropEvent to get the position where the drop occured.
Implementing the drop in javascript within your page, eg setting up an event listener for drops or however its done (I've never tried this).

How can I display image and text within one AS3 datagrid?

The following page shows how to load external images in AS3 DataGrid: http://www.adobe.com/devnet/flash/quickstart/datagrid_pt3/ (image and text are displayed in two columns)
But I wonder how the image and text can be loaded together within the same DataGrid. Within one column: Image followed by the text.
I cannot get it work so I'd be grateful for any help with examples. Thanks
You just have to write a custom CellRenderer that does it. If you really read and understand that page you linked, they explain how to make custom CellRenderers, and you can put whatever you want in a cell. An image with text, a button, a game of tetris, whatever.

Flex: RichTextEditor -- get and set RICH Text?

Given a rich text editor, I want to save the "rich" text to a database, and load it later.
So how can I get and set the rich text?
I looked at the API and there is a property called text which is only PLAIN text, not what I need. There is another property called textSnapshot which sounds like maybe thats what I need to use, but its READ-ONLY so I can't set it?
Is there a way to do this?
Thanks!
UPDATE
It turns out I am only going to save it from a RichTextEditor, and I need to set it has htmlText on a Text control,
so is there a way to get the rich text and convert it to hmtlText?
I'm not sure what you mean by rich text. The htmlText holds all the informations which the components use for rendering the HTML text, and which is also the base of the RichTextEditor rendering. You can get and set it, and that's exactly what you need to store in the DB and put the text back after retrieving it. There's no export it as rtf out of the component. It's rich in the sense that it's more than a simple textInput :)

Resources