在FLEX中360度展示你的产品。
源文件
代码:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientAlphas="[1.0, 1.0]"
backgroundGradientColors="[#FFFFFF, #FFFFFF]" creationComplete="init()" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
private function init():void{
myFade.play();
myFade2.play();
myCanvas.alpha = 0;
}
//Use SliderBar to show the image in 360 view
private function onChange():void{
//Use loader component to avoid flickering
var loader:Loader = new Loader();
loader.load( new URLRequest( "aliceImage/"+ int(hs.value)+ ".jpg" ) );
loader.contentLoaderInfo.addEventListener(Event.COMPLETE , function ():void{
myImage.source = loader;
});
}
]]>
</mx:Script>
<mx:Sequence id="myFade">
<mx:Pause duration="1000"/>
<mx:Fade target="{myCanvas}" alphaFrom="0" alphaTo="100" duration="10000"/>
</mx:Sequence>
<mx:Sequence id="myFade2" target="{myCanvas2}" effectEnd="{comment.visible = true;}">
<mx:Pause duration="1500"/>
<mx:Parallel>
<mx:Move yTo="{myCanvas2.y +10}"/>
</mx:Parallel>
</mx:Sequence>
<mx:Canvas id="myCanvas" backgroundImage="DSC_0074.jpg" width="1002" height="721" x="0" y="0" borderColor="#FFFFFF" themeColor="#B1E1FF" alpha="0.85">
<mx:Canvas id="myCanvas2" width="328" height="344" x="644" y="10" cornerRadius="10">
<mx:Image id="myImage" x="10" y="-4" width="317" height="309" source="aliceImage/1.jpg"/>
<mx:HSlider id="hs" x="10" y="313" change="onChange()" value="0" minimum="1" maximum="20" enabled="true" liveDragging="true" snapInterval="1" allowTrackClick="true" width="305"/>
</mx:Canvas>
</mx:Canvas>
<mx:TextArea alpha="0" visible="false" showEffect="myBlur2" id="comment" x="690" y="396" width="258" height="77" backgroundAlpha="0.1" editable="false" borderStyle="solid" borderThickness="0">
<mx:text><![CDATA[1/8 PoP Wonderland Alice in Wonderland
Sells Day:Mar.2008 Maker:alter
Price:60$ 15% off
Maker Suggested Price:65$]]></mx:text>
</mx:TextArea>
</mx:Application>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundGradientAlphas="[1.0, 1.0]"
backgroundGradientColors="[#FFFFFF, #FFFFFF]" creationComplete="init()" viewSourceURL="srcview/index.html">
<mx:Script>
<![CDATA[
private function init():void{
myFade.play();
myFade2.play();
myCanvas.alpha = 0;
}
//Use SliderBar to show the image in 360 view
private function onChange():void{
//Use loader component to avoid flickering
var loader:Loader = new Loader();
loader.load( new URLRequest( "aliceImage/"+ int(hs.value)+ ".jpg" ) );
loader.contentLoaderInfo.addEventListener(Event.COMPLETE , function ():void{
myImage.source = loader;
});
}
]]>
</mx:Script>
<mx:Sequence id="myFade">
<mx:Pause duration="1000"/>
<mx:Fade target="{myCanvas}" alphaFrom="0" alphaTo="100" duration="10000"/>
</mx:Sequence>
<mx:Sequence id="myFade2" target="{myCanvas2}" effectEnd="{comment.visible = true;}">
<mx:Pause duration="1500"/>
<mx:Parallel>
<mx:Move yTo="{myCanvas2.y +10}"/>
</mx:Parallel>
</mx:Sequence>
<mx:Canvas id="myCanvas" backgroundImage="DSC_0074.jpg" width="1002" height="721" x="0" y="0" borderColor="#FFFFFF" themeColor="#B1E1FF" alpha="0.85">
<mx:Canvas id="myCanvas2" width="328" height="344" x="644" y="10" cornerRadius="10">
<mx:Image id="myImage" x="10" y="-4" width="317" height="309" source="aliceImage/1.jpg"/>
<mx:HSlider id="hs" x="10" y="313" change="onChange()" value="0" minimum="1" maximum="20" enabled="true" liveDragging="true" snapInterval="1" allowTrackClick="true" width="305"/>
</mx:Canvas>
</mx:Canvas>
<mx:TextArea alpha="0" visible="false" showEffect="myBlur2" id="comment" x="690" y="396" width="258" height="77" backgroundAlpha="0.1" editable="false" borderStyle="solid" borderThickness="0">
<mx:text><![CDATA[1/8 PoP Wonderland Alice in Wonderland
Sells Day:Mar.2008 Maker:alter
Price:60$ 15% off
Maker Suggested Price:65$]]></mx:text>
</mx:TextArea>
</mx:Application>