IdleSun's Weblog

August 27, 2011

How to make a TextView scrollable with a Scrollbar

Filed under: Android,Java,UI,XML — idlesun @ 8:08 am
Tags: , , , ,

 

This post has been moved to my new blog.

 

September 30, 2008

Embed a XML file in Flex

Filed under: Flex,XML — idlesun @ 6:40 pm

Although you can embed XML string in the Flex code, you would want to make it as a seperate XML file and use it. So that you can get the benefits of editing XML data using XML editor. One of the easist way I found to embed external XML file is use [Embed] metadata tag. Here is the sample code:

[Embed(source="test.xml")]
var testXml:Class;

function init(): void {
  var xml:XML = testXml.data as XML;
  Alert.show(xml.toXMLString());
}

It is really simple, isn’t it? However, this technique has a couple of limitations like:

  • XML file can not have a XML declaration line like “<?xml version=”1.0″ encoding=”utf-8″?>”
  • To use international characters, save XML file in Unicode not in UTF-8

Sample Source: click right button on this link and select “Save Link As” to download the file and rename its extension to “zip”

Blog at WordPress.com.