JonCanfield
04-09-2003, 05:25 AM
I know this is supposed to be simple, but my brain seems to be even more simple. What I'm trying to do is a simple coin counting movie.
I have clips of a quarter, dime, nickel and penny. I want to create a copy of the clip when I click it, and if I drop it on a clip named counter, add the amount of the coin to the total. I'm incrementing the clip name and depth so I can have multiple clips of each coin. Here is what I'm doing for the dime.
function DimeSelect () {
//trace("you clicked the dime");
CurrentDepth++;
DimeCount += 1;
dimeNum = "dime_"+ DimeCount;
trace (dimeNum);
dime.duplicateMovieClip(dimeNum, CurrentDepth);
startDrag (dimeNum, true);
};
function DimeDrop () {
stopDrag();
if (dimeNum._droptarget == "/counter") {
Total += .10;
trace(Total);
Amount.text = "That's $" + Total + "!";
}
};
I have the same set of functions for the other coins. The drag works fine, but I never get a total. Some of this was loosely copied from the drag and drop tutorial.
Any help at all would be greatly appreciated.
Thanks!
I have clips of a quarter, dime, nickel and penny. I want to create a copy of the clip when I click it, and if I drop it on a clip named counter, add the amount of the coin to the total. I'm incrementing the clip name and depth so I can have multiple clips of each coin. Here is what I'm doing for the dime.
function DimeSelect () {
//trace("you clicked the dime");
CurrentDepth++;
DimeCount += 1;
dimeNum = "dime_"+ DimeCount;
trace (dimeNum);
dime.duplicateMovieClip(dimeNum, CurrentDepth);
startDrag (dimeNum, true);
};
function DimeDrop () {
stopDrag();
if (dimeNum._droptarget == "/counter") {
Total += .10;
trace(Total);
Amount.text = "That's $" + Total + "!";
}
};
I have the same set of functions for the other coins. The drag works fine, but I never get a total. Some of this was loosely copied from the drag and drop tutorial.
Any help at all would be greatly appreciated.
Thanks!