[Solved] Mouse area onClicked problem.
-
I'm trying follow "this tutorial":http://doc.qt.nokia.com/qtcreator-2.2/creator-qml-application.html but I'm getting an error "ReferenceError: Can't find variable: page" when I click the squares. Here's the code (I removed the first and second rectangles for this to make it shorter)
@import QtQuick 1.0Rectangle {
width: 360
height: 400
color: "#515151"Image { id: logo x: 33 y: 22 source: "qt.png" } Rectangle { id: middleRect x: 274 y: 155 width: 64 height: 64 color: "#00000000" radius: 6 border.color: "#5f5f5f" border.width: 2 MouseArea { id: mouse_area2 anchors.fill: parent onClicked: page.state = 'State2' } } states: [ State { name: "State1" PropertyChanges { target: logo x: middleRect.x y: middleRect.y } }, State { name: "State2" } ]
}@
Its at the line onClicked: page.state = 'State1' that I get the error.
It was working last night when I tried but now its not. I don't know what to do.