topical media & game development
#graph-philosopher.mx
#graph-philosopher.mx
[swf]
flex
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:local="*" xmlns:fc="http://www.adobe.com/2006/fc"
layout="absolute"
creationComplete="setup()" backgroundGradientColors="[#FFFFFF,#FFFFFF]">
<mx:String id="disclaimer">Disclaimer:\n\nDit overzicht is zowel incompleet als overcompleet, en gebaseerd op persoonlijke indrukken waardoor sommige verbanden voor anderen onbegrijpelijk kunnen zijn, of belangrijke verbanden juist kunnen ontbreken.</mx:String>
<fc:Roamer id="roamer" bottom="0"
itemRenderer="graph_philosopher_item"
repulsionFactor="{repulsion.value}"
maxDistanceFromCurrent="2"
itemLimit="{maxVisible.value}"
autoFit="true"
showHistory="false"
motionThreshold="0"
change="if(infoText != null) infoText.text = roamer.fullNodeCount + ' filosofen/stromingen, ' + roamer.visibleNodeCount + ' zichtbaar.';" right="0" left="0" top="0">
<fc:removeItemEffect>
<mx:Fade alphaFrom="1" alphaTo="0" duration="1000"/>
</fc:removeItemEffect>
<fc:addItemEffect>
<mx:Fade alphaFrom="0" alphaTo="1" duration="1000"/>
</fc:addItemEffect>
</fc:Roamer>
<mx:Text id="filosoftware" x="10" y="10" text="Filosoftware" fontSize="16" color="#000000" fontWeight="bold"/>
<mx:Text id="filosoftware2" fontSize="9" color="#000000" fontWeight="bold" textAlign="left" width="214"
htmlText="hedendaagse stromingen 2007-2008" x="10" y="29"/>
<mx:Text visible="true" x="10" y="48" text="no data loaded" id="infoText" fontSize="9" color="#000000"/>
<mx:Text x="10" y="72" id="help" fontSize="9" color="#FF0000"/>
<mx:Label visible="false" x="10" y="100" text="max number visible" fontSize="9" width="133" textAlign="center" color="#000000"/>
<mx:HSlider visible="false" x="10" y="83" width="133" id="maxVisible" snapInterval="1" value="14" minimum="10" maximum="30" liveDragging="true"/>
<mx:CheckBox visible="false" x="14" y="123" label="Show history" color="#000000" selected="false"
change="roamer.showHistory = event.currentTarget.selected"/>
<mx:Label visible="false" x="11" y="167" text="item spacing" fontSize="9" width="133" textAlign="center" color="#000000"/>
<mx:HSlider visible="false" x="11" y="153" width="133" id="repulsion" value="{roamer.repulsionFactor}" minimum="0.01" maximum="1.5" liveDragging="true"/>
<mx:HTTPService id="data" url="graph-philosopher-data.xml" showBusyCursor="true" resultFormat="e4x"
result="gotData(['n','e','f','t'], event)"/>
<mx:Text x="{this.width-120}" y="{this.height-22}" htmlText="<a href="http://www.few.vu.nl/~tpolthof/filosoftware/">Timen Olthof 2008</a>" fontSize="10" color="#CCCCCC"/>
<mx:Script>
<![CDATA[
import mx.controls.Label;
import com.adobe.flex.extras.controls.springgraph.IEdgeRenderer;
//[Embed(source="data.xml",mimeType="application/octet-stream")]
//public static const XMLFILE:Class;
import com.adobe.flex.extras.controls.springgraph.SpringGraph;
import mx.rpc.events.ResultEvent;
import com.adobe.flex.extras.controls.springgraph.Item;
import com.adobe.flex.extras.controls.springgraph.Graph;
private function setup(): void {
data.send();
//loadEmbeddedData();
roamer.repulsionFactor = 120;
}
private function gotData(xmlNames: Array, event: ResultEvent): void {
roamer.resetHistory();
roamer.resetShowHide();
roamer.xmlNames = xmlNames;
roamer.dataProvider = event.result as XML;
changeHelp1();
}
/*public function loadEmbeddedData():void {
roamer.dataProvider = new XMLFILE as XML;
roamer.resetHistory();
roamer.resetShowHide();
roamer.xmlNames = ['n','e','f','t'];
}*/
public function itemDoubleClick(event: Event): void {
roamer.currentItem = event.currentTarget.data;
changeHelp2();
}
private function changeHelp1(): void {
help.text = "Dubbelklik op het Startpunt voor UITLEG.";
}
private function changeHelp2(): void {
help.text = "Spring van filosoof naar filosoof...";
var t:Timer = new Timer(10000, 1);
t.addEventListener(TimerEvent.TIMER_COMPLETE, onTimerComplete);
t.start();
}
public function onTimerComplete(evt:TimerEvent):void
{
help.visible = false;
}
]]>
</mx:Script>
</mx:Application>
(C) Æliens
27/08/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.