Sequntial Tween- WHY WONT IT WORK??

This is a discussion on "Sequntial Tween- WHY WONT IT WORK??" within the Flash & Multimedia Forum section. This forum, and the thread "Sequntial Tween- WHY WONT IT WORK?? are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jan 15th, 2007, 17:12
Junior Member
Join Date: Jan 2007
Location: Michigan
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Sequntial Tween- WHY WONT IT WORK??

Ok.
Can anyone solve this problem?

Im trying to get an object to move up 200 spaces and then move to the right 362.5 spaces. w/o useing frames, only action script

i put this code inside the movie clip:
Code: Select all
onClipEvent(load){
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    
    var firstTween1:Tween = new Tween(this,"_y",Regular.easeIn,this._y,this._y-200,2,true);
    firstTween1.onMotionFinished = function(){
        trace("Tween 1 Finished");
        var secondTween1:Tween = new Tween(this,"_x",Regular.easeIn,this._x,this._x+362.5,5,true);
        secondTween1.onMotionFinished = function(){
            trace("Tween 2 Finished");
        }
    }
}
the problem is, when i run the flash file, it runs the fisrt tween with out problem, then when its done, it displays the "Tween 1 finished" message like normal so i know the event handeler works, but then it just stops.

then i decided to see what would happen if i got rid of the fisrtTween1.onMotionFinished handeler.

My new code looks like:
Code: Select all
onClipEvent(load){
    import mx.transitions.Tween;
    import mx.transitions.easing.*;
    
    var firstTween1:Tween = new Tween(this,"_y",Regular.easeIn,this._y,this._y-200,2,true);
    //onMotionFinished removed
    trace("Tween 1 Finished");
    var secondTween1:Tween = new Tween(this,"_x",Regular.easeIn,this._x,this._x+362.5,5,true);
    secondTween1.onMotionFinished = function(){//onMotionFinished still there
              trace("Tween 2 Finished");
    }
}
everything work normally in THAT code sequence(even thought its not what it want) which tells me that the secon tween does in fact work

so i know a)my event hadeler works (i displayed the message) and b) my tweens work (they work in the second code)

so my question for all of you is... WHY WONT THEY WORK TOGETHER???

pleeeeeease this is driving me mad!

thanks, joe3dge

Last edited by joe3dge; Jan 15th, 2007 at 21:38.
Reply With Quote

  #2 (permalink)  
Old Jan 15th, 2007, 22:36
Junior Member
Join Date: Jan 2007
Location: Michigan
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Sequntial Tween- WHY WONT IT WORK??

one more thing to add:

i was looking over my program again and i notice that when i run the origional code (the one that DOES have the onMotionFinshed handeler) i noticed that after the "Tween 1 finished" message appears, it waits 5 seconds and then shows the "Tween 2 Finished" message; which means that "secondTween1" is infact running, its just not moving the movie clip across the screen for some reason.

can any help?

thanks, joe3dge
Reply With Quote
  #3 (permalink)  
Old Feb 6th, 2007, 20:00
Junior Member
Join Date: Jan 2007
Location: Michigan
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Talking Re: Sequntial Tween- WHY WONT IT WORK??

nvm i figured it out that i was just using the word this incorrectly
Reply With Quote
  #4 (permalink)  
Old Feb 6th, 2007, 23:27
frinkky's Avatar
Design Admin
Join Date: Oct 2006
Location: Southampton
Age: 30
Posts: 272
Blog Entries: 2
Thanks: 2
Thanked 2 Times in 2 Posts
Send a message via MSN to frinkky Send a message via Skype™ to frinkky
Re: Sequntial Tween- WHY WONT IT WORK??

Could you elaborate on the misuse of 'this'? would help us flash newbies
Last Blog Entry: Fobriwap! (Mar 10th, 2008)
Reply With Quote
Reply

Tags
tween, flash, animation

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
png tween animation issue deluxmilkman Flash & Multimedia Forum 1 Dec 25th, 2007 17:14
sometimes a link wont work.. why? col Web Page Design 1 Aug 20th, 2007 22:38
Is there a way to Tween kerning? griffonwing Flash & Multimedia Forum 3 Jun 13th, 2007 01:53
Tween.onMotionFinished = function() FroXie Flash & Multimedia Forum 6 Feb 6th, 2007 20:13
image-tween mosesus Flash & Multimedia Forum 3 Oct 2nd, 2006 13:24


All times are GMT. The time now is 03:14.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43