A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Actionscript Tween doesn't work first time, works after that - AS2

  1. #1
    Member
    Join Date
    Aug 2006
    Posts
    96

    Actionscript Tween doesn't work first time, works after that - AS2

    Hey All,

    I am totally confused!

    I have a box ("bg_box") that I resize and move up and down using the tween class based on what button you select. Once it is resized the text ("textBox") for that box fades on. It works fine on all the other buttons except for one! I added in a scrollpane with a strip of photos ("gross_scroll") on the button that doesn't seem to want to work. It is just a basic _alpha tween so I am not sure why that would cause a problem.

    The weirdest thing is that it only has an issue the first time the button is clicked. It skips the tween and just jumps right to the size and position it should be. Once you click on another button and click on the troublemaker again, it works just fine. I am totally stumped!

    Here is my code:
    Code:
    	easeType = mx.transitions.easing.Strong.easeOut;  
    	var box_start = bg_box._yscale;
    	var box_end = 100;
    	var time = .5;
    	var box_ystart = bg_box._y;
    	var box_yend = 69.9;
    	var text_start = textbox._alpha = 0;
    	var text_end = textbox._alpha = 100;
    	gross_tween = new mx.transitions.Tween(bg_box, "_yscale", easeType, box_start, box_end, time, true);	
    	gross_ytween = new mx.transitions.Tween(bg_box, "_y", easeType, box_ystart, box_yend, time, true);
    	
    	gross_tween.onMotionFinished = function() {
    	text_tween = new mx.transitions.Tween(textBox, "_alpha", easeType, text_start, text_end, time, true);
    	photo_tween = new mx.transitions.Tween(gross_scroll, "_alpha", easeType, text_start, text_end, time, true);	
    	}
    Any help would be appreciated!!

  2. #2
    Member
    Join Date
    Aug 2006
    Posts
    96
    anyone?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center