EC Banner

Vodpod videos no longer available.

Still need to check for child – then remove if child exists. Found a workaround for now….
import com.greensock.TweenLite;
import com.greensock.easing.*;

var food:MovieClip = new(theFood);
var wine:MovieClip = new(theWine);
var chefs:MovieClip = new(theChefs);
var fun:MovieClip = new(theFun);

var one:Number=764;
var two:Number=236;
slider.addChild(wine);

addEventListener(Event.ENTER_FRAME, onLoop);

function onLoop(evt:Event):void {
var thisPos:Number = (Math.round(this.x));
this.x-=1;

if (thisPos==490) {
food1_mc.play();
wine2_mc.gotoAndStop(1);
slider.x = wine1_mc.x;
TweenLite.to(slider, 3, {x:food1_mc.x, ease:Strong.easeOut});
slider.removeChild(wine);
slider.addChild(food);

} else if (thisPos == 355) {
food1_mc.play();
fun1_mc.play();
TweenLite.to(slider, 3, {x:fun1_mc.x, ease:Strong.easeOut});
slider.removeChild(food);
slider.addChild(fun);

} else if (thisPos == 230) {
fun1_mc.play();
chefs1_mc.play();
TweenLite.to(slider, 3, {x:chefs1_mc.x, ease:Strong.easeOut});
slider.removeChild(fun);
slider.addChild(chefs);

} else if (thisPos == 105) {
chefs1_mc.play();
wine2_mc.play();
TweenLite.to(slider, 3, {x:wine2_mc.x, ease:Strong.easeOut});
slider.removeChild(chefs);
slider.addChild(wine);

} else if (thisPos == -20) {
wine2_mc.play();
food2_mc.play();
TweenLite.to(slider, 3, {x:food2_mc.x, ease:Strong.easeOut});
slider.removeChild(wine);
slider.addChild(food);

} else if (thisPos == -145) {
food2_mc.play();
fun1_mc.play();
TweenLite.to(slider, 3, {x:fun1_mc.x, ease:Strong.easeOut});
slider.removeChild(food);
slider.addChild(fun);

} else if (thisPos == -270) {
fun1_mc.play();
chefs2_mc.play();
TweenLite.to(slider, 3, {x:chefs2_mc.x, ease:Strong.easeOut});
slider.removeChild(fun);
slider.addChild(chefs);

} else if (thisPos == -395) {
chefs2_mc.play();
wine2_mc.play();
TweenLite.to(slider, 3, {x:wine2_mc.x, ease:Strong.easeOut});
slider.removeChild(chefs);
slider.addChild(wine);

} else if (this.x<=-488) {
this.x=498;
}

}

Advertisements

3 comments on “EC Banner

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s