Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
lucto_et_emergo

applying a tween to a nested symbol via a button, edge animate

Recommended Posts

sym.getComposition().getStage().getSymbol('mc1').getSymbol('element').

 

Above is the button code (btn) I have to reach the symbol 'element',

nested in 'mc1' on the stage.

 

For this example I want to tween 'element' with this code: TweenMax.to(element, 3, {alpha:0.5});

 

in the future I want to apply a timeline to it. (is this possible? Not quite sure)

tl.to(element, 1, {width:"50%"});

 

My problem is that I can't quite point to it, or figure out how to do this... I have managed to work out how to add external images, video, iFrames and apply text to nested symbols via buttons but this one is an issue for me. I hope to be able to control nested symbols within other symbols this way.

 

Anyway I am a newbie and not that great at code so excuse my naivete. and don't laugh.

 

:)

 

 

Link to comment
Share on other sites

Hi lucto_et_emergo :)

 

you can get element easily by one of these methods :

document.getElementById("Stage_mc1_element"); 

$("#Stage_mc1_element");

TweenLite.to( "#Stage_mc1_element" , 1 , {....});

hmm , i can't understand what you mean by : " in the future I want to apply a timeline to it "

pls explain your scenario .

  • Like 3
Link to comment
Share on other sites

Yeah I think you actually answered my question/s, thanks a lot...

 

So since I am working in Edge Animate, I adjusted the code to suit:

 

document.getElementById("Stage_mc1_element_element2_element3"); 
 
TweenLite.to(Stage_mc1_element_element2_element3, 10, {css:{scale:.5, alpha:.2}, ease:Elastic.easeOut})
 
So now I can tween multiple embedded symbols, very exciting stuff, I kinda came across similar code while embedding video into iframes within movie clips, thanks. 
 
So as far as 'attaching a timeline' I meant this:
 
//new timeline lite
//create a TimelineLite instance
var tl = new TimelineLite();
 
tl.to(Stage_mc1_element_element2_element3, 10, {css:{scale:.5, alpha:.2}, ease:Elastic.easeOut})
.to(Stage_mc1_element_element2, 2, {css:{scale:2, alpha:.5}, ease:Elastic.easeOut})
 
tl.timeScale(6);
 
If you know of a more economical way of writing this let me know :)
 
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.
×