How to use runtime component's event handler?

Hello, I have imported a runtime.clock component,
I want to use its timer event but want to name is as other onAnimationEnd
@SimpleEvent
public void onAnimationEnd(AndroidViewComponent component) {
clock.Timer(){
d();
clock.TimerEnabled(false);
clock.TimerAlwaysFires(false);
EventDispatcher.dispatchEvent(this, “onAnimationEnd”, component);
}}
But it gives an error so can anyone help me

you can only use this in @SimpleEvent

EventDispatcher.dispatchEvent(this, “onAnimationEnd”, component);

and call these methods in @SimpleFunction

clock.Timer(){
d();
clock.TimerEnabled(false);
clock.TimerAlwaysFires(false);
1 Like

@SimpleEvent
public void onAnimationEnd(AndroidViewComponent component) {
clock.Timer();
EventDispatcher.dispatchEvent(this, “onAnimationEnd”, component);
}
public void clock.Timer() {
d();
clock.TimerEnabled(false);
clock.TimerAlwaysFires(false);
}

Like this @AryanGupta??

do something like this

@SimpleFunction
public void clock.Timer(AndroidViewComponent component) {
d();
clock.TimerEnabled(false);
clock.TimerAlwaysFires(false);
onAnimationEnd(component);
}

@SimpleEvent
public void onAnimationEnd(AndroidViewComponent component) {
EventDispatcher.dispatchEvent(this, “onAnimationEnd”, component);
}

warning: [options] bootstrap class path not set in conjunction with -source 1.7
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/sohamtshah2005/CircularAnimation/CircularAnimation.java:117: error: ‘(’ expected
[javac] public void clock.Timer(AndroidViewComponent component)
[javac] ^
[javac] /projects/goldv2/appinventor-sources/appinventor/components/src/com/appybuilder/sohamtshah2005/CircularAnimation/CircularAnimation.java:117: error: invalid method declaration; return type required
[javac] public void clock.Timer(AndroidViewComponent component)
[javac] ^
[javac] 2 errors
[javac] 1 warning

I think you don’t want to use clock.Timer
you can use MyMethod instead of this

whats that

you can use anything but never use so.some

means do not use . in method name

1 Like

basically i want an event should be displayed named onAnimationEnd and that should be triggered when the Timer event of Clock component fires

i don’t much about extensions but use method name in this format MyMethodName instead of My.Method.Name

ohh so suppose I want to use Clock Component’s Timer event, So will it be
public void ClockTimer()?

broo, method name doesn’t matter in your case