Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Programming and Scripting
Mouse Click Event Javascript Fails

Zoo
Guest
Quote
2017-07-27 13:42:43

Hi guys, this forum does not allow me to upload images, so I linked my problem on my forum.

Trying to get multiplayer working but for some reason, this code returns void(0) when I print in exe

----------------------

ccbRegisterMouseDownEvent("mousePressedDown");

function mousePressedDown(button)
{
print("A mouse button was presssed down:" + button);
}

---------------------

@niko

http://marshtownmadness.com/acti...


Zoo
Guest
Quote
2017-07-27 14:18:12

Ok so I discovered this code here

---------------------

behavior_multiPlayer.prototype.onMouseEvent = function(mouseEvent, mouseWheelDelta)
{
if (mouseEvent == 1)
{
print("yes");
}
}

-----------------------

But it does not work, nothing happens when I click the left mouse button

Took this code from

http://www.ambiera.com/coppercub...


Zoo
Guest
Quote
2017-07-27 14:25:55

Tried this aswell

-------------------

behavior_multiPlayer.prototype.onMouseEvent = function(mouseEvent)
{
if(mouseEvent == 3)
{
print("yes");
}


}

-----------------------

Nothing


Zoo
Guest
Quote
2017-07-27 14:33:19

It may be that "print" does not work with behaviors...

Can someone clarify this? @niko

I ran a test with print, in other parts of the code, like onAnimate and it did not print


3dblendsphinx
Registered User
Quote
2017-07-28 09:46:43

Print will not work in the exe. It is only for running in the editor and debug(test) mode.

print(text)

Prints a string into the output window of the editor or into the debug console window of the app.

It doesn't work in the final product of the app (EXE).


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Inter?ational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact