Skip to content

Navigation Menu

Sign up
This repository was archived by the owner on Mar 30, 2019. It is now read-only.

Upgrade your Component

Luke Pacholski edited this page Mar 6, 2014 · 14 revisions

Alright, so you're ready to re-invent the counter huh? That time-tested, honored and proven foundation of many a firework app - and you think you can do better? Awesome! Let's get started...

  1. Add an Attribute
  2. Add a Listener
  3. Add a broadcast
  4. Bind some Data
  5. Add an Event
  6. Localize it!

Add an Attribute

Let's add an editable attribute to the counter called multiplier. It will be a number and later we'll use it to multiply the current count. Make it a number, and give it a minimum value of 1, and a max of 10. Make sure it's editable in the Appmaker designer and that the value persists when saving your app.

Add a Broadcast

Add a broadcast method to the Counter called times counted. We'll use it to broadcast the total number of incoming signals (count up, count down, reset etc.) that the counter has received.

Add a Listener

Add a listener called "Double Count" that will multiply the the current count by the multiplier attribute that you added earlier.

Add an Event and bind a function

Add a click event using the on-click shorthand and bind it to a method that broadcasts the current count.

Localize it

Add a french translation for the Multiplier attribute that you added.

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /