Jump to content
Search Community

horizontal continuous banner advert

JE.T test
Moderator Tag

Recommended Posts

Hi, im new to this class and exploring its possibility,

i got a textField with html Text inside slidding slowly right from letf i , got it to reapeat ok using :

 

tf.x = MAXWIDTH;

tf.y = 5;

tf.height = MAXHEIGHT-10;

tf.autoSize ="left";

 

TweenMax.fromTo(tf,globalDuration,{x:MAXWIDTH},{x:0-tf.width,ease:Linear.easeNone,repeat:-1});

addChild( tf );

 

Quite simple and fun, but im trying to link another tween to it starting at the tail of the frist tf( x:tfposition+spacing ) to make the fealing my first tf is pulling the 2nd in the scene and so on indifinitly.

 

tx for helping :)

je

Link to comment
Share on other sites

tx for reply,

 

i did try to put together 2 tweens in sequences but the second starts before the 1rst has ended and make disapear the first tween,

i want to try to create the effect the first tween tail is pulling the 2nd tween head and so on.

 

var tl2:TimelineMax = new TimelineMax({tweens:[TweenMax.fromTo(tf,globalDuration,{x:MAXWIDTH},{x:0-tf.width,ease:Linear.easeNone}),TweenMax.fromTo(tfCopie,globalDuration,{x:tf.width - MAXWIDTH},{x:0-tf.width,ease:Linear.easeNone})],align:TweenAlign.SEQUENCE,onRepeat:wrapTimeline,repeat:-1});

 

 

looking at this post right now

"Creating a banner advert using the Greensock class"

 

tx again, ill try till it works :)

Link to comment
Share on other sites

If you want the tweens to overlap, just insert() them at whatever time you want (the second would be slightly after the first). And if you want them to travel at the same speed, make sure the duration and distance traveled is the same. Kinda like:

 

var xDest:Number = 0 - MAXWIDTH - tf.width;
var tl2:TimelineMax = new TimelineMax({onRepeat:wrapTimeline, repeat:-1});
tl2.insert( TweenMax.fromTo(tf, globalDuration, {x:MAXWIDTH}, {x:xDest, ease:Linear.easeNone}), 0);
tl2.insert( TweenMax.fromTo(tfCopie, globalDuration, {x:MAXWIDTH}, {x:xDest, ease:Linear.easeNone}), 0.2);

 

Notice the last parameter in the insert() calls - that's the insertion time. So if you want them to run closer together, reduce that number. Or make it bigger to give them more space.

Link to comment
Share on other sites

Tx again ,

 

those line help me , but i still need to make the last frame be 100% the same of the first frame so no there's noBlank after the second insert. < working on it

 

the logic im working on

( the first tween ending point have to be the second tween strarting point and putting the alpha of the first to 0 when they meet ) and so on

 

tx for ur expertise

je

Link to comment
Share on other sites

wow , some update on my situation, im getting to it i think,

 

var xDest1:Number = 0-tf.width;

var xDest2:Number = 0;

var ratio:Number = globalDuration/tf.width;

var diff:Number = tf.width -MAXWIDTH;

var timing:Number = diff*ratio;

 

var tl2:TimelineMax = new TimelineMax({onRepeat:wrapTimeline, repeat:-1});

tl2.insert( TweenMax.fromTo(tf, globalDuration, {x:0}, {x:xDest1, ease:Linear.easeNone}), 0);

tl2.insert( TweenMax.fromTo(tfCopie, globalDuration, {x:tf.width}, {x:0, ease:Linear.easeNone}), timing );

 

 

addChild( tf );

addChild(tfCopie);

 

Still trying to get closer those 2 baby's :)

tx again

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...