图片横线滚动脚本
Download the sample files here.
在此处下载示例文件 。
1. Create a blank movie clip, and give it an instance name of "drag".
1.创建一个空白的影片剪辑,并为其指定实例名称“ drag”。
2. I’ve used a square movieclip and simply made 5 instances of the same clip. For the sake of file size, I’ve used a plain movie clip, but of course, you can use images instead.
2.我使用了一个方形的动画片段,并简单地制作了同一片段的5个实例。 出于文件大小的考虑,我使用了普通的影片剪辑,但是当然可以使用图像。
Convert each image into a movie clip, and give each instance a name, such as "a1", "a2", "a3", "a4", and "a5".
将每个图像转换为影片剪辑,并为每个实例命名,例如“ a1”,“ a2”,“ a3”,“ a4”和“ a5”。
3. Go to the time line of the "drag" movie clip, and create two key frames.
3.转到“拖动”影片剪辑的时间线,然后创建两个关键帧。
4. In the first key frame, insert the action:
4.在第一个关键帧中,插入操作:
mw = getProperty("/a1",_width); for(i=5; i>=1; i--) { mx = getProperty("/a"add i,_x); //right side if(mx > 400) { if(i==5){mv=1}; if(i==4){mv=5}; if(i==3){mv=4}; if(i==2){mv=3}; if(i==1){mv=2}; mx = getProperty("/a"add mv,_x); setProperty("/a" add i,_x,mx - (mw + 2)); } //left side if(mx < 0) { if(i==1){mv=5}; if(i==2){mv=1}; if(i==3){mv=2}; if(i==4){mv=3}; if(i==5){mv=4}; mw = getProperty("/a"add mv,_width); mx = getProperty("/a"add mv,_x); setProperty("/a" add i,_x,mx + (mw + 2)); } }5. In the second key frame, insert the action:
6. Go to the main timeline, create a new layer, and name it "actions".
7. Create three keyframes in the "actions" layer.
8. In the first key frame, insert the action:
mx = getProperty("/a1",_x); mw = getProperty("/a1",_width); nomc = 5; mw = getProperty("/a1",_width); for(i=5; i>=1; i--) { mx = getProperty("/a"add i,_x); //right side if(mx > 400) { if(i==5){mv=1}; if(i==4){mv=5}; if(i==3){mv=4}; if(i==2){mv=3}; if(i==1){mv=2}; mx = getProperty("/a"add mv,_x); setProperty("/a" add i,_x,mx - (mw + 2)); } //left side if(mx < 0) { if(i==1){mv=5}; if(i==2){mv=1}; if(i==3){mv=2}; if(i==4){mv=3}; if(i==5){mv=4}; mw = getProperty("/a"add mv,_width); mx = getProperty("/a"add mv,_x); setProperty("/a" add i,_x,mx + (mw + 2)); } }5. In the second key frame, insert the action:
6. Go to the main timeline, create a new layer, and name it "actions".
7. Create three keyframes in the "actions" layer.
8. In the first key frame, insert the action:
mx = getProperty("/a1",_x); mw = getProperty("/a1",_width); nomc = 5;翻译自: https://www.sitepoint.com/scrolling-image-gallery/
图片横线滚动脚本
相关资源:jdk-8u281-windows-x64.exe