Wednesday, August 02, 2006

Memo: Flash and XML

Dynamic Flash with XML

1. Create XML (generate with JSP)

jsp:
<%@ page contentType="text/xml" %> <?xml version="1.0" encoding="UTF-8"?> <itemlist> ... </itemlist>

2. Load the external XML into Flash (fla). Create swf
ActionScript:
myTest = new XML(); //create a new xml object myTest.ignoreWhite = true; //ignore whitespace myTest.load("sample.xml"); ...

3. Embed the swf (and set xml path) in HTML
HTML:
<object width="250" height="250" id="some_id"> <param name=movie value="test.swf"> <embed src="test.swf"> </embed> </object>

Bookmarks

1. JSP / XML 2. Flash

No comments: