Disable Line draw in extra.worldClickAdd

Post about the Flash World Construction Kit and the Alchemy port of Box2D.
jinisner
Posts: 146
Joined: Tue Apr 17, 2012 12:08 am

Disable Line draw in extra.worldClickAdd

Postby jinisner » Mon Jan 20, 2014 2:00 am

Hi,

I have been able to draw lines in the extra.worldClickAdd world , but i have not been able to disable the drawing feature here , how can i disable lines from being drawn , i have tried disabling the world and pausing it but it seems to create problem ...

What i want is after drawing lines , when i press a button after that i should not be able to draw any thing on the world ....

Thanks in advance ...

Regards
Jin

IstvanOrosi
Posts: 172
Joined: Thu Mar 01, 2012 9:31 am

Re: Disable Line draw in extra.worldClickAdd

Postby IstvanOrosi » Thu Jan 23, 2014 12:00 pm

Have you tried disabling the handleMouseDown function in extras.WorldClickAdd? Maybe removeEventListener would work but it it doesn't, you could add another boolean variable and enable /disable drawing based on the value in the handleMouseDown function.

jinisner
Posts: 146
Joined: Tue Apr 17, 2012 12:08 am

Re: Disable Line draw in extra.worldClickAdd

Postby jinisner » Fri Jan 24, 2014 12:00 am

@Istvan - thanks a lot

this is what i did -

i took a boolean draw1 - then on a button click i set it to true and coded this inside an enterframe

////////---------------
if(draw1==false)
{
listenWhileVisible(stage, MouseEvent.MOUSE_DOWN, handleMouseDown);
}
else if(draw1==true)
{


}



///////---------------

I can still draw and drawing does not get disabled , i did this inside the gamefile not inside the wck.worldClickAdd

thanks for the time again

Regards
Jin

jinisner
Posts: 146
Joined: Tue Apr 17, 2012 12:08 am

Re: Disable Line draw in extra.worldClickAdd

Postby jinisner » Wed Jan 29, 2014 4:07 am

Can't seem to be disable - listenWhileVisible(stage, MouseEvent.MOUSE_DOWN, handleMouseDown);

even if i try removeeventlistener or use a boolean and then try calling it ...

How can i remove the listenWhileVisible , kindly guide ...

Regards
Jin

jinisner
Posts: 146
Joined: Tue Apr 17, 2012 12:08 am

Re: Disable Line draw in extra.worldClickAdd

Postby jinisner » Mon Feb 03, 2014 2:03 am

Hi,

I have tried pretty much every thing , right from creating the exact same functions as in WorldClickAdd and trying to disable handleMouseDown , but it seems it always access the class in the main folder ...

Also i am unable to influence the values inside handleMouseDOwn , even if i create its instance and then access the properties inside it ...

Any guidance is welcome ...

Regards
Jin


Return to “WCK”



Who is online

Users browsing this forum: Google [Bot] and 1 guest