vim 光标上移脚本
1. Create a text field, name it "txt", and then convert it to a movieclip.
1.创建一个文本字段,将其命名为“ txt”,然后将其转换为动画片段。
2. Give the movie clip an instance name of "a1".
2.为影片剪辑指定实例名称“ a1”。
3. Create a new movieclip and give it an instance name of "a0".
3.创建一个新的动画片段,并为其指定实例名称“ a0”。
4. Create layers as shown below.
4.创建如下所示的图层。
5. In the actions layer in the first key frame, insert the following action:
5.在第一个关键帧的操作层中,插入以下操作:
x = new Array(); y = new Array(); text = "Flashcircle.com"; // mx x value of movieclip mx = getProperty("/a1", _x); txtlength = length(text); /a1:txt = "F"; //loop through to create duplicate movieclip for (i=2; i<=txtlength; i++) { duplicateMovieClip ("/a1", "a" add i, i); setProperty ("/a" add Number(i), _x, mx); // substring to put individual letter into movieclip set ("/a" add Number(i) add ":txt", substring(text, i, 1)); }6. In the actions layer in the third key frame, insert these actions:
6.在第三个关键帧的操作层中,插入以下操作:
//code to make the text follow for(i=1; i<=txtlength; i++) { x[i] = getProperty("/a" add Number(i-1),_x); y[i] = getProperty("/a" add Number(i-1),_y); x[i] = x[i]+10; }7. In the actions layer in the fourth key frame, insert the following:
7.在第四个关键帧的操作层中,插入以下内容:
//code to make the text follow for (i=1; i<=txtlength; i++) { setProperty ("/a" add i, _x, x[i]); setProperty ("/a" add i, _y, y[i]); } gotoAndPlay (2);8. Right click the "a0" instance movie clip, and insert these actions:
8.右键单击“ a0”实例影片剪辑,然后插入以下操作:
onClipEvent (load) { startDrag ("", true); }9. Easy, wasn’t it? Press ctrl+enter to test you movie.
9.很简单,不是吗? 按ctrl + enter测试您的电影。
翻译自: https://www.sitepoint.com/cursor-responsive-text/
vim 光标上移脚本