Page 3 of 3 FirstFirst 123
Results 21 to 25 of 25

Thread: Draw with Flash

  1. #21
    Join Date
    Jul 2006
    Posts
    139
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    http://www.mntp.pitt.edu/Personal%20Pages/personal.html


    Its the "New" one! I was trying different codes before i send it to you!

    Thank you!

  2. #22
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Hey Neo...

    Ok, I'm a little confused as to what you're trying to do with the block of code that you posted before...the bounce function.

    Code:
    bounce_Button.onRelease = function() {  
    		
    		var x_pos = tmp_mc._x;
    
    		tmp_mc.onEnterFrame = function() {
    		
    			tmp_mc.slideTo((x_pos+100),undefined,1);
    			
    			tmp_mc.slideTo((x_pos),undefined,1);
    		}
    Your syntax is off, but basically what I can glean is that you want to move it back and forth 100 pixels. Is that correct?

    This isn't a "bounce" as I would define it, so that's why I'm a little confused. A bounce, for me, would be if it dropped to the bottom and actually bounced ( as in the last three animation types of mcTween).

  3. #23
    Join Date
    Jul 2006
    Posts
    139
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    OK yeah you are right. All I want to do is to move back and forth 100px for a certain period of length. I should have made myself clear! The problem is they are both in sync (they r executed at the same time not one after the another)

    Code:
    tmp_mc.onEnterFrame = function() {
    		
    			tmp_mc.slideTo((x_pos+100),undefined,1);
    			
    			tmp_mc.slideTo((x_pos),undefined,1);
    		}
    How do I overcome this?



    Thanks

  4. #24
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Ok...
    I *think* this will work for you.

    Replace your entire bounce_Button.onRelease function with this:

    Code:
    bounce_Button.onRelease = function() {  
    	mover();
    }
    var count:Number = 0;
    
    function mover() {
    	var x_pos = tmp_mc._x;
    	if (count<10) {
    		tmp_mc.xSlideTo(x_pos+100, .5, "Linear")
    		tmp_mc.xSlideTo(x_pos, .5, "linear", .5, mover)
    		count++
    		trace(count + "seconds");
    	}
    	else {
    		count = 0;
    	}
    }

  5. #25
    Join Date
    Jul 2006
    Posts
    139
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    Hey you r tha man!

    It works!!

    THANKS! (Dont be scared if I come up with more questions!)

Bookmarks

Posting Permissions

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