on my Animation1.qml: (import "total.js" as Logic)
...
onExited: {
if(sRect.visible == true){
jet1.opacity = 0;
rectJet.opacity = 0;
jet1_1.visible = true;
jet1_2.visible = true;
jet1_sound.play();
if(jet1.opacity == 0){
Logic.mV = 5; // here is working but it can't change text of main.qml
}
}
}
...
...
onExited: {
if(sRect.visible == true){
jet1.opacity = 0;
rectJet.opacity = 0;
jet1_1.visible = true;
jet1_2.visible = true;
jet1_sound.play();
if(jet1.opacity == 0){
Logic.mV = 5; // here is working but it can't change text of main.qml
}
}
}
...
To copy to clipboard, switch view to plain text mode
main.qml: (import "total.js" as Logic)
...
Text {
id: total_txt
text: Logic.totaltxt // here is working but it can't understand if or not Animation.qml changes the value
anchors.topMargin: 2
anchors.leftMargin: 15
font.pixelSize: 50
color: "white"
}
Animation1 {
id: animation1
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.bottomMargin: 10
anchors.leftMargin: Math.floor(Math.random()*600+20)
}
...
...
Text {
id: total_txt
text: Logic.totaltxt // here is working but it can't understand if or not Animation.qml changes the value
anchors.topMargin: 2
anchors.leftMargin: 15
font.pixelSize: 50
color: "white"
}
Animation1 {
id: animation1
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.bottomMargin: 10
anchors.leftMargin: Math.floor(Math.random()*600+20)
}
...
To copy to clipboard, switch view to plain text mode
total.js :
.pragma library
for(var i = 0; i<1; i++){
var totaltxt = 0;
var mV;
if(mV == 5){
totaltxt++;
}
}
.pragma library
for(var i = 0; i<1; i++){
var totaltxt = 0;
var mV;
if(mV == 5){
totaltxt++;
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks