开发者

Counter in AS3 "without dynamic text field"

What is the best way to program an LED number tick. I need to have a number display that goes up to 1,000,000.00. Dynamic text fields are not an option because of symbol instances. How would I make a counter?

ANIMATION

The numbers move in increments like an LED display. This

NUMBERS

The numbers multiple by ten each space over decimal point numbers are not whole, so they go really fast There's a 16,000 frame limit in flash

SYMBOLS

column of numbers that moves in increments, for each number place

WHAT WOULD IT REQUIRE?

num开发者_StackOverflow社区bers move at a rate in multiples of 10 decimal points times one hundred

FRAME BASED OR TIME BASED?

There's a 16,000 frame limit in Flash Time based method would require a lot of code the add and remove child issue

alt text http://www.ashcraftband.com/myspace/videodnd/number_example.jpg

TRANSITION EFFECT

A "tick" move 10 pixels each time etc. 9 and 0 roll over smoothly


In Flash, and to achieve the result in your picture there, I would create 2 MovieClips:

  • A black bar with a decimal point
  • The grey digits in a column, 0 -> 0, as suggested by your pic

Then, combine the black bar and 9 of the digit columns into a single MovieClip to represent your counter, along with a custom base class for it. This allows you fine-grained control over the entire counter.

Provide a CounterClip::Step() or ::Tick() method (or whatever you want to call it) that can move the individual columns. You can use the flash.transitions.Tween class to create smooth animations (I think thats what it's called... I'm a bit rusty.)

If you find you need more than the 9 columns, you can change your Counter MovieClip class to support dynamically adding more digits.


i think it totally depends on the transition effect you are using while switching the numbers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜