1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| <?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://www.adobe.com/2006/mxml" xmlns:local="*" height="100%" width="100%" layout="absolute" creationComplete="{init();}">
<Binding source="sel.value" destination="shelf.selectedIndex" />
<Binding destination="sel.value" source="shelf.selectedIndex" />
<Model id="Photos" source="XMLFile3.xml"/>
<Script>
<![CDATA[
public var myXML:XML = new XML();
private function init():void {
// var XML_URL:String = Application.application.parameters.theXMLfile;;
var XML_URL:String = "file:///Users/gdidier/www/DisplayShelf/bin-debug/XMLFile3.xml"
var myXMLURL:URLRequest = new URLRequest(XML_URL);
var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener("complete", xmlLoaded);
function xmlLoaded(event:Event):void
{
myXML = XML(myLoader.data);
trace(myXML)
Application.application.shelf.dataProvider = myXML.image as Array;
}
}
]]>
</Script>
<local:DisplayShelf id="shelf" horizontalCenter="0" verticalCenter="0"
borderThickness="10" borderColor="#FFFFFF" enableHistory="false" width="100%"/>
<VBox horizontalCenter="0" bottom="150"
horizontalAlign="center" verticalAlign="middle" >
<HBox>
<HSlider liveDragging="true" id="sel" minimum="0" value="0" maximum="{shelf.dataProvider.length}" snapInterval="1" width="400" />
</HBox>
</VBox>
</Application> |
Partager