Search  

TWEENING

HomeForumsFlash Discussiontweening
Default-profile eleshop
18 posts

Hi! Ok, so I want to create a motion tween where, when you roll over the movieclip, the object expands out. When you roll Out of the movie clip, the object retracts back in. This is simple enough.

The problem I have is this: I want the clip to retract relative to where it has expanded to. Basically, if I roll Out of the clip HALFWAY through the tween, I want it to retract starting from that halfway point, NOT from the fully expanded clip. And I want it to be relative to every position that the tween might be in. Does this make sense?

Is there actionscript (2.0) to do this? Or would I need to keyframe every single frame to tell it to go to the relative frame on a rollOut? That would suck. Thanks!

Posted about 1 month ago
43487 dSKY
465 posts
Exclusive author Author was featured Referred at least one person Sold between 5 000 and 10 000 dollars Bought between 1 and 9 items
Hi , you can do this: clip.onRollOver=function(){ this.onEnterFrame=expand; } clip.onRollOut=function(){ this.onEnterFrame=contract; }

function expand(){ this.nexFrame(); if (this._currentframe==this._totalframes){ delete this.onEnterFrame; } } function contract(){ this.prevframe(); if (this._currentframe==1){ delete this.onEnterFrame; }

} I hope this helps :) Posted about 1 month ago
43487 dSKY
465 posts
Exclusive author Author was featured Referred at least one person Sold between 5 000 and 10 000 dollars Bought between 1 and 9 items

For some reason , html tags are not working ….......

Posted about 1 month ago
43487 dSKY
465 posts
Exclusive author Author was featured Referred at least one person Sold between 5 000 and 10 000 dollars Bought between 1 and 9 items
clip.onRollOver=function(){
 this.onEnterFrame=expand; } 
clip.onRollOut=function(){
 this.onEnterFrame=contract;
 } function expand(){
 this.nexFrame();
 if (this._currentframe==this._totalframes){
 delete this.onEnterFrame; }
 } 
function contract(){
 this.prevframe();
 if (this._currentframe==1){ 
delete this.onEnterFrame;
 }
 } 
Posted about 1 month ago
43370 djankey
248 posts
Item was featured Author was featured Referred at least one person Sold between 10 000 and 50 000 dollars Bought between 50 and 99 items

use

<pre>your code</pre>


Posted about 1 month ago
43487 dSKY
465 posts
Exclusive author Author was featured Referred at least one person Sold between 5 000 and 10 000 dollars Bought between 1 and 9 items

I know :) , but for some reason it won’t work when I use FF I had to switch to Opera and post again.

Posted about 1 month ago
Default-profile eleshop
18 posts

Ah, cool! Took me a little bit to figure out what was going on there, but that looks like it would work perfect!

I think I was just trying to figure out how to jump back and forth between 2 different tweens. So, just stay in the same tween! Thanks, dSKY!

Posted about 1 month ago
Default-profile eleshop
18 posts

dSKY:

I know this is an old post, but I am still having troubles. Where do I put this code?

My file basically looks like this: the _root contains a movieClip with the instance name of “nav”. Inside this clip are 4 buttons. Also inside this “nav” clip are 4 movie clips containing the animation I want to expand and contract.

I am assuming I need to put the code in the movie clip that has the actual animation. But, now we are 3 levels deep: _root, nav, animation1. “this.onEnterFrame” is referring to animation1, which is where I put my script. And “clip” I’m sure refers to btn1. However, btn1 is 1 level up from this animation. I basically changed the code to this, and it didn’t work. What am I doing wrong?

 _root.nav.btn1.onRollOver=function(){
 this.mcAbout.onEnterFrame=expand; } 
_root.nav.btn1.onRollOut=function(){
 this.onEnterFrame=contract;
 }

function expand(){
 this.nexFrame();
 if (this._currentframe==this._totalframes){
 delete this.onEnterFrame; }
 } 

function contract(){
 this.prevframe();
 if (this._currentframe==1){ 
delete this.onEnterFrame;
 }
 } 
Posted about 1 month ago