• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Can I control the scale property of a layer with a value of source text from a different layer

New Here ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

Hi, I would like to scale a layer from its axis say from 0 to 100 using numerical text such as 0 - 100. 

Basically automate a bar graph values by setting the anchor at the bottom or rectangles and having some text on top links to nulls from paths, so when I wrote 20 in the text on top it would scale the rectangle to 20% scale and move the nulls up. but I also wanted to add the % after the text with +'%' but not sure how I can do that.

All I can manage so far is to use

comp('master').layer([index]).text.sourceText+'%'

which uses the text from 'master' comp and adds the % but id also like to use that value to control the scale of a rectangle in the comp as well, the rectangle is not in the master comp layer.

Any ideas? I dont mind it all being controlled from the same comp if its easier.

Thanks]

Mac

 

TOPICS
Expressions

Views

114

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

Something like this should work, as long as the scale value is the first part of the text:

y = parseFloat(comp('master').layer([index]).text.sourceText);
[value[0],y]

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

This worked perfectly, Thank you so much!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 09, 2022 Mar 09, 2022

Copy link to clipboard

Copied

LATEST
This worked like a charm Thank you so much!
Mac.

*Maciej Gorski** - *Designer, ITV Daytime

**** Working From Home ****

*Tel: *0207 827 7345* Mob: *07949 501258

*E-mail: *maciej.gorski@itv.com

*StudioWorks Television Centre*
101 Wood Lane

Shepherd’s Bush

London

W12

7FW
and offices at
*The Westworks*
*ITV Daytime - 1st Floor*
195 Wood Ln, White City,

London

W12

7FQ

--







ITV plc
(Registration No. 4967001) (ITV) is
incorporated in England and Wales with its
registered office at 2
Waterhouse Square, 140 Holborn, London EC1N 2AE. Please visit www.itv.com
 forfurther information.



This email and any
attachments are intended solely for the addressee and may contain
confidential,
copyrighted and/or privileged information.  If you have
received this message
in error, please notify us and delete it.  Recipients
should scan the
email and any attachments for their own protection. 



This
email does not conclude a binding agreement. If there is commercial
information in this email it remains subject to contract and management
approval. The views or opinions
presented in this email do not necessarily
represent those of ITV.

We reserve the right to monitor all e-mail
communications, as permitted by applicable law and regulations.



For
details of how we process personal data, please see the privacy notices for
each of ITV's business areas at http://www.itv.com/groupprivacy

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines