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

Nested Symbols - Control movement through JavaScript

Engaged ,
Feb 15, 2022 Feb 15, 2022

I have a graphic symbol nested inside another graphic symbol. 

 

The parent symbol has movement controlled via JavaScipt on button press on the main timeline.  I want to do the same for the nested symbol.  How would I do that?

195
Translate
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

correct answers 1 Correct answer

Engaged , Feb 23, 2022 Feb 23, 2022

Worked it out...

Translate
Engaged ,
Feb 15, 2022 Feb 15, 2022


At the moment I have this code on the main timeline.

 

The symbol RFLensHolder is not rotating. However, if I change that code to a diferent graphic symbol which is not nested, that symbol rotates. It appears to be an issue with controlling nested symbols.  

 

    //Right Frame Rotate CW Buttons
    this.ButtonRotateCWRightFrame.addEventListener("mousedown", RF_RotateCW_Down.bind(this));
    
    this.ButtonRotateCWRightFrame.addEventListener("pressup", RF_RotateCW_Up.bind(this));
    
    this.ButtonRotateCCWRightFrame.addEventListener("mousedown", RF_RotateCCW_Down.bind(this));
    
    this.ButtonRotateCCWRightFrame.addEventListener("pressup", RF_RotateCCW_Up.bind(this));
    
    
    //Right Frame Rotate CW Buttons functions to move Rotate Frame CW
    function RF_RotateCW_Down() {
    createjs.Ticker.addEventListener("tick",updateRF_RotateCW);
    }
    
    function RF_RotateCW_Up() {
    createjs.Ticker.removeEventListener("tick",updateRF_RotateCW);
    }
    
    function updateRF_RotateCW(){
    
     var angle = 1/Math.PI;
      root.RFLensHolder.rotation += angle;
    }

 

Translate
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
Engaged ,
Feb 23, 2022 Feb 23, 2022
LATEST

Worked it out...

Translate
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