A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: XML / a href / flash

  1. #1
    Junior Member
    Join Date
    May 2012
    Posts
    2

    XML / a href / flash

    Hey, I already read some posts with help on getting A href links in flash, but it won't work for me. Hopefully you can help me.

    XML CODE (shortened):
    Code:
    <RelationViewerData>
    <Settings appTitle="Relation browser: Disease Relation Finder" WWWLinkTargetFrame="_blank" startID="Kinase" defaultRadius="150" maxRadius="180">
    <RelationTypes>
    <UndirectedRelation color="0x85CDE4"/>
    </RelationTypes>
    <NodeTypes>
    <Node/>
    </NodeTypes>
    </Settings>
    <Nodes>
    <Node id="cAMP" name="cAMP">
    <![CDATA[
    <a href='http://www.google.nl' target='_blank'>9574934</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>1322896</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>9427384</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>22356915</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>11930017</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>22356915</a>5pt; PDE <a href='http://www.google.nl' target='_blank'>15357210</a>5pt; Kinase <a href='http://www.google.nl' target='_blank'>15357210</a>5pt; PDE <a href='http://www.google.nl' target='_blank'>15357210</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>15563461</a>5pt; PDE <a href='http://www.google.nl' target='_blank'>17142316</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>17167070</a>5pt; PDE <a href='http://www.google.nl' target='_blank'>11930001</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>11930001</a>5pt; PDE <a href='http://www.google.nl' target='_blank'>1322896</a>5pt; PDE <a href='http://www.google.nl' target='_blank'>9427384</a>5pt; PDE <a href='http://www.google.nl' target='_blank'>9574934</a>5pt; Kinase <a href='http://www.google.nl' target='_blank'>10637587</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>10637587</a>5pt; PDE <a href='http://www.google.nl' target='_blank'>11134002</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>11134002</a>5pt; PDE <a href='http://www.google.nl' target='_blank'>11334934</a>5pt; Kinase <a href='http://www.google.nl' target='_blank'>11733015</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>11930001</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>22356915</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>11334934</a>55pt; PDE <a href='http://www.google.nl' target='_blank'>20693305</a>55pt; PDE <a href='http://www.google.nl' target='_blank'>11930017</a>55pt; PDE
    ]]>
    </Node>
    <Node id="inhibitor" name="inhibitor">
    <![CDATA[
    21275055; 5pt; Disease 22545171; 5pt; Disease 3103442; 5pt; Disease 9427384; 5pt; PDE 9521128; 5pt; Kinase 9574934; 5pt; Kinase 9642090; 5pt; Kinase 9662024; 5pt; Kinase 9675273; 5pt; Kinase 9841878; 5pt; Kinase 10092479; 5pt; Disease 3938090; 5pt; Disease 10376993; 5pt; Kinase 10571254; 5pt; Disease 10608797; 5pt; Kinase 10637587; 5pt; cAMP 10743606; 5pt; Kinase 9228559; 5pt; Disease 8663209; 5pt; Disease 7479764; 5pt; Disease 3108836; 5pt; Disease 3143491; 5pt; Disease 2118325; 5pt; Disease 2290444; 5pt; Kinase 2005184; 5pt; Disease 1857383; 5pt; Kinase 1322896; 5pt; PDE 8347171; 5pt; Disease 8224086; 5pt; Disease 7731973; 5pt; Disease 7608181; 5pt; Kinase 7575676; 5pt; Disease 3830152; 5pt; Kinase 7488235; 5pt; Disease 10956223; 5pt; Disease 10980453; 5pt; Disease 11055585; 5pt; Disease 12615312; 5pt; Disease 12814651; 5pt; Disease 12899835; 5pt; Disease 14506274; 5pt; Kinase 15273104; 5pt; Disease 15465048; 5pt; Disease 15468531; 5pt; Disease 15544466; 5pt; Disease 11733015; 5pt; cAMP 16321980; 5pt; Disease 16392806; 5pt; Disease 16887207; 5pt; Disease 16949574; 5pt; Kinase 17012768; 5pt; Disease 17126803; 5pt; Disease 12106872; 5pt; Disease 11930017; 5pt; cAMP 11063610; 5pt; Kinase 11080591; 5pt; Kinase 11080591; 5pt; Disease 11137702; 5pt; Disease 11134002; 5pt; cAMP 11163436; 5pt; Kinase 11286798; 5pt; Disease 11348531; 5pt; Disease 11353848; 5pt; Disease 11465068; 5pt; Disease 11737216; 5pt; Kinase 11930001; 5pt; cAMP 11930001; 5pt; Disease 11356520; 55pt; Disease 22023548; 55pt; PDE 21886855; 55pt; Kinase 11930017; 55pt; PDE 21859303; 55pt; PDE
    ]]>
    </Node>
    <Node id="Kinase" name="Kinase">
    <![CDATA[
    <a href='http://www.google.nl' target='_blank'>16890941</a>105pt; inhibitor <a href='http://www.google.nl' target='_blank'>20529682</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>11072827</a>30pt; cAMP <a href='http://www.google.nl' target='_blank'>21349219</a>30pt; Disease <a href='http://www.google.nl' target='_blank'>11733015</a>30pt; cAMP <a href='http://www.google.nl' target='_blank'>11733015</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>20819953</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>18005706</a>30pt; Disease <a href='http://www.google.nl' target='_blank'>18387804</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>9041340</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>8631899</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>2693021</a>30pt; cAMP <a href='http://www.google.nl' target='_blank'>15458814</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>21629723</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>1640387</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>8325329</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>8134768</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>7527048</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>17154500</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>18644955</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>19207727</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>19320832</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>16949574</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>19346560</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>19707572</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>22070162</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>21483717</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>21483717</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>21349219</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>21187682</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>21187682</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>20642432</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>22442154</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>20231285</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>20228202</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>19750216</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>15357210</a>5pt; cAMP <a href='http://www.google.nl' target='_blank'>15357210</a>5pt; PDE <a href='http://www.google.nl' target='_blank'>15357210</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>9841878</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>9747975</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>9675273</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>9662024</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>9642090</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>9574934</a>5pt; cAMP <a href='http://www.google.nl' target='_blank'>9574934</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>9521128</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>7608181</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>1857383</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>2290444</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>10376993</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>10583863</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>10608797</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>14506274</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>12687015</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>12426089</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>11737216</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>11334934</a>5pt; PDE <a href='http://www.google.nl' target='_blank'>11334934</a>5pt; cAMP <a href='http://www.google.nl' target='_blank'>11163436</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>11080591</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>11080591</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>11063610</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>10743606</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>3830152</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>21886855</a>55pt; inhibitor
    ]]>
    </Node>
    <Node id="PDE" name="PDE">
    <![CDATA[
    <a href='http://www.google.nl' target='_blank'>22377518</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>11930001</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>21208463</a>30pt; cAMP <a href='http://www.google.nl' target='_blank'>14728691</a>30pt; cAMP <a href='http://www.google.nl' target='_blank'>11134002</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>10637587</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>22356915</a>30pt; Disease <a href='http://www.google.nl' target='_blank'>22356915</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>22291195</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>15357210</a>5pt; Kinase <a href='http://www.google.nl' target='_blank'>15357210</a>5pt; cAMP <a href='http://www.google.nl' target='_blank'>15563461</a>5pt; cAMP <a href='http://www.google.nl' target='_blank'>17167070</a>5pt; cAMP <a href='http://www.google.nl' target='_blank'>22356915</a>5pt; cAMP <a href='http://www.google.nl' target='_blank'>22023548</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>21859303</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>15357210</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>1322896</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>1322896</a>5pt; cAMP <a href='http://www.google.nl' target='_blank'>11930001</a>5pt; cAMP <a href='http://www.google.nl' target='_blank'>11930001</a>5pt; Disease <a href='http://www.google.nl' target='_blank'>9427384</a>5pt; inhibitor <a href='http://www.google.nl' target='_blank'>11334934</a>5pt; Kinase <a href='http://www.google.nl' target='_blank'>9427384</a>5pt; cAMP
    ]]>
    </Node>
    <Node id="Disease" name="Disease">
    <![CDATA[
    <a href='http://www.google.nl' target='_blank'>21428846</a>25pt; inhibitor <a href='http://www.google.nl' target='_blank'>16303308</a>25pt; inhibitor <a href='http://www.google.nl' target='_blank'>10353643</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>15848765</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>21572521</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>18005706</a>30pt; Kinase <a href='http://www.google.nl' target='_blank'>7932587</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>21349219</a>30pt; inhibitor <a href='http://www.google.nl' target='_blank'>21349219</a>30pt; Kinase
    ]]>
    </Node>
    </Nodes>
    <Relations>
    <UndirectedRelation lineSize="6" labelText="120" letterSymbol="C" fromID="cAMP" toID="inhibitor"/>
    <UndirectedRelation lineSize="33" labelText="665" letterSymbol="C" fromID="Kinase" toID="inhibitor"/>
    <UndirectedRelation lineSize="16" labelText="325" letterSymbol="C" fromID="PDE" toID="inhibitor"/>
    <UndirectedRelation lineSize="13" labelText="270" letterSymbol="C" fromID="PDE" toID="cAMP"/>
    <UndirectedRelation lineSize="5" labelText="105" letterSymbol="C" fromID="Kinase" toID="cAMP"/>
    <UndirectedRelation lineSize="6" labelText="125" letterSymbol="C" fromID="Disease" toID="Kinase"/>
    <UndirectedRelation lineSize="43" labelText="870" letterSymbol="C" fromID="Disease" toID="inhibitor"/>
    <UndirectedRelation lineSize="0" labelText="10" letterSymbol="C" fromID="Kinase" toID="PDE"/>
    <UndirectedRelation lineSize="1" labelText="20" letterSymbol="C" fromID="Disease" toID="cAMP"/>
    <UndirectedRelation lineSize="2" labelText="55" letterSymbol="C" fromID="Disease" toID="PDE"/>
    </Relations>
    </RelationViewerData>
    Flash CODE:
    Code:
    // XMLtools.as
    // collected by me@der-mo.net
    
    trace("XMLtools loaded.");
    
    /*
    	byName:
    	
    	returns the first XML Node with a given name
    
    */
    XML.prototype.__proto__.byName = function(node_name){
    	if(this.nodeName != node_name){
    		return this.nextSibling.byName(node_name) || this.firstChild.byName(node_name);
    	} else {
    		return this;
    	}	
    }
    ASSetPropFlags(XML.prototype.__proto__,["byName"],1);
    
    //*************************************************************************
    
    
    /* 	XML.makeObj  
    
    	author: me@der-mo.net
    	
       	converts an XML Object to a corresponding dot-syntax object.
       	NodeName and NodeValue are translated to _type and _text properties.
       	child nodes are stored in a children array of the parent node.
       	deep recursion.
       	
       	example:
       	trace(new XML("<folder name="folder1"><page attName="attVal">text inside tag</page></folder>").makeObj());
       
       	output:--
       	{
    	_type: null
    	children: 
    		[
    			{
    			name: folder1
    			_type: folder
    			children: 
    				[
    					{
    					_text: text inside tag
    					attName: attVal
    					_type: page
    					}
    				]
    			}
    		]
    	}
    
      
    	
    */
    
    XML.prototype.__proto__.makeObj = function(){
    	// create a result object
    	var obj ={};
    	
    	// set _type property to nodeName
    	obj._type=this.nodeName;
    	
    	// adopt all attributes and their values as properties
    	for(var i in this.attributes) obj[i]=this.attributes[i];
    	
    	// add all children objects to children property Array
    	
    	if(this.firstChild.nodeType==3){
    		// textNode, so we won't have any other children
    		//(flash does not support mixed-mode)
    		obj._text=this.firstChild.nodeValue;
    	} else {
    		// loop through children and recursively store them as objects
    		var tempChildren=[];
    		for(var i in this.childNodes){	
    			var childObj=this.childNodes[i].makeObj();
    			if(childObj._type!=null) tempChildren.unshift(childObj);
    		}
    		if(tempChildren.length) obj.children=tempChildren;
    	}
    	//for(var i in obj) trace(i + " : " + obj[i])
    	return obj;
    };
    ASSetPropFlags(XML.prototype.__proto__,["makeObj"],1);

  2. #2
    Junior Member
    Join Date
    May 2012
    Posts
    2
    The result should be this, with links: http://cytosine.nl/~owe8a_pg5/server/Graph.html

  3. #3
    Senior Member
    Join Date
    Jan 2011
    Posts
    171
    Could you post your Project?


    arkitx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center