Variable issues with Actionscript

This is a discussion on "Variable issues with Actionscript" within the Flash & Multimedia Forum section. This forum, and the thread "Variable issues with Actionscript are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Dec 13th, 2005, 20:24
New Member
Join Date: Dec 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Variable issues with Actionscript

I am working on a claims-paid counter for one of my company's websites. I have a javascript that determines the value which the counter will start counting from. It then passes the variables to my flash file. The variables are successfully passed to the Flash file. However, when the Actionscript tries to increase the values of these variables so that the counter properly counts, the values get reset to 1000. If I hardcode the variable values in the Actionscript it works perfectly. Does anyone know why this happens? Thanks in advance.

Here's the Actionscript code:

Quote:
stop();
var cents = 100;

// Count the Cents
function CountUp() {
if (cents >= 99) {
cents = 10;
cents += 1;
addHundred();
}
else {
cents += 1;
}
}

// Set the CountUp Interval
setInterval(CountUp, 1);

// Add to Hundred
function addHundred() {
if (hundred > 1999) {
hundred= 1000;
hundred += 1;
addThousand();
}
else {
hundred += 1;
}
}

// Add a Thousand
function addThousand() {
if (thousand > 1999) {
thousand = 1000;
thousand += 1;
addMillion();
}
else {
thousand += 1;
}
}

// Add a million
function addMillion() {
if (million > 999) {
million = 500;
million += 1;
}
else {
million += 1;
}
}
Reply With Quote

Reply

Tags
variable, issues, actionscript

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
a little actionscript ziggi Flash & Multimedia Forum 0 Sep 18th, 2007 11:46
Actionscript within .NET timshih ASP.NET Forum 0 Aug 16th, 2007 00:56
actionscript cressy Flash & Multimedia Forum 3 Jul 24th, 2007 07:29
Actionscript 3.0 Sgaspar11 Flash & Multimedia Forum 7 May 28th, 2007 18:31
[MX] actionscript prob nutbolt Flash & Multimedia Forum 0 May 21st, 2007 17:04


All times are GMT. The time now is 01:44.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43