I am using and the HTML overlay feature has the following statements in my overlayload () -> connect () method :
...
gameInterfaceDom = dom; But1 = gameInterfaceDom- & gt; GetElementById ("id_but1"); // trouble here! But2 = gameInterfaceDom- & gt; GetElementById ("id_but2"); LOG_INFO ("pairing onclick event ..."); If (but1! = Nullptr) {onBut1 = but1-> Onclick () - & gt; Connect ([] (dom :: AbstractDOMMouseEvent :: Ptr event) {// something ... LOG_INFO ("button 1 clicked");}); } If (but2! = Nullptr) {onBut2 = but2-> Onclick () - & gt; Connect ([] (dom :: AbstractDOMMouseEvent :: Ptr event) {// something ... LOG_INFO ("button click 2");}); }
...
... compiling and running under Linux 64 works perfectly even if the but1 and but2 IDs in the loaded HTML are not However, the same code crashes Android and Web / HTML5 with the following error (if the expected ID is not found):
Exception threw: Type error : Minko. Employment is empty
Is there any alternative remedy for this case, or is the required ID in C + + also mandatory, which is also defined in html?
Thx.
No comments:
Post a Comment