Forum Replies Created

  • Failsafe

    August 29, 2007 at 5:33 pm in reply to: controlling text from layer name?

    I know a fair bit of code, javascript and flash AS3. Expression scripting doesn’t seem very difficult, though the concepts and syntax are a bit different.

    For example, the way I am trying to do this is the same way I would handle it in flash, but the text fields could even be pulled from XML or a database, and clickable.

    If you can think of a better way, I won’t shy away from the code. =)

  • Failsafe

    August 29, 2007 at 4:58 pm in reply to: controlling text from layer name?

    I see what you mean about caching and it makes sense, but is a bummer nonetheless.

    Is the only way then to precomp just the circles animating, then put that into a new comp and add text, duplicate it 6 times in the project window, then bring those into Comp 2 individually?

    This will still allow my to animate the circles once and update everywhere if needed, but still have to edit 6 separate comps if I add any animation to the text itself.

  • Failsafe

    August 29, 2007 at 4:26 pm in reply to: controlling text from layer name?

    Thanks for the replies, but not quite there. Dan, it’s close to what you are doing, except I don’t want to have to duplicate the comps themselves in the project window, rather just the layer that contains the comp in the timeline. This way, I can continue to make changes to the animation of the precomp without having to match the animation multiple times.

    I took what you sent though and messed with it a bit and got it closer to what I want, but still not perfect.

    To explain a bit better, I have Comp 1 which contains the text layer and some circles that animate. I put that into Comp 2 and turn it into a 3d layer, then animate that. Now I’d like to duplicate that 3d layer and change it’s position / animation / etc, but retain the original precomped animation of circles. It works great, but all the text is the same. I need to access the layer name in Comp 2 inside of Comp 1, and set the text based on that. So if i name the layer “Title 1” it pulls the array item 1 to the text in the precomp.

    Here’s what I have so far, put onto the source text expression in Comp 1:

    a = [‘test 1’, ‘title two’, ‘myTitle’];
    a [ parseInt ( comp ( “Comp 2″ ).layer( 1 ).name.split(” “) [ 1 ] ) ];

    This works, but I still have to explicitly say layer(1). So I can change the text to be whichever I want by renaming the layer in Comp 2, but it still only looks at the first layer in Comp 2 and sets them all.

    Is there a way to make layer(1) be dynamic as well? How can I change a variable in the parent comp and make the current layers expression in Comp 2 say something like :

    comp( “Comp 1″ ).currentLayerVar = thisComp.layer.name;

    Then I could put this into Comp 1’s text expression:
    a [ parseInt ( thisComp.currentLayerVar.split(” “) [ 1 ] ) ];

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy