FORUMS: list search recent posts

Using button to add number and move MC based on it

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Graham Quince
Using button to add number and move MC based on it
on Nov 21, 2005 at 2:31:53 pm

Hi guys,

Hoping for your debugging help. I've got a flash MX movie, where I need to have several buttons, which when pressed add 1 to one value (freq1), adds 1 to the total.

Then I need to calculate the decimal fraction("dec1"), freq1 divided by total. And finally, move a movie clip, called "one", to the value of freq1 x 100, ie x positions of 100, 200, 300 etc...

I've created an actions movie clip, and placed the following code on it:

onClipEvent (load) {
freq1 == Number(0);
total == Number(0);

onClipEvent (enterFrame) {
dec1 = int((freq1 / total)*100)/100;

if ( <= Number(freq1)*100+100) { += 10;

I also have a set of dynamic text boxes, with the variable names set to freq1, total and dec1. And a button with this code on it:

on (release) {
freq1 += Number(1);
total += Number(1);

Currently, freq1 and total display correctly, and add correctly, but I cannot get dec1 to display at all. And the movie clip "one" does not respond to any formula with freq1 in it.

Any ideas?????


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved