PDA

View Full Version : passing signals in qml



vinayaka
3rd August 2011, 06:53
Hai,
I need to pass a signal when clicking "player2" button to javascript.

Before we start to play the game we can choose who wants to go first. if we select player1, player1 will play first or if we select player2 button player2 starts first. but i am unable to connect the mouse area to javascript to select the type of the player. can some one help me in this ? its urgent

hema
3rd August 2011, 11:25
import ".js" as Logic;

MouseArea{
id:mousearea
onClicked:Logic.buttonClick() // buttonclick() function in .js file
}

vinayaka
5th August 2011, 08:19
thanx, i did it already but i am unable to get the type of the player who goes first to play ?