The production of flash elasticity effect

Source: Internet
Author: User

Create a new file, set the frame speed to 60 then set the background casually, and then we'll find a small picture that can be used when the mouse pointer converts the picture into a movie clip named "Pointer". Create a new layer drag "pointer" to the scene.

Next you start writing scripts:
In the pointer clip's property bar, name it: Mc_mouse
Then add a script to the movie clip:

Onclipevent (load)
{
xpos = 0;
YPos = 0; Set the initial position of x,y coordinates
}
Onclipevent (Enterframe)
{
Elastic = 0.400000;//Set elasticity coefficient
Friction = 0.700000;//Set friction coefficient
Xfriction = (xpos-_x) * elastic + xfriction * friction;
Yfriction = (YPos-_y) * elastic + yfriction * friction;//Sets the amount of change in position when the mouse is moved
this._x = this._x + xfriction;
this._y = this._y + yfriction;//Set the location of the mouse now
}


Then we go back to the main scene and create a new layer as the script layer.

In the first stitch insert a blank keyframe, write the script:

Fscommand ("fullscreen", "false");//Specifies that the player is a regular menu view.
Fscommand ("Allowscale", "false");/player to always draw SWF file by original size of SWF file
Fscommand ("ShowMenu", "false");
Mouse.hide ()//Hide Mouse
Mc_mouse.xpos = _root._xmouse;
Mc_mouse.ypos = _root._ymouse;//Set the position of the horizontal ordinate


Convert frame 2nd to a blank keyframe and write:

gotoAndPlay (1);

After the completion of the Flash playback, after the set time to perform the specified operation

Set a variable name "Lianjie", fill out the following as in the last frame of Flash:

Stop ();
var lianjie=setinterval (function () {GetURL ("Flash bar", "_blank");
Clearinterval (Lianjie);
},5000);


The meaning is to call the link command after 5000 milliseconds, and then delete itself. This is simpler and works well for a variety of frame frequencies.

Similarly will Geturl ("Flash bar", "_blank"); , and can be adapted to other code.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.