Skip to main content
Participating Frequently
November 19, 2021
Answered

using two frame..... animate cc (canvas)

  • November 19, 2021
  • 1 reply
  • 185 views

<global script>

var a="a";

var b="b";

var c="c";

var d="d";

 

<first frame>

////////////////////////////////////////////////////////////

this.stop();

this.home1.addEventListener("click", home1_ClickToGoToAndStopAtFrame.bind(this));

function home1_ClickToGoToAndStopAtFrame() {

this.gotoAndStop(0);

}this.more1.addEventListener("click", more1_ClickToGoToAndStopAtFrame.bind(this));

function more1_ClickToGoToAndStopAtFrame() {

this.gotoAndStop(1);

}

this.dt_a.text = a; // good

this.dt_b.text = b; // good

 

<second frame> ...............presss more1 btn....... frame move

////////////////////////////////////////////////////////////////////

this.stop();

this.dt_c.text = c; // bad

this.dt_d.text = d; // bad

 

 

//////////////////////////////////////////////////////////////////

I try to divide a lot of variables into two pages.

Please teach me how to use it

    This topic has been closed for replies.
    Correct answer kglad

    those textfields probably aren't defined on the 2nd frame.  to confirm/debug, use console.log:

     

    eg, on your 2nd frame:

     

    console.log("dt_c:" , this.dt_c , ":  c:" , c);

    1 reply

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    November 19, 2021

    those textfields probably aren't defined on the 2nd frame.  to confirm/debug, use console.log:

     

    eg, on your 2nd frame:

     

    console.log("dt_c:" , this.dt_c , ":  c:" , c);

    Participating Frequently
    November 21, 2021

    thanks