Internet Commerce

Partners & Affiliates














Developer Channel

internet.com


Featured Flash FLA
Gallery Downloads 11373 Flash Movies | 1 New Flash Movies Added
What's New | Top 100

Featured FLA

» Author: adamiusz
» Title: Animated pageflip book
» Description: Animated page flip book basic pageflip.hu script
» More by adamiusz


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 5485 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

» Posted in the Flash Kit Links section
» Title: Creadirectory Link Indexing Solution
» Description: Creadirectory is a very powerful and highly customizable directory building solution. It allows you to build a fully branded, search engine friendly link indexing system similar to that of Yahoo! and Dmoz, but only at a fraction of their cost. Its features include: Adsense inclusion, Dynamic inclusion of Alexa images, Paypal integration, dynamic (.asp) or static (.html) URLs, Dynamic google sitemap generation, Unlimited number of categories and sub-categories, Unlimited number of listings, Customizable header and footer, Customizable colors, IP filtering system, Email configuration, Reciprocal link option.


Random Links | Add your own Flash Related Links
Flash Tutorials 1378 Tutorials 7 New Tutorials Added!
What's New | Top100

» CSS 3.0 animation features
» Making Chart & Flowchart of Annual Report Easily
» How to Export Many SWF to FLA at One Time on Mac?
» Building Software Training Assessment Easily
» Making Flash Photo Album for World Cup 2010
» How to make summer holiday travel photo gallery in flash
» Creating A Flash News Ticker Easily
» Embed flash video in website/blog
» How to convert video to flash for website or blog on mac?
» Unknown Tag: Title10
Random Tutorial | Add Site

Lead Web Developer
WATERFORD RESEARCH INSTITUTE
US-UT-Salt Lake City

Justtechjobs.com Post A Job | Post A Resume


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Dynamic_Content

Categories Halo 2 XML Application
Author: Lewis Cobley | Website: http://www.lewiscobley.co.uk |

 
Page 1
1

Begin with a new document and set the size to 800x600 pixels. In the 'Data Components' section of the 'Components' menu drag and drop an 'XMLConnector' anywhere on to the stage (it doesn't matter where you put it as it will be invisible when you run the application). Give the 'XMLConnector' a name, for this tutorial I used 'xmlcon'. Now in the 'Component Inspector' click the 'Schema' tab. Now we need to import the Halo 2 XML file into flash, to do this go to your Bungie.net stats page and there should be a orange image with 'XML' on it, Right click this and choose Save Target As, save this somewhere accessible to you. (If you do not have a Bungie.net account don't despair you can download mine by using this link, http://www.bungie.net/stats/halo2rss.ashx?i=5185&k=1745259161, Right click this and choose Save Target As, save this somewhere accessible to you. Now we have our XML file go back into flash and click the 'results:XML' text and then select the icon with a white box with a downward facing blue arrow in the right hand section of the 'Schema' section. When prompted locate the XML file we just saved and open it. There should now be 18 objects imported. Now click onto the 'results:XML' text again and change its 'read only' value to 'true', (this should change all the double pointed arrows to single pointed ones). Ok, now the first part of the XML has been configured, we will finish it off later. Now we can build the form itself. Start off by dragging a 'List' component and 4 'TextArea' components on to the stage. Re-size the 'List' to take up the upper left quarter of the stage, one of the 'TextArea' boxes to take up the lower half of the stage and the other 2 'TextArea' boxes in the upper right quarter. Chang the the instance names for the components to as follows:

'List' - game_list
'TextArea' in the lower half - game_description
'TextArea' in the top upper right quarter - main_title
'TextArea' in the middle upper right quarter - game_title
'TextArea' in the lower upper right quarter - game_link

Also change the 'html' value to true for the 'game_description' and the row height for the 'game_list' to '20'.Next to bind the XML to the form. Select the 'XMLConnector' and the 'Bindings' tab in the 'Component Inspector'. Click the little '+' sign to bring up a dialogue box, select 'title : String' under 'channel : Object' and click 'OK'. Now 'results.rss.channel.title' has been added to the list, click it and then double click the white box next to 'bound to', in this new dialogue box select 'TextArea, ' and then 'text : String', click 'OK' to confirm. Now select the '+' sign again, this time open 'item : Array', bind this to 'List, '. The next '+' add 'title : String' the one under '[n] : Object' tree, bind this to 'TextArea, '. The next one you need to add is 'link : String' also under '[n] : Object', bind this one to 'TextArea, '. And the final one to add is 'description : String', bind this to 'TextArea, '. Now we need to link the 'TextArea' boxes to the 'List' component, to do this we need to select each item in the 'Bindings' list with a '[n]' in it and the double click the white box next to 'Index for 'item'', in this box unselect the 'Use constant value' check box, now you can select 'List, ' and then 'selectedIndex : Number' and then 'OK'. Once this is done for all 3 'TextArea' boxes (not the 'main_title' box) we can finish the XML part off. Click the 'XMLConnector' again and there will be a box in the 'Properties' section called 'URL', now you would think to put the Bungie.net XML URL in there but don't, if you do the application will only work locally, not when it is uploaded online. It won't work because of a new feature in Flash Player 6 and 7 which requires the server hosting the XML feed (i.e. Bungie.net) to have a file called a 'Cross Domain Policy' which they don't, or at least won't add you to. So to overcome this we need to take the Bungie.net XML feed and output it into a new feed, keeping all the original data intact. This is done using a simple ASP template. Open 'Notepad' and paste this into it:

<%@language=vbscript%>
<%
dim strURL
strURL = "http://www.bungie.net/stats/halo2rss.ashx?i=5185&k=1745259161"

dim sxh
set sxh = server.createobject("MSXML2.ServerXmlHTTP.3.0")

sxh.open "GET", strURL, False
sxh.send

response.contenttype = "text/xml"

If sxh.status = 200 Then
response.write sxh.responseXML.xml
else
response.write ""
end if

set sxh=nothing
%>

(Note: Where if you are using your own Bungie.net feed replace my link on line 4 of the code]

Save the file as 'halo2rss.asp' in the same folder the flash file will be exported to.

Now back in flash enter in the 'URL' box in the 'XMLConnector' 'Properties' menu 'halo2rss.asp', and change the 'direction' to 'receive'.

Finally press 'Ctrl + Enter' to preview the application, the list box should display your (or my) recent games on Halo 2, when you click any of the games it will display the information for that game in the 'TextArea' boxes.

Well, that is that, you can now do your own customizations to the app to tailor it to your needs.

If you experience any proplems I will try to help as much as I can.

Here are some of the prople who made this all possible:
XML guide - FlashFAQ
JasonFollas at the ASP.NET forums - he provided the ASP code.
LuigiL at the Macromedia Support forums - he told me why the Bungie.net URL didn't work.

1

» Level Basic

Added: : 2005-08-10
Rating: 6.00 Votes: 4
Hits: 764
» Author
I am fairly new to Flash myself, but I will contribute to te community when I can.
» Download
Download the files used in this tutorial.
Download (0 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments