
Àâòîð èñïîëüçóåò êîä
Êîä
stop();
X_start_point = random(750);
X_finish_point = X_start_point + 30;
//random variable for finishing point (distance down the Y axis)
Y_finish_point = random(300) + 150;
///random variable for the length of decent (i.e. time of the animation in frames per second)
length_time = random(5) + 12;
import mx.transitions.Tween;
import mx.transitions.easing.*
new Tween( this, "_x" , None.easeNone , X_start_point, X_finish_point, length_time, false);
var particle_event:Object = new Tween( this, "_y" , None.easeNone , 0, Y_finish_point, length_time, false);
particle_event.onMotionFinished = function(){
// when the animation is finished, this timeline will "wait" on frame 2, untill prompted to come back to frame 1
gotoAndStop(2);
///random variable used to determine which impact to play
impact_var = random(3);
if (impact_var == 0){
particle.gotoAndPlay("impact1");
}
if (impact_var == 1){
particle.gotoAndPlay("impact2");
}
if (impact_var == 2){
particle.gotoAndPlay("impact3");
}
}
X_start_point = random(750);
X_finish_point = X_start_point + 30;
//random variable for finishing point (distance down the Y axis)
Y_finish_point = random(300) + 150;
///random variable for the length of decent (i.e. time of the animation in frames per second)
length_time = random(5) + 12;
import mx.transitions.Tween;
import mx.transitions.easing.*
new Tween( this, "_x" , None.easeNone , X_start_point, X_finish_point, length_time, false);
var particle_event:Object = new Tween( this, "_y" , None.easeNone , 0, Y_finish_point, length_time, false);
particle_event.onMotionFinished = function(){
// when the animation is finished, this timeline will "wait" on frame 2, untill prompted to come back to frame 1
gotoAndStop(2);
///random variable used to determine which impact to play
impact_var = random(3);
if (impact_var == 0){
particle.gotoAndPlay("impact1");
}
if (impact_var == 1){
particle.gotoAndPlay("impact2");
}
if (impact_var == 2){
particle.gotoAndPlay("impact3");
}
}
À ÿ äåëàþ òàê
Êîä
import fl.transitions.Tween;
import fl.transitions.easing.*;
var X_start_point:Number = 0;
var X_finish_point = X_start_point + 200;
var Y_finish_point:Number = 800
var length_time:Number = 100;
new Tween( this, "_x" , None.easeNone , X_start_point, X_finish_point, length_time, false);
var particle_event:Object = new Tween( this, "_y" , None.easeNone , 0, Y_finish_point, length_time, false);
import fl.transitions.easing.*;
var X_start_point:Number = 0;
var X_finish_point = X_start_point + 200;
var Y_finish_point:Number = 800
var length_time:Number = 100;
new Tween( this, "_x" , None.easeNone , X_start_point, X_finish_point, length_time, false);
var particle_event:Object = new Tween( this, "_y" , None.easeNone , 0, Y_finish_point, length_time, false);
Âîò â àðõèâå 2 ôàéëà - ìîé è àâòîðñêèé. Ïîãëÿäèòå, ïîæàëóéñòà. Íàæìèòå äëÿ ïðîñìîòðà ïðèêðåïëåííîãî ôàéëà
Ìíå ãëàâíîå íåïîíÿòíî - êàê ïðèñâîèòü ìóâèêó äâèæåíèå, îïèñûâàåìîå â Tween.