sleek.mxml
上传用户:chunsheng
上传日期:2022-06-13
资源大小:1476k
文件大小:2k
- <?xml version="1.0" encoding="utf-8"?>
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()" creationCompleteEffect="fadeOut" viewSourceURL="srcview/index.html">
- <mx:Script>
- <![CDATA[
- import mx.states.AddChild;
- import mx.controls.Image;
- import mx.controls.Alert;
- import mx.events.*;
- import keymet.effect.SleekMove;
- import mx.effects.easing.*;
-
- public var img:Array;
- public var sm:SleekMove;
- function init():void
- {
- var i:int;
- var tmp:Image;
- img = new Array();
- foc.setFocus();
- for (i= 0; i<= 9 ;i++)
- {
- tmp = new Image();
- tmp.source= "pic/p"+(i+1).toString()+".jpg";
- img[i] = tmp;
- addChild(img[i]);
- }
- addEventListener(KeyboardEvent.KEY_UP,keyup);
- /* create cover flow effect object */
- sm = new SleekMove();
- /* init object:
- function init(img:Array,imgW:int,imgH:int,imgSpace:int=50,offsetX:int=0,offsetY:int=0,zoomInPer:Number=.6):void
- img Image object array
- imgH image's height
- imgW image's width
- imgSpace
- offsetX
- offsetY
- zoomInPer
- */
- sm.init(img,160,200,30,100,200,0.7);
- }
- function keyup(event:KeyboardEvent):void{
- if (event.keyCode == 37)
- sm.pressLeft();
- if (event.keyCode == 39)
- sm.pressRight();
- }
-
- function keysel():void
- {
- Alert.show(sm.getSelected().toString());
- }
- ]]>
- </mx:Script>
- <mx:Fade id="fadeOut" duration="1000" alphaFrom="0" alphaTo="1"/>
-
- <mx:Button id="foc" x="232" y="495" label="GetSelected" click="keysel()"/>
-
- </mx:Application>