Jump to content
Search Community

TweenMax doubt: on overwriting

ajmeraviglia test
Moderator Tag

Recommended Posts

Hello,

I am spending my summer holidays trying to get familiar with TweenMax, which I think is a great code, and I find myself in a dead end situation at this moment.

 

If you look at the .fla file I have included, you will see Symbol_1 has a rollover-rollout effect (Symbol_2 just does its task, and doesn’t have this effect). I have not been able to do this just writing code (and I have tried anything I could figure with the skills I have at this moment) and I had to use a fake Symbol_1_fk that appears and disappears at the right moments.

 

When I tried to do this with code, this line:

 

Txt_Symbol_1.onRelease = function(){

var twMove1:TweenMax = new

TweenMax.to(Txt_Symbol_1, 0.1, {_alpha:100});

}

 

affected all lines regarding Symbol_1’s alpha, and overwrite : int did not help.

 

I don’t want to use a button, which on the other side would not help, either.

¿How can I do this?

 

Thank you very much for your work and your help. Greetings from Spain.

 

Alejandro Meraviglia.

Link to comment
Share on other sites

hello ajmeraviglia,

 

I had a difficult time understanding your post. but it you want Txt_Symbol2 to behave like Txt_Symbol1, do this:

 

1: remove all the code the from your file.

 

2: add this code

 

 

 

 

 

import com.greensock.*;
TweenMax.to(Symbol_2,0.1,{_alpha:30, inmediateRender:true});
TweenMax.to(Txt_Symbol_2,0.1,{_alpha:40, inmediateRender:true});

var Symbol2CLicked:Boolean = false;

Txt_Symbol_2.onRollOver = function()
{
if (!Symbol2Clicked)
{
	TweenMax.to(Txt_Symbol_2,.5,{_alpha:100});
}
};


Txt_Symbol_2.onRollOut = function()
{
if (!Symbol2Clicked)
{
	TweenMax.to(Txt_Symbol_2,.5,{_alpha:30});
}
};

Txt_Symbol_2.onRelease = function()
{
Symbol2Clicked = !Symbol2Clicked;
if (Symbol2Clicked)
{
	TweenMax.to(Symbol_2,.5,{_alpha:100});
}
else
{
	TweenMax.to(Symbol_2,.5,{_alpha:30});
}

}

 

3: If Txt_Symbol2 now works to your liking... get rid of all your fake symbols and paste the same code again and edit it to work for Txt_Symbol1

Link to comment
Share on other sites

It works great!!! Thank you very much for your help.

I am sorry I did not explain the problem in an easier way, I'l try to do better in the future.

 

I am unexperienced at this moment in AS coding. I understand the code you sent me from a (let's say) logical point of view, but I will try to find more information to understand it better (and, maybe, use them to create other things in the future).

 

Thank you again.

 

Alex.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...