Кто-нибудь может мне помочь?! :(
Добавлено через 1 минуту
Цитата:
Сообщение от Genzo
(Сообщение 1027736)
Тогда даже не знаю ,что сказать . полный код в студию.
|
Код AS3:
package
{
public class Main extends MovieClip
{
private var bg:MovieClip;
private var ts:MovieClip;
private var panel:MovieClip;
private var logo:MovieClip;
private var btn1:MovieClip;
private var btn2:MovieClip;
private var mask_mc4:MovieClip;
private var mirrorMask:MovieClip;
private var mirrorMask2:MovieClip;
private var mirrorMask3:MovieClip;
private var arrow1:MovieClip;
private var arrow2:MovieClip;
private var speed:Number = 3;
private var liveTimer:Timer = new Timer(500);
// PUBLIC //
public var txtFrt:TextFormat;
public var txtFrtBold:TextFormat;
public var txt1:TextField;
public var charTimerTarget:TextField;
public var charTimer:Timer;
public var mainCharTimer:Timer;
public var charTimerTargetSource:String;
public var charTimerTargetData:Array;
public var frameTime:Number;
public var textSpeed:Number = 500;
public var charTimerTargetCount:int;
public var messageCount:int = 0;
public function Main()
{
inicialize();
}
private function inicialize():void
{
addSimbols();
rotationArrow();
setMove();
addMask();
stage.scaleMode = "noScale";
}
private function addSimbols():void
{
bg = new Bg_mc();
bg.x = bg.y = 0;
addChild(bg);
panel = new Panel_mc();
panel.x = 0;
panel.y = -155.65;
addChild(panel);
logo = new Logo_mc();
logo.x = 626;
logo.y = 11;
btn1 = new Btn1_mc();
btn1.x = 678;
btn1.y = 72;
btn1.width = 120;
btn1.height = 48;
btn2 = new Btn2_m();
btn2.x = 678;
btn2.y = 72;
btn2.width = 120;
btn2.height = 48;
arrow1 = new Arrow1_mc();
arrow1.x = 385;
arrow1.y = 66;
arrow1.rotation = 350;
addChild(arrow1);
arrow2 = new Arrow2_mc();
arrow2.x = 200;
arrow2.y = 80;
arrow2.rotation = 320;
addChild(arrow2);
ts = new Ts_mc();
ts.x = ts.y = 0;
addChild(ts);
var t:MovieClip = new TSO();
t.x = 0;
t.y = 19;
addChild(t);
}
private function rotationArrow():void
{
TweenMax.to(arrow1, 1, {shortRotation:{rotation:-350}, onComplete:arrowUp});
TweenMax.to(arrow2, 2, {shortRotation:{rotation:340}, onComplete:arrowUp});
}
private function arrowUp():void
{
TweenMax.to(arrow1, .04, {shortRotation:{rotation:-351}, onComplete:arrowDown});
TweenMax.to(arrow2, .09, {shortRotation:{rotation:339}, onComplete:arrowDown});
}
private function arrowDown():void
{
TweenMax.to(arrow1, .04, {shortRotation:{rotation:-350}, onComplete:arrowUp});
TweenMax.to(arrow2, .09, {shortRotation:{rotation:340}, onComplete:arrowUp});
}
private function setMove():void
{
/* Step 1 */
TweenLite.to(panel, speed, {x:-10, y:90, scaleX:0.5, scaleY:0.5, ease:Cubic.easeOut, delay: 2});
TweenLite.to(arrow1, speed, {x:180, y:170, scaleX:0.5, scaleY:0.5, ease:Cubic.easeOut, delay: 2});
TweenLite.to(arrow2, speed, {x:60, y:170, scaleX:0.5, scaleY:0.5, ease:Cubic.easeOut, delay: 2});
/* Step 2 */
car = new Car_mc();
car.x = 700;
car.y = -200;
addChild(car);
mirrorMask = new MirrorMask();
mirrorMask.x = 700;
mirrorMask.y = -200;
car.mask = mirrorMask;
addChild(mirrorMask);
mask_mc4 = new Mask_mc();
mask_mc4.x = 0;
mask_mc4.y = 0;
(root as Sprite).mask = mask_mc4;
addChild(mask_mc4);
blue = new Blue_mc();
blue.x = 555;
blue.y = -80;
blue.width = 300;
addChild(blue);
mirrorMask2 = new MirrorMask();
mirrorMask2.x = 475;
mirrorMask2.y = -30;
//blue.mask = mirrorMask2;
red = new Red_mc();
red.x = 720;
red.y = -200;
addChild(red);
mirrorMask3 = new MirrorMask();
mirrorMask3.x = 475;
mirrorMask3.y = -30;
//red.mask = mirrorMask3;
mirror = new Mirror_mc();
mirror.x = 700;
mirror.y = -200;
addChild(mirror);
addChild(btn1);
addChild(logo);
TweenLite.to(mirror, speed, {x:450, y:-110, ease:Cubic.easeOut, delay: 1.5});
TweenLite.to(mirrorMask, speed, {x:470, y:-62, ease:Cubic.easeOut, delay: 1.5});
TweenLite.to(car, speed, {x:400, y:-110, ease:Cubic.easeOut, delay: 1.5});
TweenLite.to(blue, speed, {x: 570, y:-15, ease:Cubic.easeOut, delay:4});
TweenLite.to(red, speed, {y:-25, ease:Cubic.easeOut, delay:2.5});
deleteLite();
TweenLite.to(panel, 3, {y:90, ease:Cubic.easeOut, delay: 3});
TweenLite.to(mirror, speed, {y:-80, ease:Cubic.easeOut, delay: 3});
TweenLite.to(mirrorMask, speed, {y:-32, ease:Cubic.easeOut, delay: 3});
TweenLite.to(car, speed, {x: 340, y:-80, ease:Cubic.easeOut, delay: 3});
TweenLite.to(this, 0,{delay: 4.5, onComplete:addText1});
TweenLite.to(mirror, speed, {y:-65, ease:Cubic.easeOut, delay: 4});
TweenLite.to(mirrorMask, speed, {x: 473, y:-20, ease:Cubic.easeOut, delay: 4});
}
// FUNCTION //
private function addText():void
{
txtFrt = new TextFormat()
txtFrt.font = "Arial";
txtFrt.size = 17;
txtFrt.color = 0xFFFFFF;
txtFrtBold = new TextFormat();
txtFrtBold.font = "Arial";
txtFrtBold.size = 20;
txtFrtBold.bold = true;
txtFrtBold.color = 0xFFFFFF;
txt1 = new TextField();
txt1.width = 400;
txt1.height = 90;
txt1.x = 200;
txt1.y = 28;
txt1.defaultTextFormat = txtFrt;
addChild(txt1);
}
private function effText():void
{
frameTime = Math.round(textSpeed * 1 / this.stage.frameRate)*3;
charTimer = new Timer(frameTime);
charTimer.addEventListener(TimerEvent.TIMER, charTimerComplete);
charTimer.start();
charTimerTarget = txt1;
charTimerTargetSource = 'Bad decisions\ncatching up with you?';
charTimerTargetData = charTimerTargetSource.split('');
charTimerTargetCount = 0;
liveTimer.addEventListener(TimerEvent.TIMER, liveTimerEnd);
}
private function charTimerComplete(event:TimerEvent):void
{
if (charTimerTargetCount < charTimerTargetData.length)
{
charTimerTarget.appendText(charTimerTargetData[charTimerTargetCount]);
switch(messageCount)
{
case 1:
{
if ((txt1.text.length - 1) > 29)
{
txt1.setTextFormat(txtFrtBold, 29, 30);
}
if ((txt1.text.length - 1) > 53)
{
txt1.setTextFormat(txtFrtBold, 53, txt1.text.length - 1);
}
} break;
case 3:
{
if ((txt1.text.length - 1) > 0)
{
}
if ((txt1.text.length - 1) > 40)
{
txt1.setTextFormat(txtFrtBold, 40, txt1.text.length - 1);
}
} break;
}
charTimerTargetCount ++;
}else
{
liveTimer.start();
}
}
private function liveTimerEnd(event:TimerEvent):void{
liveTimer.stop();
switch(messageCount)
{
case 0:
{
txt1.text = '';
charTimerTargetSource = ' Improve your driving skills\n with traffic school... Online!';
charTimerTargetData = charTimerTargetSource.split('');
charTimerTargetCount = 0;
} break;
case 1:
{
txt1.text = '';
charTimerTargetSource = 'Clear your record at\nyour own convenience.';
charTimerTargetData = charTimerTargetSource.split('');
charTimerTargetCount = 0;
} break;
case 2:
{
txt1.text = '';
txt1.y = 10;
charTimerTargetSource = "Start your court-approved\ntraffic school\nbefore its too late!";
charTimerTargetData = charTimerTargetSource.split('');
charTimerTargetCount = 0;
} break;
case 3:
{
charTimer.stop();
removeEventListener(TimerEvent.TIMER, liveTimerEnd);
removeEventListener(TimerEvent.TIMER, charTimerComplete);
} break;
}
messageCount ++;
}
// FUNCTION //
private function addText1():void
{
addText();
effText();
}
private function addLite():void
{
TweenLite.to(blue, .5, {autoAlpha:1, onComplete:deleteLite});
TweenLite.to(red, .5, {autoAlpha:0, onComplete:deleteLite});
}
private function deleteLite():void
{
TweenLite.to(blue, .5, {autoAlpha:0, ease:Circ.easeOut, onComplete:addLite});
TweenLite.to(red, .5, {autoAlpha:1, ease:Circ.easeOut, onComplete:addLite});
}
private function addMask():void
{
var shape:Sprite = new Sprite();
var gr:Graphics = shape.graphics;
gr.beginFill(0xFFFFFF, 0);
gr.drawRect(0, 0, 728, 90);
gr.endFill();
shape.x = 0;
shape.y = 0;
addChild(shape);
shape.addEventListener(MouseEvent.MOUSE_OVER, _over, false, 0, true);
shape.addEventListener(MouseEvent.MOUSE_OUT, _out, false, 0, true);
btn2.addEventListener(MouseEvent.MOUSE_OVER, _over, false, 0, true);
btn2.addEventListener(MouseEvent.MOUSE_OUT, _out, false, 0, true);
}
private function _over(event:MouseEvent):void
{
buttonMode = true;
removeChild(btn1);
addChild(btn2);
}
private function _out(event:MouseEvent):void
{
buttonMode = false;
removeChild(btn2);
addChild(btn1);
}
} // end Class
} // end Package
|