stop();
import flash.display.*;
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.text.TextField;
import flash.geom.ColorTransform;
import flash.geom.Transform;
import fl.transitions.*;
import fl.transitions.easing.*;
import com.greensock.TweenLite;
import flash.display.MovieClip;
import flash.display.BitmapData;
import flash.display.Bitmap;
var i:uint;
var banner_url:URLRequest;
var myXML:XML = new XML();
var XML_URL:String = "banner_prepaid.xml";
var myXMLURL:URLRequest = new URLRequest(XML_URL);
var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener("complete", xmlLoaded);
function xmlLoaded(event:Event):void {
myXML = XML(myLoader.data);
var pp0:String = myXML.banner.prepaid[0];
var pp1:String = myXML.banner.prepaid[1];
var pp2:String = myXML.banner.prepaid[2];
var pp3:String = myXML.banner.prepaid[3];
var pp4:String = myXML.banner.prepaid[4];
//trace (banner);
function ContentLink(event:MouseEvent):void
{
switch (event.currentTarget)
{
case s_mc :
banner_url = new URLRequest(pp0);
break;
case y_mc :
banner_url = new URLRequest(pp1);
break;
case p_mc :
banner_url = new URLRequest(pp2);
break;
case t_mc :
banner_url = new URLRequest(pp3);
break;
case tn_mc :
banner_url = new URLRequest(pp4);
break;
}
navigateToURL(banner_url, "_self");
}
var _initPosition:Number;
var maxXDistance:Number = 60;
var maxYDistance:Number = 30;
var maxScale:Number = 1;
var back_ground :yellow = new yellow();
var yellow_bg :bg = new bg();
var pink_bg :pink = new pink();
var green_bg :green = new green();
var dark_bg :dark = new dark();
var purple_bg :purple = new purple();
var bg_image:Bitmap = new Bitmap(back_ground);
var s_image:Bitmap = new Bitmap(yellow_bg);
var y_image:Bitmap = new Bitmap(pink_bg);
var p_image:Bitmap = new Bitmap(green_bg);
var t_image:Bitmap = new Bitmap(dark_bg);
var tn_image:Bitmap = new Bitmap(purple_bg);
//var bg_mc:MovieClip = new MovieClip();
bg_mc.addChild(bg_image);
//addChild(bg_mc);
var myTM:TransitionManager = new TransitionManager(bg_mc);
myTM.startTransition({type:Fade, direction:Transition.IN})
myTM.addEventListener("allTransitionsInDone", doneTrans);
function doneTrans(e:Event):void{
}
//var s_mc:student = new student();
//s_mc.height = 180; s_mc.scaleX = s_mc.scaleY;
//s_mc.x = 160; s_mc.y = 300; addChild(s_mc);
s_mc.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
s_mc.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
s_mc.addEventListener(MouseEvent.CLICK, ContentLink);
s_mc.buttonMode = true;
//var y_mc:young = new young();
//y_mc.height = 180; y_mc.scaleX = y_mc.scaleY;
//y_mc.x = 360; y_mc.y = 300; addChild(y_mc);
y_mc.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
y_mc.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
y_mc.addEventListener(MouseEvent.CLICK, ContentLink);
y_mc.buttonMode = true;
//var p_mc:parent_ = new parent_();
//p_mc.height = 180; p_mc.scaleX = p_mc.scaleY;
//p_mc.x = 560; p_mc.y = 300; addChild(p_mc);
p_mc.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
p_mc.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
p_mc.addEventListener(MouseEvent.CLICK, ContentLink);
p_mc.buttonMode = true;
//var t_mc:traveller = new traveller();
//t_mc.height = 180; t_mc.scaleX = t_mc.scaleY;
//t_mc.x = 760; t_mc.y = 300; addChild(t_mc);
t_mc.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
t_mc.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
t_mc.addEventListener(MouseEvent.CLICK, ContentLink);
t_mc.buttonMode = true;
//var tn_mc:town_ = new town_();
//tn_mc.name = "town";
//tn_mc.height = 180; tn_mc.scaleX = tn_mc.scaleY;
//tn_mc.x = 860; tn_mc.y = 300; addChild(tn_mc);
tn_mc.addEventListener(MouseEvent.MOUSE_OVER, onMouseOver);
tn_mc.addEventListener(MouseEvent.MOUSE_OUT, onMouseOut);
tn_mc.addEventListener(MouseEvent.CLICK, ContentLink);
tn_mc.buttonMode = true;
var s_TM:TransitionManager = new TransitionManager(s_mc);
var y_TM:TransitionManager = new TransitionManager(y_mc);
var p_TM:TransitionManager = new TransitionManager(p_mc);
var t_TM:TransitionManager = new TransitionManager(t_mc);
var tn_TM:TransitionManager = new TransitionManager(tn_mc);
var myTween:Tween;
var xTween:Tween;
var yTween:Tween;
function onMouseOver (e:MouseEvent):void
{
switch (e.currentTarget)
{
case s_mc :
bg_mc.addChild(s_image);
//s_TM.startTransition({type:Zoom, direction:Transition.OUT})
break;
case y_mc :
bg_mc.addChild(y_image);
//y_TM.startTransition({type:Zoom, direction:Transition.OUT})
//myTween = new Tween(e.currentTarget, "none",None.easeNone,1,0,2,true);
break;
case p_mc :
bg_mc.addChild(p_image);
//p_TM.startTransition({type:Zoom, direction:Transition.OUT})
//myTween = new Tween(e.currentTarget, "alpha",None.easeNone,1,0,2,true);
break;
case t_mc :
bg_mc.addChild(t_image);
//myTween = new Tween(e.currentTarget, "alpha",None.easeNone,1,0,2,true);
//t_TM.startTransition({type:Zoom, direction:Transition.OUT})
break;
case tn_mc :
bg_mc.addChild(tn_image);
//myTween = new Tween(e.currentTarget, "alpha",None.easeNone,1,0,2,true);
//tn_TM.startTransition({type:Zoom, direction:Transition.OUT})
e.currentTarget.play();
break;
}
e.currentTarget.gotoAndPlay("animate");
var yDistance:Number=Math.abs(parent.mouseY-y);
if(yDistance>maxYDistance){
if(e.currentTarget.x==x) return;
else{
TweenLite.to(e.currentTarget,.1,{x:e.currentTarget.x,scaleX:1,scaleY:1});
return;
}
}
/* var xDistance:Number=parent.mouseX-_initPosition;
xDistance=xDistance>maxXDistance?maxXDistance:xDistance;
xDistance=xDistance<-maxXDistance?-maxXDistance:xDistance;
var posX=_initPosition-xDistance;
var scale:Number=(maxXDistance-Math.abs(xDistance))/maxXDistance;
scale=0.6+(0.6*scale);
TweenLite.to(e.currentTarget,.3,{x:posX,scaleX:scale,scaleY:scale});*/
//var scale:Number = e.currentTarget.scaleX *1.5;
myTM.startTransition({type:Fade, direction:Transition.IN})
//var xTween:Tween = new Tween(e.currentTarget, "scaleX", Regular.easeIn, 0.6, 0.8, 1, true);
//var yTween:Tween = new Tween(e.currentTarget, "scaleY", Regular.easeIn, 0.6, 0.8, 1, true);
}
function onMouseOut (e:MouseEvent):void
{
switch (e.currentTarget)
{
case s_mc :
bg_mc.removeChild(s_image);
break;
case y_mc :
bg_mc.removeChild(y_image);
break;
case p_mc :
bg_mc.removeChild(p_image);
break;
case t_mc :
bg_mc.removeChild(t_image);
break;
case tn_mc :
bg_mc.removeChild(tn_image);
break;
}
//var scale:Number = e.currentTarget.scaleX /1.5;
myTM.startTransition({type:Fade, direction:Transition.IN})
e.currentTarget.gotoAndPlay("animate_roll");
TweenLite.to(e.currentTarget,.1,{x:e.currentTarget.x,scaleX:0.6,scaleY:0.6});
//var xTween:Tween = new Tween(e.currentTarget, "scaleX", Regular.easeOut, 0.8, 0.6, 1, true);
//var yTween:Tween = new Tween(e.currentTarget, "scaleY", Regular.easeOut, 0.8, 0.6, 1, true);
}
var container:MovieClip = new MovieClip();
//container.graphics.beginFill(0xFF0000);
//container.graphics.drawRect(0, 0, 970, 180);
//container.graphics.endFill();
addChild(container);
//container.width = myClipWidth;
}
??xml version="1.0" encoding="utf-8"??
?yourbanner?
?banner name="banner1"?
?prepaid?student.html?/prepaid?
?/banner?
?banner name="banner2"?
?prepaid?adult.html?/prepaid?
?/banner?
?banner name="banner3"?
?prepaid?parents.html?/prepaid?
?/banner?
?banner name="banner4"?
?prepaid?travel.html?/prepaid?
?/banner?
?banner name="banner5"?
?prepaid?town.html?/prepaid?
?/banner?
?/yourbanner?
Venom the last dance animation
-
Venom the last dance animation, hope you like it
https://www.youtube.com/watch?v=HHG3A-zR7CY
1 week ago
0 comments:
Post a Comment