Jump to content
Search Community

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

lucto_et_emergo
Posted

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.

 

:)

 

 

Posted

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
lucto_et_emergo
Posted

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 :)
 

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...