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 attribute to the counter called the multiplier. Later we'll make the counter broadcast it's count multiplied by this multiplier. It will be of type number. Make sure it's editable in the right-hand side editor.

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 によって変換されたページ (->オリジナル) /