all groups > flash data integration > february 2006 >
You're in the

flash data integration

group:

Hyperlink & XML Connector


Hyperlink & XML Connector jenderrick402
2/27/2006 5:38:49 PM
flash data integration:
Background: I am using the xmlConnector component to load the title of pdf
articles into a list component. Besides a title tag, my XML document also
contains a link tag that holds the path to the pdf document.


Question: How do I make pdf titles hyperlink so that when the user clicks on
the title, the pdf document opens in a new window.


<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet href="manuals.xsl" type="text/xsl"?>
<content>
<manuals>
<title>NobelEsthetics&#8482;</title>
<subtitle>
including Procera&#174;</subtitle>
<link>Manuals/1_Esthetic_Man_2005_GB_C11.pdf</link>
</manuals>

<manuals>
<title>NobelGuide&#8482;</title>
<subtitle>
perfect planning for perfect teeth</subtitle>
<link>Manuals/2_GSNBConc_16161_GB_C19_2.pdf</link>
</manuals>

<manuals>
<title>Br&#229;nemark System&#174;</title>
<subtitle>
Groovy</subtitle>
<subtitle>
Shorty</subtitle>
<link>Manuals/BS_Speedy_GRSH_15136_GB.pdf</link>
</manuals>

<manuals>

<title>Br&#229;nemark System&#174; Mk III</title>
<subtitle>
Groovy</subtitle>
<subtitle>
Shorty</subtitle>
<link>Manuals/BS_Speedy_GRSH_C12.pdf</link>
</manuals>

<manuals>
<title>Dental Laboratory</title>
<link>Manuals/DentTechMan_GB_final.pdf</link>
</manuals>

<graphics>
<spacer>Images/DesignElements/spacer.gif</spacer>
<top>Library/Topgraphic.lbi</top>
<navbar>Library/Navbar.lbi</navbar>
</graphics>

</content>
Re: Hyperlink & XML Connector methlor
3/1/2006 4:39:01 PM
I'm working on an identical endeavor but going at it from a different angle.
I'm using attributes instead of nodes as in the example below :

<pdfs>
<file Location="Alabama" url="Alabama/AL - Albertville 3-7-05.pdf"
Code="Alav305" Subject="Registration Required"/>
<file Location="Alabama" url="Alabama/AL - GADSDEN 703.pdf" Code="Algad0703"
Subject="Registration Required"/>
</pdfs>

I have a DataGrid component (labled DG1) on the stage and the actionscript at
the bottom of this message:

The problem is that I want the "Code", "Location" and "Subject" columns to be
visible and the "url" column to be invisible. As it stand now, I can only get
the "Code" and "url" column to show up at all and still maintain the ability to
click on a row and pull up the resultant PDF.

This should address your immediate concern, but do you (or anyone else - help
me out here folks!) know of a way to manipulate the data so that we can get our
other columns visible?

methlor@yahoo.com

ACTIONSCRIPT
-----------------------



var memoList:XML = new XML();
memoList.ignoreWhite = true;
memoList.load("MemoListing.xml");

memoList.onLoad = function() {
var pdfs:Array = this.firstChild.childNodes;

for(i=0;i<pdfs.length;i++) {
DG1.addItem(pdfs[i].attributes.Code, pdfs[i].attributes.url);
}

}

var memList:Object = new Object();

memList.change = function() {
getURL(DG1.getItemAt(DG1.selectedIndex).data,"_blank");
}

DG1.addEventListener("change", memList);
Re: Hyperlink & XML Connector fman05
3/2/2006 10:14:24 PM
To answer jenderrick402's question...

If all the files are located in the same local, which it looks like they are,
I would use a little action script. I user the following to open a PDF in a
new window when ever someone selects the title from the list box.


yourList_lb.addEventListener("change", loadPDF);

function loadPFD():Void{
var link:String = links_lb.selectedItem.data;
getURL("http://www.yourdomain.com/" + link, "_blank");
}

Re: Hyperlink & XML Connector fman05
3/2/2006 10:16:24 PM
AddThis Social Bookmark Button