LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 


  #1  
Old 09-11-2002, 08:49 PM
targetplanet targetplanet is offline
Registered User
 
Join Date: Mar 2002
Location: Portland, ME
Posts: 14
Rep Power: 0
targetplanet is on a distinguished road
NAN problems

I am developing an online store in flash and
I am trying to change the qnty of an item when the customer presses the add to cart button, But I am just getting NAN no matter what I try. the origanal # being pull from a database.
It doesn't recognize the number as a number.... the variable, pot_qnty, is a text field, but I have tried using a set veriable just for subtracting the qnty #, but it still tuns out NAN
I have even tried the Number() function
NAN

the current code I have on the button is:
stock = Math.floor(pot_qnty);
pot_qnty = stock - 1;
if (pot_qnty == 0) {
pot_qnty = "sold out";
}


the site URL
http://www.mainepottersmarket.com/mpm.htm
(still in dev.)
any thoughts?
thanks
russ
  #2  
Old 09-11-2002, 08:52 PM
targetplanet targetplanet is offline
Registered User
 
Join Date: Mar 2002
Location: Portland, ME
Posts: 14
Rep Power: 0
targetplanet is on a distinguished road
where to go

oh yea if you go to the site, select potters from the menu and scoll down to jennifer everett pottery
she is the only one with pots
russ
  #3  
Old 09-11-2002, 09:22 PM
dv8's Avatar
dv8 dv8 is offline

Admin Mod
 
Join Date: Mar 2001
Posts: 2,053
Rep Power: 15
dv8 is on a distinguished road
So this doesn't work?
Actionscript:
on(release) {
	stock = Math.floor(parseInt(pot_qnty)); 
	trace(stock);
	pot_qnty = stock - 1; 
	if (pot_qnty <= 1) { 
		pot_qnty = "sold out"; 
	}
}

// or
on(release) {
	stock = Math.floor(Number(pot_qnty)); 
	trace(stock);
	pot_qnty = stock - 1; 
	if (pot_qnty <= 1) { 
		pot_qnty = "sold out"; 
	}
}
Remember if a value of a variable is anything but just a Number it will not convert to a numerical value.
Actionscript:
pot_qnty = "1 "; // with a space
trace(Number(pot_qnty)); // Outputs NaN
// But
trace(parseInt(pot_qnty)); // Outputs 1
  #4  
Old 09-11-2002, 09:28 PM
targetplanet targetplanet is offline
Registered User
 
Join Date: Mar 2002
Location: Portland, ME
Posts: 14
Rep Power: 0
targetplanet is on a distinguished road
I have not tried the parseInt() yet.
the other thing is I am developing with coldfusion so the I have to view the site through my test server, so I don't have access to any of the output tools of flash, its a pain to not have the ability to check the variables...
  #5  
Old 09-11-2002, 09:31 PM
targetplanet targetplanet is offline
Registered User
 
Join Date: Mar 2002
Location: Portland, ME
Posts: 14
Rep Power: 0
targetplanet is on a distinguished road
it works

the parseInt() worked, thanks
  #6  
Old 09-11-2002, 10:06 PM
dv8's Avatar
dv8 dv8 is offline

Admin Mod
 
Join Date: Mar 2001
Posts: 2,053
Rep Power: 15
dv8 is on a distinguished road
Hey targetplanet,
Quote:
the other thing is I am developing with coldfusion so the I have to view the site through my test server, so I don't have access to any of the output tools of flash, its a pain to not have the ability to check the variables...
NO PROBLEM
Follow me to the "T".
Goto Macromedia.com and download the latest Flash Player/Product Updates. (More info Click Here
Then Follow the directions Macromedia gives you about how to install the files.
Once you done this, goto your Flash Program Folder on the hard drive and open the Players>Debug Folder.
You will see a list of Install Player files.
In Windows, Double click and run the "Install Flash Player 6 AX.exe" file.
You will need to reboot.

Now when developing your Flash Movie for the web Check the 'Permit Debugging' Option in the Publish Settings window.
...Click Publish
Do any of the nessacary uploading...
In the Flash Authoring Enviroment goto Windows > Debugger.
Then with this window open... set the Debugger to 'Enable Remote Debugging'

Then when you open the Flash Movie in the Browser it will prompt you with a Debug Permission... and then you may view the contents of the Movie from your Debugger with comfort of the Test Server

Any question?
  #7  
Old 09-11-2002, 10:48 PM
targetplanet targetplanet is offline
Registered User
 
Join Date: Mar 2002
Location: Portland, ME
Posts: 14
Rep Power: 0
targetplanet is on a distinguished road
thats really cooooollll

that is sweet, thanks a ton for the info
I always wondered what that debugger was for..
  #8  
Old 09-12-2002, 07:48 AM
Gargoyle's Avatar
Gargoyle Gargoyle is offline
Moderator
 
Join Date: May 2000
Location: germany
Posts: 3,471
Rep Power: 16
Gargoyle is on a distinguished road
hey dv8, this is great news man!! rated!
i didn't checked this out till now thnx...
__________________
---
if TCPA is the answer,
how stupid then was the question?

There is a diffrence in knowing the path and walking the path.

if u found this thread usefull, then rate it.
this way we all save a lot of time, searching for the good ones.

 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Compatibility May Be Causing the Mac OS X Lion Problems with Flash FlashMove All Things Apple 0 08-15-2011 02:31 PM
PUBLISHING PROBLEMS (Flash 8), PLEASE HELP!!! Fragger Newbies 0 02-13-2008 04:06 PM
Movie Clip Problems ScottRiley Actionscript 2.0 1 02-07-2006 02:15 PM
external movie loaded problems dirk General Flash 0 12-16-2005 05:56 PM
more php problems with flash - can you check this??? jpwrunyan Client Side 0 07-16-2004 09:38 PM




All times are GMT. The time now is 07:35 PM.