The production method of flash playback speed

Source: Internet
Author: User
Tags pow

First do a section of the arrow rotation animation, as far as possible to set the frame more, for example, my set has 192 frames. The frame rate is increased by one fold, similar to playing one frame at every other frame, and so on. So I wrote a function:

function playratectr (Movie:movieclip, Rate:number) {
Movie: A movie to control the speed of playback; rate: Frame rate Multiples
(Rate = = undefined)? Rate=1:null;
(movie = = undefined)? Movie=this:null;
Set the default movie and rate values
var cframe = Movie._currentframe;
var nframe = cframe+rate;
Movie.gotoandplay (Nframe);
}

Suppose the arrow's movie name is: Logo_part_1 (part of the logo I'm going to do)
Write:

Logo_part_1.onenterframe = function () {
_root.playratectr (this,3);
}; Then, the arrow animation will play at the original three times times the frame rate. (3lian material)
in order for the mouse position to be associated with a multiple of the playback speed, the following functions are also available: function dtorate (Movie:movieclip, Rate_max:number, tran:number) {
//movie: Movie Name: Rate_max: Maximum controllable speed multiple: Tran: Distance
//units converted to multiples
(movie = = undefined)? movie=this:null
(Rate_max = = undefined)? Rate_max=3:null;
(tran = = undefined)? tran=50:null;
var dx = movie._xmouse;
var dy = movie._ymouse;
var dr = Math.min (Rate_max, Math.floor (math.sqrt (Math.pow (DX, 2) +math.pow (DY, 2))/tran);
//Get the mouse distance from the movie, which is a converted
return (rate_max-dr+1);
} Overwrite the original Onenterframe function: Logo_part_1.onenterframe = function () {
var rate = _root. Dtorate (this,15,35);
//trace (rate);
_root.playratectr (this, rate);
};

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.