[Tweener] Adding tween
Adrien
realeon at hotmail.com
Sun Jan 24 09:13:05 PST 2010
Hello,
I'm sorry i'm still trying to add a tween to this without success...
Last time I posted I didn't include the bit at the end with
my_but.onRelease (I guess it's maybe more understandable now)
The purpose of this code is to click on my_but and it will move
multiple mcs at the same time...
I've tried Zeh's solution but I can't get it to work (thank you Zeh
for having looked at it)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function moveClip_move(p_clip:MovieClip, p_dir:String,
p_distance:Number):Void {
p_clip.count = 0;
p_clip.onEnterFrame = function() {
p_clip.count++;
if (p_dir == "up") {
this._y -= 1;
}else {
this._y += 1;
}
if (this.count == p_distance) {
trace(this)
delete this.onEnterFrame;
}
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
my_but.onRelease = function() {
moveClip_move(my_mc1, 'up', 20);
moveClip_move(my_mc2, 'up', 100);
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Regards
Adrien
Le 16 janv. 10 à 16:00, Zeh Fernando a écrit :
> I'm not sure exactly why you're trying this, but if you're tweening,
> you don't use onEnterFrame. It'd be something like this:
>
> function moveClip(p_clip:MovieClip, p_dir:String,
> p_distance:Number):Void {
> if (p_dir == "up") {
> Tweener.addTween(p_clip,{_y: p_clip.y - p_distance,
> time:1});
> }else {
> Tweener.addTween(p_clip,{_y:p_clip.y + p_distance, time:
> 1});
> }
> }
>
> Zeh
>
> On Sat, Jan 16, 2010 at 8:52 AM, Adrien <realeon at hotmail.com> wrote:
> Hello I'm trying to add a tween to this
>
> import caurina.transitions.Tweener;
>
> function moveClip(p_clip:MovieClip, p_dir:String,
> p_distance:Number):Void {
> p_clip.count = 0;
> p_clip.onEnterFrame = function() {
> p_clip.count++;
> if (p_dir == "up") {
> this._y -= 1;
> }else {
> this._y += 1;
> }
>
> if (this.count == p_distance) {
> trace(this)
> delete this.onEnterFrame;
> }
> }
> }
>
>
> I've tried this but doesn't work... do you know what I'm doing
> wrong? it has something to do with the minus and plus but why?
>
> import caurina.transitions.Tweener;
>
> function moveClip(p_clip:MovieClip, p_dir:String,
> p_distance:Number):Void {
> p_clip.count = 0;
> p_clip.onEnterFrame = function() {
> p_clip.count++;
> if (p_dir == "up") {
> Tweener.addTween(this,{_y -:1, time:1});
> }else {
> Tweener.addTween(this,{_y +:1, time:1});
> }
>
> if (this.count == p_distance) {
> trace(this)
> delete this.onEnterFrame;
> }
> }
> }
>
> Regards
> Adrien
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
>
> _______________________________________________
> Tweener mailing list
> Tweener at lists.caurinauebi.com
> http://lists.caurinauebi.com/listinfo.cgi/tweener-caurinauebi.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.caurinauebi.com/pipermail/tweener-caurinauebi.com/attachments/20100124/db002767/attachment.htm>
More information about the Tweener
mailing list