on my Animation1.qml: (import "total.js" as Logic)

Qt Code:
  1. ...
  2. onExited: {
  3. if(sRect.visible == true){
  4. jet1.opacity = 0;
  5. rectJet.opacity = 0;
  6. jet1_1.visible = true;
  7. jet1_2.visible = true;
  8. jet1_sound.play();
  9. if(jet1.opacity == 0){
  10. Logic.mV = 5; // here is working but it can't change text of main.qml
  11. }
  12. }
  13. }
  14. ...
To copy to clipboard, switch view to plain text mode 

main.qml: (import "total.js" as Logic)

Qt Code:
  1. ...
  2. Text {
  3. id: total_txt
  4. text: Logic.totaltxt // here is working but it can't understand if or not Animation.qml changes the value
  5. anchors.topMargin: 2
  6. anchors.leftMargin: 15
  7. font.pixelSize: 50
  8. color: "white"
  9. }
  10.  
  11. Animation1 {
  12. id: animation1
  13. anchors.bottom: parent.bottom
  14. anchors.left: parent.left
  15. anchors.bottomMargin: 10
  16. anchors.leftMargin: Math.floor(Math.random()*600+20)
  17. }
  18. ...
To copy to clipboard, switch view to plain text mode 

total.js :

Qt Code:
  1. .pragma library
  2.  
  3. for(var i = 0; i<1; i++){
  4.  
  5. var totaltxt = 0;
  6. var mV;
  7.  
  8. if(mV == 5){
  9. totaltxt++;
  10. }
  11. }
To copy to clipboard, switch view to plain text mode