hi there.
so i'm now working on a mp3 player, and i got stucked with something. so here's my problem: i've a got bar (songBar) on which it will appear the artist and the song name(artist_txt). what i want is when de title_txt width is larger than the songBar.width, the text to scroll from right to left, and when the tween is finished to scroll from left to right(all this tween has to be a loop). if the width of artist_txt is smaller or equal to the songBar.width then artist_txt is aligned in the center of the songBar. all i'm trying to code it's just what you see in winamp player.
ok. i don't know how to reverse the tween when it ends, how to create the loop and how to stop the tween if the else statement comes into play. i don't want to create the animation on timeline, all i want is code. so if you have any idea please help me. thanks in advance. cheers mate.Code:var textTween:Tween; if (mp3player.artist_txt.width > mp3player.songBar.width){ textTween = new Tween(mp3player.artist_txt, "x", Linear.easeNone, mp3player.songBar.x, mp3player.songBar.width - mp3player.artist_txt.width, 1, true); } else{ mp3player.artist_txt.x =(mp3player.songBar.width + mp3player.songBar.x)/2 }
ps: sorry for my bad english




Reply With Quote
