Hi there, I new with AE script (I much familiar with ActionScript in Flash, not an expert though). I try to control my solid object using GUI Slider I made but it's doesn't work. I need help here. Here is my code:

myComp = app.project.item(1);
mySolid = myComp.layers.addSolid([1.0,1.0,0], "my square", 50, 50, 1);
var myWin = new Window("palette", "Transform", undefined);
    myWin.orientation = "row";
var myOpacity = myWin.add("panel", undefined, "Opacity");
    myOpacity.orientation = "column";
    myOpacityText = myOpacity.add("statictext", [290, 20, 380, 40], "Current value:");
    myOpacityDisplay = myOpacity.add("statictext", [385, 20, 425, 40], "100");
    myOpacity.add("statictext", undefined, "Kontrol Opacity");
    theOpacity = myOpacity.add("slider", [20, 20, 230, 45], 50, 0, 100);
    var layerOpacity = mySolid.property("opacity");
    theOpacity.onChanging = function()
         var val = Math.round(theOpacity.value);
  myOpacityDisplay.text = val;
         layerOpacity.value = val;
myWin.center();
myWin.show();

I don't write scripts that do this because the features are already available with Expression Controls and expressions. That's the route I would suggest. You are reinventing the wheel. If you want specific help on scripting then try asking some questions in the scripting sub forum for AE. You'll find the forum under sub communities.
If you just want to create a slider for opacity that you can add to any layer you select first add an expression control slider to the layer, then press t to reveal the opacity property, then hold down the Alt/Option key and click on the stopwatch to start and expression, then drag the pickwhip to the slider control. Now, with transparency selected select Animation>Save Animation Preset and give it a name. Now when you need a slider to control a layer, or to control a bunch of layers simply select them and apply your preset.
You could also put your expression control slider on a null, give the name a null, apply the expression to a layer and then save the transparency property as an animation preset. Now if you have 50 layers you want to control with a single slider just add the null, change the name, then select all 50 layers and apply your animation preset.
I have a library of about 200 custom animation presets that use expressions to do most of my repetitive  tasks. It saves a ton of time. Heres one that fades a layer in and then out based on the in and out point of the layer. I use this one daily. You'll see what I mean if you apply it to a layer. fadeIO.ffx

Similar Messages

  • After I upgrade maverick my display will suddenly shut off but my sounds is still working. Need help

    After I upgrade maverick my display will suddenly shut off but my sounds is still working. Need help on this? Thank you

    Hello rodamitjr,
    It sounds like your iMac display will turn off unexpectedly, but you can tell the computer is still on because you hear audio.
    I found an article with steps to troubleshoot issues with displays.  This article is for internal and external displays, so you can skip any steps referring to an external display.  I recommend reviewing the full article, but this step specifically stands out to me for the issue you described:
    Reset the system
    You can reset the Mac's parameter RAM and SMC.
    You can find the full article here:
    Apple computers: Troubleshooting issues with video on internal or external displays
    http://support.apple.com/kb/ht1573
    Thank you for posting in the Apple Support Communities.
    Best,
    Sheila M.

  • I have iphone 4s and can't send MMS. I contacted Sprint, they checked everything and it is fine. The advised me to contact Apple. I tried to reset all settings, shut down the iphone but still MMS doesn't work. Plz help!

    I have iphone 4s and can't send MMS. I contacted Sprint, they checked everything and it is fine. The advised me to contact Apple. I tried to reset all settings, shut down the iphone but still MMS doesn't work. Plz help!

    Did you already try to set it up as new device?
    How to back up your data and set up as a new device
    iOS: Wi-Fi or Bluetooth settings grayed out or dim

  • I want to use Windows on my Mac, but Boot Camp doesn't work (Mac OS X 10.7.3)

    Everyone knows that w/ Boot Camp you can use Windows on Mac, but I can't.

    common issues:
    downloading the drivers with Boot Camp Assistant
    Not reading the guide from in Boot Camp Assistant
    Wanting to use XP (not supported)
    Not enough disk space
    Space is too fragmented - and people don't know or understand the error or how to even backup and then erase and restore (very basic part of prevention and use of computers).
    http://www.apple.com/support/bootcamp/
    Installation Guide  Instructions for all features and settings.
    Boot Camp 4.0 FAQ  Get answers to commonly asked Boot Camp questions.
    Windows 7 FAQ  Answers to commonly asked Windows 7 questions.

  • Ipad 2 with os 6.0.1 the speaker doesn't work, i need help

    I have just upgraded my ipad to os 6.0.1 and after to do this my speaker doesn't work, any help ?

    There are numerous reports of this issue happening on iPhones. It may be a glitch that will need a new update. Some find that a full shut-down and restart fixes that problem, but not always.

  • I can't send  message from iMessage why? I have credits for send but it doesn't work! Need help!

    Hello plz I need help !! I can't send my message with iMessage! I don't understand why?! Yesterday I send it! And now it's not working! I have credits ! So why?! PLZZZZZ need help have to talk to my friend!!

    Let me clarify.
    iMessage is completely different from regular SMS. iMessage is where you can text from Apple device to Apple device (ex. iPad to iPhone, or iPod to iPad)
    SMS is texting service for all phones, excluding the ipod, ipad. (ex. iPhone to Droid, or iPhone to Nokia)
    So when you iMessage someone on you iPhone, it is free and can be sent to anyone with an Apple device.
    When texting SMS, you can send to anyone with any kind of cell phone.

  • My wife and I been trying to use an iTunes card to share it but it. Doesn't work can you help us?

    Can I share my iTunes card with my wife?

    The itunes card credit a single itunes account.
    If she uses the same itunes accoun then she can use it as can anyone who uses your account.

  • My Genius mixes is not working. Need help here. please...

    I did reinstall my itunes 5 times and updated my Genius mixes many times as i could and yet the result is the same. i cant have my Genius mixes. Does anyone know how to fix this? please help. Thanks

    Reset, hold both home and power buttons until the iPhone restarts. Usually takes about 10 seconds of holding both buttons. See if better. If not, Restore iPhone with iTunes on computer. See if better. If not you may need to replace the LCD Display or the iPhone may be beyond repair and you need a new phone.

  • I have tried another exercise, but again I will need help, here's the code

    hi,
    I have another problem. here's the question pluss the code.
    public interface Patient{
    public void doVisit(float hour);
    public boolean hospitalize();
    1. I will need to write a class name OrdinaryPatient which extends Patient.
    the class will include value int that his name age and another value that will be boolean
    of disease.
    I have to do two constructors. one that don't get values and give them default and the other one
    that does get values.
    another method name docVisit which get a visit to the doctor time visit and will print a message.
    the method hospitalize will hospitalize the patient (and if he will have disease he will get true).
    and for age I have to write methods of get and set.
    2. I will need to write a class of Hipochondriac that extends from OrdinaryPatient.
    I have to do two constructors. one that don't get values and make default and the other one that do get values.
    I will need to ade int by the name of numberOfHospitalize.
    I will need to move the method hospitalize that it will be possible to hospitalize the hypochondriac
    on with the value numberOfHospitalize that his small from 5 and if he will hospitalize he will return
    the value true.
    3. write class PatientClass which will be the method main.
    do 10 objects from OrdinaryPatient, 5 that don't get values and 5 will get randomaly age and
    chronic disease with true.
    do 10 objects from Hipochonidraic, 9 that don't get values and one get all of them.
    save all objects in value from Patinet.
    print for each of them their age.
    print for the OrdinaryPatient alone the method of Hospitalize.
    ok, here's what I did.
    1. OrdinaryPatient
    pbulic class OrdinaryPatient implements Patient{
    private int age;
    private boolean disease;
    public OrdinaryPatient(){
    this.disease=false;
    this.age=0;
    public OrdinaryPatient(int age,boolean ddisase){
    this.disease=disease;
    this.age=age;
    public int getAge(){
    return age;
    public void setDisease(boolean disease){
    this.disease=disease;
    public void setAge(int age){
    this.age=age;
    public void docVisit(){
    System.out.println("Patient's visit is one hour");
    public boolean hospitalize(){
    return false;
    2. public class Hipochondriac extends OrdinaryPatient{
    private = numberOfHospitalize;
    public Hipochondriac();
    super();
    numberOfHospitalize=0;
    public Hipochondriac(int age, boolean diseased, int numberOfHospitalize){
    super(age.diseased);
    setnumberOfHospitalize(numberofHospitalize);
    from here I don't know how to continue.
    3. public class PatientClass{
    public static void main(String args[]){
    patient patinets= new patient[20];
    for (int i=0; i<5; i++){
    patients= new OrdinaryPatient();
    from i'm stuck!!!
    if you can help me to improve it I will appriciate it...
    Einat

    here my result.
    1. public interface Patient{
         public void docVisit(float hour_;
         public boolean hospitalize();
    public class OrdinaryPatient extends Patient
         private int age;
         private boolean disease;
    //constructors
         public OrdinaryPatient(){
              age=20;
              disease=true;
         public OrdinaryPatient(int age, boolean disease) {
              setAge(age);
              this.disease=disease;
    //methods
         public int getAge() {
              return age;
         public void setAge(boolean disease) {
              if(age>0 && age<120)
                   this.age=age;
         //overriding methods.
         public void docVisit(float hour) {
              System.out.println("your visit turn is at "+hour");
         public boolean hospitalize(){
              System.out.println("go to hospital");
              if(disease)
                   return true;
              else
                   return false;
    2. public class Hipochondriac extends OrdinaryPatient{
         private int numberOfHospitalize;
    //constructors
         public Hipochondriac(){
         public Hipochondriac(int age, boolean disease, int numberOfHospipitalize){
              setAge(age);
              this.disease=disease;
              this.numberOfHospitalize=numberOfHospitalize
         //methods
         public int getNumberOfHospitalize(){
              return numberOfHospitalize;
         public void setNumberOfHospitalize(int numberOfHostpitalize){
              if(numberOfHospitalize>0)
                   this.numberOfHospitalize=numberOfHospitalize;
         public boolean hospitalize(){
              if(numberOfHospitalize<5)
                   System.out.println("go to hospital");
                   numberOfHospitalize++;
                   return true;
              else
                   return false;
    3. public class PatientClass
         //constructors
         private PatientClass(String[] args){
              //private methods helps to build the object.
              intialArr(args);
              printAge();
              gotHospital();
    //methods.
    private void intialArr(String[] args){
         int i;//array index
         for(i=0;i<arr.lents/2;i+=2)
              arr=new OrdinaryPatient();
              arr[i+1]=new OridnaryPatient((int)(Math.random()*121),true);
         for(;i<=arr.length-2;i++)
              arr[i]=new Hipochondriac();
         arr[i]=new Hipochondriac(Interget.parseINt(args[0]),
         private void printAge(){
              for(int i=0;i<arr.length;i++)
                   System.out.println(((OrdinaryPatient)arr[i]).getAge());
         private void gotoHospital(){
              for(int i=0;i<arr.length;i++)
    //checking for ordinarypatient objects only
                   if(!(arr[i] instanceof Hipochondriac))
                        //dont need casting
                        arr[i].hospitalize()[
         //main method
         public static void main(String[] args)
              //setting the commandLine array from the main to PatientClass object
              PatientClass pc=new PatientClass(args);
    let me know if it's seems logic to you.
    thank you, Einat     

  • I have had problems syncing on my Windows XP computer and yesterday I got my laptop back with a virus removed and was able to sync.  Then I updated the operating system to 5.0 and now the restore won't work.  Please help!  I got error code 50.

    I have had problems syncing my iPhone 4 and my iPad on my Windows XP laptop.  My computer had a virus and spyware, but is now fixed.  I was then able to sync both phone and ipad, but when I tried to update to ios-5.0, the update worked, but the restore would not.  Now I don't know what to do with my phone.  Is there a way to get the restore to work, or should I set it up as a new phone.  I have lots of apps, etc. that I do not want to lose.

    Hello,
    Welcome to the HP Forums!
    I understand the IDT Audio driver is missing. I can help you get it back, but first I require the following information:
    1. The computer's model number. If you require assistance locating this information, please reference this website: Guide to finding your product number
    2. The computer's operating system. If you require assistance locating this information, please reference this website to determine your Windows operating system.
    3. Have you installed any new hardware on this computer, before the issue appeared?
    4. Have you installed any new software or drivers on this computer, before the issue appeared?
    Mario
    I worked on behalf of HP.

  • I have a problem with word. I trashed it yesterday by mistake. So I downloaded once again the office software 2011 package but it still doesn't work. Everytime I try to open a document it says "error" and the office package appears twice on my taskbar

    This is what it says
    Microsoft Error Reporting log version: 2.0
    Error Signature:
    Exception: EXC_BAD_ACCESS
    Date/Time: 2014-02-23 07:52:59 +0000
    Application Name: Microsoft Word
    Application Bundle ID: com.microsoft.Word
    Application Signature: MSWD
    Application Version: 14.2.0.120402
    Crashed Module Name: libobjc.A.dylib
    Crashed Module Version: unknown
    Crashed Module Offset: 0x000044a7
    Blame Module Name: MBURibbon
    Blame Module Version: 14.3.9.131030
    Blame Module Offset: 0x0001007c
    Application LCID: 1040
    Extra app info: Reg=en Loc=0x0410
    Crashed thread: 0

    You might want to try asking your Office for Mac question in the Office for Mac forums located here: http://answers.microsoft.com/en-us/mac

  • Just today my iphone5 will not get email.  Error says user name/password is incorrect.  I have retyped info but it still doesn't work. Any suggestions?

    My iphone5 can't open email.  Says user name/password incorrect; however, my info has not changed.
    Any suggestions

    I agree. The iPhone is not saying that your email settings are wrong, it is your email. Please check that your email is working using a computer or something else. If it works then delete your account on your iPhone and set it up again.
    I hope that this helps and do please report back.

  • I restored my ipod and now the Nike app is crashing on me.  I've tried turning it off and back on but it doesn't work. Please help.

    I restored my ipod and now the Nike app is crashing on me.  I've tried turning it off and on again, but it still doesn't work.  Please help.

    Hi,
    Have you tried a Reset...
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    The Apple logo will Appear and then Disappear...
    Usually takes about 15 - 20 Seconds...
    Release the Buttons...

  • I have purchased the Acrobat pro subscription for 1 year and have followed the steps to install it. But when i go to start it, It crashes and it does this every time! I have restarted my mac pro and also restarted in safe mode but it just doesn't work! PL

    I have purchased the Acrobat pro subscription for 1 year and have followed the steps to install it. But when i go to start it, It crashes and it does this every time! I have restarted my mac pro and also restarted in safe mode but it just doesn't work! PLEASE HELP!!

    Hi jim1287,po
    Check for the latest updates. Installing latest updates should resolve this problem.
    Also, try to ran disk repair using safe mode in Mac, for instructions please visit: http://support.apple.com/kb/PH14204
    Try enabling root user profile on mac and try to check. OS X Mavericks: Enable and disable the root user
    Regards,
    Ajlan Huda.

  • I need help with the photo stream. Everytime I try to open it on my PC it says photo stream is unable and I have tried everuthing to enable it but it doesn't work. Any help, please?

    I need help with the photo stream. Everytime I try to open it on my PC it says photo stream is unable and I have tried everuthing to enable it but it doesn't work. Any help, please?

    Freezing, or crashing?
    ID on the Mac can produce reports that may (or may not) prove helpful in diagnosing the problem. I suspect this is something not directly related to InDesign, and maybe not to any of the Adobe apps directly since you seem to be having a problem in more than one. That often inidcates a problem at the system level.
    Nevertheless, it won't hurt to try to gather the reports. You'll find driections for how to generate them, and to post them on Pastebin.com (then put a link to them here) so we can see what's going on at Adobe Forums: InDesign CS5.5 Not Responding
    Do you happen to run a font manager? If so, which one, and waht version?

Maybe you are looking for

  • IPod not found by computer or iTunes

    about a month ago my iPod nano (3rd gen) just stoppoed working out of know where, and then all of sudden it came back on about two weeks later. Ever since then it has not showed up in iTunes or as a device on my computer.

  • Downloading/Volumes/Firefox/4sll=Su.doc.part because unknown error occured.

    When I try to download info from another e-mail the above info appears in a box. I don't understand what it means or how to retrieve the info. What is happening?

  • OIM: Error while processing reconciliation events

    Hi. I'm using OIM9031 with SAPHR connector (9041) as trusted source. There are about 12000 employees in SAPHR. During reconciliation, some events are in Event Received state. I've verified that all mandatory fields are not-null and contain correct va

  • Iphoto crashes after editing (saving) after update to iphoto09 and 10.6.1

    Hi, i have trouble with iphoto 09 on Mac Book Air. After update from iphoto 08 to 09 and after update to osx 10.6.1, i can not edit any photo. Every time i modify a photo and iphoto want to save it, iphoto crashes. I have tried several repairs with i

  • Brightness problem

    heya i have hp g009ax laptop with windows 8 (64 bit) and i am facing problem with the brightness level .i have tried it from control panel display personalization and also tried the manual keypad buttons but it doesnt responding in terms of the brigh