The Daily Click ::. Forums ::. Klik Coding Help ::. On release
 

Post Reply  Post Oekaki 
 

Posted By Message

Logiq



Registered
  09/04/2007
Points
  120
10th June, 2008 at 14:51:30 -

Sorry if this question has been answered before but I could not seem to find it anywhere. I wanted to know if there is a way to preform an action upon "releasing" a button rather than when I press it?

 
Hello guys! I'm New! -- I've been new for a year now...haha

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
10th June, 2008 at 15:24:58 -

* (Negate) Repeat while "X" is pressed
* Only one action when event loops
...

That's one way to do it.

 
n/a

Logiq



Registered
  09/04/2007
Points
  120
10th June, 2008 at 17:00:11 -

Sweet thanks I'll try it

 
Hello guys! I'm New! -- I've been new for a year now...haha

Cecilectomy

noPE

Registered
  19/03/2005
Points
  305

Has Donated, Thank You!VIP MemberWeekly Picture Me This Winner!Cardboard BoxGhostbuster!Pokemon Ball!ComputerBox RedSanta HatSnowman
I am an April Fool
11th June, 2008 at 01:32:55 -

you might need to add a condition to that otherwise the action will process at the start of the frame before you ever even press a button.

maybe more along the lines of

* flag is off
* Repeat while 'X' is pressed then
-turn flag on

* flag is on
* (Negate) Repeat while "X" is pressed
-turn flag off

then it wont do anything before you actually press the button.
a bit more work but me thinks would be better.

Image Edited by the Author.

 
n/a

aphant



Registered
  18/05/2008
Points
  1242
11th June, 2008 at 02:13:07 -

You could also do:

* Repeat while key is pressed
- Set Alt Value to 10

* (Negate) Repeat while key is pressed
* Alt Value > 0
- Subtract 1 from Alt Value

* Alt Value > 0
* Alt Value < 10
- What you want to happen after releasing the key

 

LIJI

Flava's Smarter Twin

Registered
  29/08/2006
Points
  2032

I like penguins
11th June, 2008 at 04:19:14 -

Try my key object:
http://ext.neatwares.ath.cx/ext/Key_Object

 
Service Unavailable

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
11th June, 2008 at 08:34:21 -

Yeah, you're right Cecil, I didn't think of that!

Either use Cecil's code or use an extension, like the one LIJI mentioned. The Control X object works too, I think it's included with one of those bonus packs you can download at clickteam.com.

 
n/a

LIJI

Flava's Smarter Twin

Registered
  29/08/2006
Points
  2032

I like penguins
11th June, 2008 at 08:39:55 -

Control X doesn't have On Release AFAIK...

 
Service Unavailable

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
11th June, 2008 at 15:32:53 -

Image

   

 
n/a

LIJI

Flava's Smarter Twin

Registered
  29/08/2006
Points
  2032

I like penguins
12th June, 2008 at 03:11:05 -

So it does... <_<
But Key Object is easier to use! (It has 3 types of input! Integer, String, and Dialog while ControlX has only 2! Also Dialog Input is faster at runtime and easier to code)

 
Service Unavailable

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
12th June, 2008 at 03:25:42 -

Okay    

 
n/a

Logiq



Registered
  09/04/2007
Points
  120
20th June, 2008 at 09:49:32 -

The control X object works perfectly for what I need. thanks again

 
Hello guys! I'm New! -- I've been new for a year now...haha

Bibin

At least 9001

Registered
  01/07/2005
Points
  308

Silver Cup WinnerGOTW Winner!Has Donated, Thank You!VIP Member
20th June, 2008 at 19:14:40 -


Originally Posted by axel
* (Negate) Repeat while "X" is pressed
* Only one action when event loops
...

That's one way to do it.



The only flaw here is that it'll activate on the start of frame. There are of course numerous ways to circumvent this, but it is something I thought I'd point out.

 
n/a

viva/volt

Awesome Sauce

Registered
  26/08/2006
Points
  1694

Game of the Week WinnerSilverNova MemberKlikCast StarVIP Member
20th June, 2008 at 20:44:30 -


Originally Posted by Bibin

Originally Posted by axel
* (Negate) Repeat while "X" is pressed
* Only one action when event loops
...

That's one way to do it.



The only flaw here is that it'll activate on the start of frame. There are of course numerous ways to circumvent this, but it is something I thought I'd point out.



That's something Cecil already mentioned earlier .

 
Image
http://bfollington.tumblr.com
   

Post Reply



 



Advertisement

Worth A Click