flex 图片翻转

news/2024/5/19 17:00:16 标签: Flex, C, C++, C#, XML
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="732" height="110" backgroundColor="#ffffff">
<mx:Style>
.leftButtonStyle{
/*overSkin:Embed("/images/newpapcr_leftOn.jpg");
upSkin:Embed("/images/newpapcr_left.jpg");
downSkin:Embed("/images/newpapcr_leftClick.jpg");
*/}
.rightButtonStyle{
/*overSkin:Embed("/images/newpapcr_rightOn.jpg");
upSkin:Embed("/images/newpapcr_right.jpg");
downSkin:Embed("/images/newpapcr_rightClick.jpg");
*/}

</mx:Style>
<mx:Script>
<![CDATA[
import mx.effects.Glow;
import mx.events.EffectEvent;
import mx.effects.Move;
// import mx.controls.Alert;
private var state:Boolean = true;
private function getFunLeft():void{
if(state){

state = false;
var tright:Tile = new Tile();
c.addChild(tright);
tright.x=632;
tright.y=0;
tright.width=632;
tright.height=90;
tright.direction="horizontal";
var img1 :Image = new Image();
img1.source="image/1.jpg";
img1.height=90;
img1.width=120;

var img2 :Image = new Image();
img2.source="image/2.jpg";
img2.height=90;
img2.width=120;

var img3 :Image = new Image();
img3.source="image/3.jpg";
img3.height=90;
img3.width=120;

var img4 :Image = new Image();
img4.source="image/4.jpg";
img4.height=90;
img4.width=120;

var img5 :Image = new Image();
img5.source="image/1.jpg";
img5.height=90;
img5.width=120;

img1.addEventListener(MouseEvent.MOUSE_OVER,imagePlay);
img2.addEventListener(MouseEvent.MOUSE_OVER,imagePlay);
img3.addEventListener(MouseEvent.MOUSE_OVER,imagePlay);
img4.addEventListener(MouseEvent.MOUSE_OVER,imagePlay);
img5.addEventListener(MouseEvent.MOUSE_OVER,imagePlay);

tright.addChild(img1);
tright.addChild(img2);
tright.addChild(img3);
tright.addChild(img4);
tright.addChild(img5);

var m1 :Move = new Move();
m1.xFrom = 632;
m1.xTo = 0;
m1.target = tright;


var t2:Tile = Tile(c.getChildAt(0));
var m2 :Move = new Move();
m2.xFrom = 0;
m2.xTo = -632;
m2.target = t2;

m2.addEventListener(EffectEvent.EFFECT_END,function():void{c.removeChild(t2);state = true;});
m2.addEventListener(EffectEvent.EFFECT_START,function():void{m1.play();});

m2.play();

}
}


private function getFunRight():void{
if(state){
state = false;
var tleft:Tile = new Tile();
c.addChildAt(tleft,0);
tleft.x=-632;
tleft.y=0;
tleft.width=632;
tleft.height=90;
tleft.direction="horizontal";
var img11 :Image = new Image();
img11.source="image/1.jpg";
img11.height=90;
img11.width=120;
var img12 :Image = new Image();
img12.source="image/2.jpg";
img12.height=90;
img12.width=120;
var img13 :Image = new Image();
img13.source="image/3.jpg";
img13.height=90;
img13.width=120;
var img14 :Image = new Image();
img14.source="image/4.jpg";
img14.height=90;
img14.width=120;
var img15 :Image = new Image();
img15.source="image/1.jpg";
img15.height=90;
img15.width=120;

img11.addEventListener(MouseEvent.MOUSE_OVER,imagePlay);
img12.addEventListener(MouseEvent.MOUSE_OVER,imagePlay);
img13.addEventListener(MouseEvent.MOUSE_OVER,imagePlay);
img14.addEventListener(MouseEvent.MOUSE_OVER,imagePlay);
img15.addEventListener(MouseEvent.MOUSE_OVER,imagePlay);


tleft.addChild(img11);
tleft.addChild(img12);
tleft.addChild(img13);
tleft.addChild(img14);
tleft.addChild(img15);

var m11 :Move = new Move();
m11.xFrom = -632;
m11.xTo = 0;
m11.target = tleft;


var t12:Tile = Tile(c.getChildAt(1));
var m12 :Move = new Move();
m12.xFrom = 0;
m12.xTo = 632;
m12.target = t12;

m12.addEventListener(EffectEvent.EFFECT_END,function():void{c.removeChild(t12);state = true;});
m12.addEventListener(EffectEvent.EFFECT_START,function():void{m11.play();});

m12.play();
}
}

private function imagePlay(evt:MouseEvent):void{
var g:Glow = new Glow();
var array:Array = new Array(evt.target);
//Alert.show(array.length+"");
if(array.length>0){
g.target = array[0];
g.duration=2000;
g.play();
}
}

]]>
</mx:Script>
<mx:Glow id="hitHight" duration="2000" />
<mx:Button x="0" y="0" label="Button" height="110" width="25" click="getFunLeft();" styleName="leftButtonStyle"/>
<mx:Button x="707" y="0" label="Button" height="110" width="25" click="getFunRight();" styleName="rightButtonStyle"/>
<mx:Canvas id="c" x="50" y="10" width="632" height="90" horizontalScrollPolicy="off" verticalScrollPolicy="off">
<mx:Tile x="0" y="0" width="632" height="90" id="tile2" direction="horizontal" >
<mx:Image source="image/1.jpg" id="pic2" height="90" width="120" rollOverEffect="hitHight"/>
<mx:Image source="image/2.jpg" id="pic1" height="90" width="120" rollOverEffect="hitHight"/>
<mx:Image source="image/3.jpg" id="pic3" height="90" width="120" rollOverEffect="hitHight"/>
<mx:Image source="image/4.jpg" id="pic4" height="90" width="120" rollOverEffect="hitHight"/>
<mx:Image source="image/1.jpg" id="pic5" height="90" width="120" rollOverEffect="hitHight"/>
</mx:Tile>
</mx:Canvas>
</mx:Application>

http://www.niftyadmin.cn/n/869503.html

相关文章

gif图片编辑器_好用的微信公众号编辑器

微信编辑器是所有小编的职场利器一款好的编辑器不仅能够提高我们的工作效率还可以提供除了美化文章排版之外的其他附加工具心水值UP UP UP好啦&#xff0c;废话不多说。下面罗列并详细分析几个我认为非常好用的公众号编辑器。建议收藏哦&#xff01;1. 秀米编辑器 网址&#xf…

安卓手机如何投屏到电视上_苹果手机怎么投屏到电视上?手机无线投屏电视的教程分享...

原标题&#xff1a;苹果手机怎么投屏到电视上&#xff1f;手机无线投屏电视的教程分享最近&#xff0c;我迷上了一部电视剧&#xff0c;终于等到它更新完了才看。我用的是苹果手机&#xff0c;屏幕小&#xff0c;看起剧来很不过瘾。后来&#xff0c;我把苹果手机投屏到电视上&a…

sql 语句,多表更新语句

update car c,car_series cs,car_brand cb,brand b set c.brand_nameb.b_name where c.cs_idcs.cs_id and cs.cb_id cb.cb_id and cb.b_id b.b_id;

termux无法安装引导程序包_真的这么快!实测微软Win 10 20H2仅需几分钟即可安装...

之前有提到过&#xff0c;微软Win 10 20H2更新的安装速度将不同于以往&#xff0c;速度非常快&#xff0c;仅需几分钟即可安装好&#xff0c;当然本身这就是一个较小的版本更新&#xff0c;新版本会为我们带来许多性能改进和错误修复。那么&#xff0c;这么快的安装速度是事实吗…

redis smembersmap_Redis使用建议规范

合理选择Redis部署模式查看推荐配置冷热数据分离&#xff0c;不要将所有数据全部都放到Redis中建议根据业务只将高频热数据存储到Redis中【QPS大于5000】&#xff0c;对于低频冷数据可以使用Mysql/ElasticSearch等基于磁盘的存储方式&#xff0c;不仅节省内存成本&#xff0c;而…

freeMarker 语法

FreeMarker的模板文件并不比HTML页面复杂多少,FreeMarker模板文件主要由如下4个部分组成: 1,文本:直接输出的部分 2,注释:<#-- ... -->格式部分,不会输出 3,插值:即${...}或#{...}格式的部分,将使用数据模型中的部分替代输出 4,FTL指令:FreeMarker指定,和HTML标记类似,名…

tkmybatis 属性集合_高中数学 2020人教版必修第一册第一章集合与常用逻辑用语1.1 集合的概念教案...

-关注后可获得更多资源-新教材必修第一册1.1&#xff1a;集合的概念课标解读&#xff1a;1. 集合的含义.(了解)2. 元素与集合的关系.(理解)3. 集合的表示.(掌握)学习指导&#xff1a;1. 准确把握并熟练掌握集合元素的“三性”(确定性、互异性、无序性)&#xff0c;不仅有助于理…

python发送post请求返回access denied_python使用scrapy发送post请求的坑

使用requests发送post请求先来看看使用requests来发送post请求是多少好用&#xff0c;发送请求Requests 简便的 API 意味着所有 HTTP 请求类型都是显而易见的。例如&#xff0c;你可以这样发送一个 HTTP POST 请求&#xff1a;>>>r requests.post(http://httpbin.org…