Solved

Greater and Less than in flash

Posted on 2009-04-06
3
143 Views
Last Modified: 2013-11-11
Ok not sure how to ask this but here goes, in flash I have variables that are numbers and the I try to use a statement using greater then it works perfect when you have a number with two digets like 88 is greater than 80 that works but if I have 88 and the next number is a three digit number like 103 it shows 88 being greater. Exapmle below:
102 and 90 flash is showing 90 to be greater or 90 and 97 it will show 97 it just screws up when a number has three digits.
0
Comment
Question by:ucohockey
3 Comments
 
LVL 19

Accepted Solution

by:
quizengine earned 500 total points
ID: 24076133
I think your numbers are not numbers, but strings. This is very likely if they are imported from an external file. You can *force* them to become numbers like this...

myVar = Number(myVar);

Try doing that to each of your variables and then compare them and see what's changed.
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 24076244
yeah i'd say the same.

to check do a typeof

i.e trace(typeof variablename) - will tell you if its a String or not.
0
 

Author Comment

by:ucohockey
ID: 24076257
No it is a string I will try that thanks for the help.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now