Note that there are some explanatory texts on larger screens.

plurals
  1. POCounter triggers sprites as3
    primarykey
    data
    text
    <p>How do I use the counter to trigger sprites? Need an example or idea to work from.</p> <p>I want the number values to load sprites. The value of the counter goes to a text field. I want each number value to have an "if" condition to play a sprite of a corresponding number.</p> <p><a href="http://www.ashcraftband.com/myspace/videodnd/icon_7.jpg" rel="nofollow noreferrer">alt text http://www.ashcraftband.com/myspace/videodnd/icon_7.jpg</a></p> <p><strong>Dumb example</strong><br> //counter plays pictures rather than plays numbers in text field<br></p> <p><strong>Verbose example</strong><br> //if more than 0 and less than 2, play 1 ==> ONE DISPLAYS ON SCREEN<br></p> <p><strong>Comparison</strong><br> -variable data display "like Flash music visualization"<br> -data is a counter instead<br></p> <p><strong>How it could work</strong><br> -loaders receive number values from counter<br> -9 targets "9 number spaces"<br> -add and remove child<br> -allows counter to look like anything<br></p> <p><a href="http://www.ashcraftband.com/myspace/videodnd/icon-3.jpg" rel="nofollow noreferrer">alt text http://www.ashcraftband.com/myspace/videodnd/icon-3.jpg</a></p> <p><strong>COUNTER I WANT TO USE</strong><br></p> <pre><code>//"counts to a million with two decimal places" &lt;br&gt; var timer:Timer = new Timer(10); var count:int = 0; //start at -1 if you want the first decimal to be 0&lt; var fcount:int = 0; timer.addEventListener(TimerEvent.TIMER, incrementCounter); timer.start(); function incrementCounter(event:TimerEvent) { count++; fcount=int(count*count/10000);//starts out slow... then speeds up mytext.text = formatCount(fcount); } function formatCount(i:int):String { var fraction:int = i % 100; var whole:int = i / 100; return ("0000000" + whole).substr(-7, 7) + "." + (fraction &lt; 10 ? "0" + fraction : fraction); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload