Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

flash problem

Options
  • 21-03-2005 5:15pm
    #1
    Registered Users Posts: 2,647 ✭✭✭


    The following actionscript works perfectly in the main timeline, but when i put it into the first frame of a movie clip on the main timeline, it won't work at all, even though all the necessary variables are absolutely referenced. There is no reason that I can discern for this problem occuring, has anyone any ideas?
    // initialise count variables
    
    var countVar = 1;
    var pad = "default";
    var total = parseInt(_root.endCount); //ensure that the endcount is an integer
    
    // start loop to isolate the individual pad numbers for the top level
    
    do {
      pad = String(_root["num" + countVar]); 
      pad = pad.substr(0,1);
      tellTarget(_root.keypadlan["padkey"+ pad]){
    	  gotoAndStop("lit")
      }
      countVar++;
    } while (countVar < total);
    
    stop();
    

    If i place a dynamic text field within the movie clip, to trace the variables, and link it to '_root.endCount', it displays the correct value, yet if i link it to 'total' (which converts _root.endCount to an integer) it displays 'NaN' (not a number), indicating that it's not performing that conversion. As stated above, there is no problem with the numbers involved, the script works perfectly on the main timeline, but ideally i need it to work from within a movie clip. There seems to be some convoluted problem with variable referencing, but for no obvious reason.


Advertisement