Skip to main content
jjy10047048
Participant
December 28, 2016
Answered

hello guys.. i got stuck

  • December 28, 2016
  • 4 replies
  • 260 views

well hello guys

i have some problem

i want to include code 

     if(loop=null){loop= false;}

before  this.initialize(mode,startPosition,loop,{});

but when i was using Animate CC to publish

the code like below the code

how to include the code ;;

plz somebody help me;;

(lib.quizSet = function(mode,startPosition,loop) {

  this.initialize(mode,startPosition,loop,{});

   // timeline functions:

   this.frame_0 = function() {

       try{

          var i = QzSet();

          i.Init();

       }catch(err){

            console.log(err)

       }

  }

    This topic has been closed for replies.
    Correct answer kglad

    if(loop=null) will assign the variable loop to null.  you probably want, if(loop==null) which tests if loop is null.

    but it makes no sense to then assign it to false.  what's the point of that?

    if(loop) resolves the same way whether loop is false or null.  the if-branch doesn't execute.  if you had an else branch, it would execute when loop is false or loop is null.

    4 replies

    Legend
    December 28, 2016

    It looks like you're wanting to modify the code generated when you publish. 99% of the time this means you're Doing it Wrong. Work with the framework, not against it.

    What, exactly, are you actually trying to accomplish here?

    jjy10047048
    Participant
    December 28, 2016

    well..

    below source is just only run up 1st root

    when i play again the below

    it is moveclip

    (lib.quizSet = function(mode,startPosition,loop) {

      this.initialize(mode,startPosition,loop,{});

       // timeline functions:

       this.frame_0 = function() {

           try{

              console.log('start');

              var i = QzSet();

              i.Init();

           }catch(err){

                console.log(err)

           }

      }

    좋아요 (0)

    jjy10047048
    Participant
    December 28, 2016

    well..

    i was thinking about moveclip run up

    (lib.quizSet = function(mode,startPosition,loop) {

      this.initialize(mode,startPosition,loop,{});

       // timeline functions:

       this.frame_0 = function() {

           try{

              var i = QzSet();

              i.Init();

           }catch(err){

                console.log(err)

           }

      }

    kglad
    Community Expert
    kgladCommunity ExpertCorrect answer
    Community Expert
    December 28, 2016

    if(loop=null) will assign the variable loop to null.  you probably want, if(loop==null) which tests if loop is null.

    but it makes no sense to then assign it to false.  what's the point of that?

    if(loop) resolves the same way whether loop is false or null.  the if-branch doesn't execute.  if you had an else branch, it would execute when loop is false or loop is null.