Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Converting To Number



I'm trying to make a little typing app, which loads the exercises externally from text files.Here's what's in my text file:===================ex1.text===================&words=12&word0=jjj&word1=jjj&word2=jjj&word3=jjj&word4=jjj&word5=jjj&word6=jjj&word7=jjj&word8=jjj&word9=jjj&word10=jjj&word11=jjjwords being the amount of words in the exercise (12), and the rest being the words which should be typed.===================The Flash File (frame 1)===================var exerciseArray:Array = new Array();var exLoadVars = new LoadVars();exLoadVars.onLoad = startExercise;exLoadVars.load("ex1.txt");function startExercise(success) {if (success) {// load exercisevar numberOfWords:Number = Number(exLoadVars.words);trace(numberOfWords);for (i=0; i<numberOfWords; i++) {trace("test");}} else {trace("loading failed");}}This should load my text file, and when I trace exLoadVars.words, it outputs '12' just like it's supposed to.However, if I convert this string to a number using var numberOfWords:Number = Number(exLoadVars.words);and then trace(numberOfWords); it outputs isNaN.(obviously, the trace("test") does not fire at all because numberOfWords is not a number)Why doesn't this work ??



Adobe > ActionScript 1 and 2
Posted on: 02/16/2007 04:30:24 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Converting Number To HEX
ok i have this code

Tcolor = txtformat.color;

and when i trace Tcolor it gives me like 65280 when the color is 0x00FF00(pure green) , so obviously it convers the color to decimal numbers..
but now i want it in the HEX form 0x?????? ... is there a function that can easily do this ?

Converting A String To A Hex Number...
I am currently storing a serious of details as hex numbers and then converting them back to strings to work with them as scores.

Once I have checked against the 'highest' score I need to update these strings back into hex.

How can I detect they are above 9 and convet to appropriate hex values... Is there a reverse of the ParseInt command I can use ??? Helpme please - confused maths dropout!!!

burt

Converting A String To A Number?
I need to turn a string into a number that you can do math with!

My example:

thestring = "h5";
splicedsuit = thestring.charAt(0);
splicednumber = thestring.charAt(1);

(splicedsuit = "h"; splicednumber = "8")<not displayed

Then I need to do Math like

whatIneed = 9274 + splicednumber


If I check the variables durning the movie it says

whatIneed = 92748

but I need it to say 9282 and acually add them together not combine them.

Thanks In Advance!
Chris

Converting A Number To A String AS 2
Hi:
I've been trying to convert a number into a string (It's easy in other langauges) but its got me baffled in AS 2.0. I'm still very much a n00b at Flash. MX 2004 is my first and only version.

In a class (theScore) I increment a number n_numberRight. Return that to the main part of the code theScore.numberRight
I've tried the code below:
code:
public function get numberRight () : String
{
var s_ScoreRight : String;
var n : Number = new Number (n_ScoreRight);
s_ScoreRight = n.toString ();
trace ("Number = " + n_ScoreRight + " String = " + s_ScoreRight);
//the trace shows correct values.
return s_ScoreRight; // return this should be string??
>> this works if the return type is Number but I still want a string//return n_ScoreRight;
}

The return value is correct in a trace, but if add
code:
var sOut:String;
sOut = theScore.numberRight();
trace(sOut); // undefined ??

I want to pass that string then to a textfield
textfield.text = sOut;
Help, please, and thank you.

Converting A Sting To A Number
hey ppl, I have a var that contains a string and i need to convert it into a number but I dont know how example:

a = "5"

how do i make it a=5

I know how to convert a number into a string but how do i go the other way?
pls help

thx

Converting A Number To A String
Hi,

How do I convert a number to a string? I'm using Flash 8 actionscript 2. Thanks in advance.

Converting A String Value To A Number
I am working on a project that requires the input of several values in to text inputs, which are then in turn put into variables. 3 of the 4 are string values, of which I have no problem, the fourth however is intended to be a number, but flash treats it as a string. So my question is, how do I convert the string value into a number one?

Here's the code:

update_btn.onRelease = function()
{
category = name_txt.text; //(string)
question = question_txt.text; //(string)
answer = answer_txt.text; //(string)
points = points_txt.text // This one I want to be a number value
}

Converting String To Number
I'm an Actionscript newbie and hope that somebody can point out where I'm going wrong. I'm designing a Flash website that imports external data from a .TXT file... the text file contains assorted fields, mostly financial data (prices). The data imports perfectly, and I can replace variables set up with the new information. The problem is, no matter how hard I try, I cannot convert any text field loaded into a real number... so if the text field is &page=1234, for example, the data 1234 loads fine as the page variable, but it's a string, not a number. Using Number(text) doesn't work, all I get is NaN. It displays on screen perfectly, but I can find no way to convert the apparent number into a real number (to add various different results together).

Am I missing something obvious?

I'm compiling in Flash 6 with Actionscript 2.0. Any advice or solution would be greatly appreciated!!

Converting From String To Number
I have a variable that comes from one of those SWFtoEXE creation programs. It sends it into flash as a string, but I want it to be an integer. How can I convert the data type in Flash?

Here's the code I'm using:


ActionScript Code:
//curPos = 153
var gotoPos = curPos + 1000;
other_txt.text = gotoPos;
//other_txt.text output is 1531000...added it like a string

Help: Converting NameX, X To Number?
Hi, I have a favor to ask.
If I have a name such as "steven4" or "melisa56", ho can I get only the number and convert it to an integer??

Converting A Variable To A Number Value
I have loaded a variable from a text file into flash:

&opValue=24


In Flash I can't seem to use the value to change the opacity of a movie clip.

ActionScript Code:
opValue= this.opValue;
trace(opValue);
go._alpha=opValue;[


The problem is the trace value shows 24, just like in the loaded text file

but
go._alpha=opValue;
does not work. The alpha stays at 100

If I manually Change
go._alpha=24;
The Alpha Changes as it should.

Why won't
go.alpha=opValue;
change the alpha of the targeted movie clip with the variable number?

Converting A Number In String To An Integer...
I'm reading in values from an external text file but they are being seen as strings rather than numbers so I can't do any calculations with - which I need to do!

How do I convert from a string to a usable number?

m.

Converting A Number From Decimal To Hexidecimal
Does anyone know if there is a command or function to do this?

Thanks
Mark

Converting Negative To Positive Number?
I can't seem to find an actionscript function to convert a negative number to a positive one. Anyone know how to do this in actionscript?

Thanks,


UPDATE.........................

Answer is: Math.abs(number)

Converting External Variables To Number
I don't know why the Number() function isn't working for my externally loaded variables.

I load my text file containing the variables onto the main timeline:
loadVariablesNum ("loadextdata_currencydata.txt", 0);

I run a check to see that it's loaded.

In the text file is the first variable:
usdFromAustralianDollars=0.507331;

on my button:
on (release) {
trace(usdFromAustralianDollars); //returns the string value of 0.507331
australianRate = Number(usdFromAustralianDollars);
trace("$" + (australianRate + 100)); //returns NaN
}

If the variable is not external, the Number() function works fine. What else do I need to be doing?

Thanks!

Converting A String To Number Array
basicaly if you can read the code then you understand what i am doing sorry i cant realy explain what it is doing but if you can read action script then you can under stand what i am doing
if you run this script it output this


Quote:





1
0
1000
100
10
final =undefined10100010010





everything is working unil the code reaches to finaly
what i am trying to do is add them all like a math equation
but what the script is doing is joining the script like a string
does any body know how i can convert this string into a number
so the script will at final add and not join together like a string
not php actionscript

PHP Code:




var my_str:String = new String("10444");
var my_array:Array = my_str.split("");
var length:Number=my_array.length;
var whilenum:Number = 1;
for (var i = 0; i<my_array.length; i++) {
    if(my_array[i]== 4)
    {
        var digit:Number;
        var full:Number =10;
        
        digit = my_array.length - i;
        digit = digit -1;
        for(var b =0; b < digit; b++)
        {
        full =10 * full;
        }
            
        my_array[i] = full;
          full = 10;
          
        }

    trace(my_array[i]);

}
var final:Number;
for( var c = 0; c < my_array.length; c++)
{
    final = final + my_array[c];
    }
    trace("final ="+ final);






i am sorry i cant realy explain what i am doing but if you have a question or need information i would be happily to answer it as the best i can
thank you in advance

Converting String To Number Using ParseInt
hello,
All I want to do is convert a string into a number, I thought it would be easy:


Code:
var stringNum:String="00000000537112"
var num:Number= parseInt(stringNum);
trace(num);
//Result: 179786
I have tried using Number(stringNum) aswell which does not work, all I want it to do i convert "00000000537112" into 537112.
I have tried it by removing the 0s at the beginning of the string which works. Is there any way of solving this or will I have to build a function to shave off the preceding 0s?

Loading A Var And Converting It To A Number Problem...PLEASE HELP
I can load a variable into Flash from a .asp page fine. However, when I try and convert it to a number flash gets mad and displays NAN. Any ideas? I have seriously spent hours trying to figure this out!!!! I'm so frustrated because my actionscript skills are terrible!

--------------------------------------------
gettime.asp code:

<%
dim unixtime
unixtime=1000
%>

&mytime=<%response.write(unixtime)%>

--------------------------------------------

Actionscript code:

var mytime;

myData = new LoadVars();
myData.load("gettime.asp");

myData.onLoad = function(){

//this displays 1000 which is fine
mytime = this.mytime;

//This causes it to freak out and show NAN
//mytime = Number(this.mytime)
//Below is what i ultimately want to use
//mytime = Number(this.mytime)*1000-getTimer();

//this is a dynamic text box so i can see the value
MyDynamicTextBox.text=helpme;

};

Converting An Number In A Text File To A Variable
I'm tried this a hundred ways, and can't seem to get it to work. I'm trying to get my flash file to read a number from an external text file (in form: &var0100=4&) and have the flash file go to a specific frame number based on this variable. This code works if I import it into a text file, but I can't get it to take what's in the text file and convert it to a variable. Here's my following code:


totalprojects = new LoadVars();
totalprojects.load("rmptext.txt");
totalprojects.onLoad = function(right) {
if (right) {
trace("done loading");
total.Number = this.var0100
if (Number(total) < 5) {
projectmovie.gotoAndStop(2);
}
else {
projectmovie.gotoAndStop(3);
}
}
else {
trace("not loaded");
}
};
stop();

Converting A Date Serial Number To A Real Date
I'm reading dates from Excel and I get this type of serial number : 37477. It's actually the number of days since 1-1-1900. Is there a function to convert that directly into a date in Flash ?
Thanks,

Converting A PDF To A Flash FLA File Without Converting To An Image First?
Basically, I'm building a digital catalogue that runs off a CD and uses a Flash 'page turning component' to display the pages. Certain pages will have links that use Flash's Fscommand call to open Word and Excel documents.

Has anyone got any bright ideas of how to Convert a PDF to a Flash FLA file without converting to an image first?

I know I can open a PDF in Photoshop, save as a PNG or JPG and then import this into Flash, however the quality isn't brilliant. If you use a hi-res image, then you get a hi-res file size...

Currently, the best way I have found, is to open the PDF in Illustrator, then export it as a SWF. Illustrator converts all text to shapes and you end up with a small SWF, yet great quality when displayed in larger sizes. As I'm currently using a page turning flash component that loads SWF files, I need the quality to be good for the 'Zoom' function.

I've found an Illustrator script that will do the hard work via a 'batch' process, so I can take a 100 page PDF and convert the whole lot to 100 SWF files while I drink tea and 'look busy' and read a magazine, but the problem I have is that I need to add a layer of buttons to several of the SWF files to add a little functionality....

I do have a SWF to FLA decompiler which does a good job, however because Illustrator turns everything into shapes, the decompiler does the same and you end up with thousands of files in the library.... Plus there are a lot of error messages when the file is first loaded...

Many layers are masked, (for some reason without a fill), so if you publish the decompiled file straight away, you just get a blank file. Once you go through and fill the masks needed, it shows when you publish, but this really is a lot of work and I've had a few pages that show when you open the SWF file, but don't show when the SWF is called into the page turning file.... Hmmm....

So in short, I'd like to take a PDF and convert it to a FLA file, add a layer of buttons and publish as a SWF file....

Anyone got any 'Pearls of Wisdom'?

Clere
Clere Print

Shared Object To Store A Unique Id Number Var And Frame Number Var
Hi, I am a complete novice to action script when it comes to objects. I know what I want to do is done with the shared object. Basically I want to create a tutorial that stores a cookie on the users’ machine with a unique id variable telling flash what frame the user was at last. When the user revisits it would prompt "continue where left off or start the tutorial over. I read the action script dictionary regarding the shared object, but being a designer I really need to visualize it before I can comprehend this.

Thanks,

Justin

Limmiting A Number To A Certian Number Of Decimal Places
Ok for a currency i have

gold.silver which is the same as say 1.35g with 'g' being gold

When I calculate with tax it often goes to 10 decimal places. How do I limmit the amount of decimal places that it can access?

Random Number Then Delete Number Till Reset
Last edited by pixcels : 2006-10-18 at 22:41.
























I am trying to create a type of quiz thing. It is a stand alone move and can not have anything loaded into it.

Problem:
I need a random item from an array, then after the item is displayed I need it to delete itself so that it will not show again. After the array is down to the last item it calls in the array again and starts all over.

Below is code that I have found but it does not delete the array item after it has been show from the array, or restart.


Code:
Array.prototype.shuffle = function() {
var shuffledArray = [];
var copyArray = this.slice(0);
for (var j = 0; j<this.length; j++) {
randomNo = Math.floor(Math.random()*copyArray.length);
shuffledArray[j] = copyArray[randomNo];
copyArray.splice(randomNo, 1);
}
return shuffledArray;
};
testArray = ["1", "2", "3", "4", "5", "6", "7"];
newArray = testArray.shuffle();
//Text area component
theText.text = "newArray = "+newArray
//Button component
theBtn.onRelease = function(){
newArray = testArray.shuffle();
var tempArray = Math.floor(Math.random()*testArray.length)
var totalArray = Math.floor(tempArray+=newArray[0])
var slicedArrary = tempArray.splice(0)
theText.text = "newArray = "+newArray[0]
}

AS2 - Image Set Number Of Rows/dynamic Colum Number
I have a simple image gallery that is loading images in, creating movieclips, and then lining them up into 3 columns and rows. This woks fine as long as there is only 9 images, but I have more then that. If I have it pull more then the 9 it adds in more rows I need it to add in more columns no more rows.

Here is the function that creates the gallery:
title_array is the array of images.

Code:
function createGallery() {
nbrColumns =2;
leftMargin = 7;
topMargin = 5;
cellWidth = 165;
cellHeight = 165;
//thumbnails.setMask(albumHolder.albumHolderMask);
for (i=0; i<title_array.length; i++) {
thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
var cellX = i % nbrColumns;
var cellY = Math.floor(i / nbrColumns);
thumbHolder._x = leftMargin + cellX * cellWidth;
thumbHolder._y = topMargin + cellY * cellHeight;
thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_image", 0);
thumbLoader.loadMovie(title_array[i]);
}
}

Script To Change Number To Formated Number
Hi, is there a free script to change a number to formated number (u know with dots and commas)
I know I probably can make my own.. but.. i'm in a hurry
thanks

Round Number To Next Number That Has Only Zeros Behind It (ie: 20, 100, 3000)
I want to make a graph and I want the highest number in the graph to be a solid figured number.

so if the highest part that needs to be graphed is 12,000 I want the graph to go up to 20,000 ( the next highest number with only zeros behind it.)


for instance I want to round:
11 to 20
253.3454 to 300
4500001 to 5000000


I am sure I neet to use Math.Ceil() in combination with something else but I am unsure how?

any suggestions?

THANKS!

Random Number Variable That's Different From Previous Number
I have this line of code in my game that works great. However it would work even better if when it the code was executed the next random number was not the same as the one before it. For example if "speech" is on frame 6 when the code is executed I would like the random number to be between 2 and 12 but not 6. (I don't want the same frame to come up as it confuses the kindergarteners and preschoolers using the program.) Here's the code that's working for me now.


ActionScript Code:
speech.gotoAndStop(Math.floor(Math.random()*11)+2);

Need Urgent Help How To Check If The Generated Number Is A Whole Number
Hi,
I have a simple issue but I need some assistance. I am calculating a number and the result number sometimes a whole number but in some cases decimals are present. Decimals do not need change but whole numbers need to change. So for example if the end result is "6" I need it to show it as "6.0" in a field beacuse that is the way the calculator should display it according to request.
How can I check that the result number is a whole number and then add ".0" to it?
I just included a simple script below.

if (outputnumber == ?) {
resultNum = Number(String(outputnumber+".0"));
} else {
resultNum = outputnumber;
}

Thanks,
Attila

Method To Check If A Number Is A Decimal Number?
i was wondering if there is any method to check if a number is a decimal number or not? i searched in the help-panel, but didn't found something...please help!

TextField - Number Of Lines, Number Of Characters
Hello,

I'm trying to get some insight on the textField object in flash.

I know how to get the textfield length and number of characters. But I need to know more.

Is there a way to get the number of characters on a line in a multiline textfield?

Thank you in advance.

Decimal Number To Binary Number ?
In ActionScript, I can use parseInt to convert binary num to decimal number. But how can I convert decimal number to binary number? I try find in AS dictionary but there isn't result.
I have an input textfield to enter the decimal number, and an other to display the binary number.
Please tell me how...Thx U,

Variable Number = Frame Number#$%@&*
I have a movie Clip called “percentage bar” and a variable text box called “percentage”.
Now I get a number from VB and this number is = to the value of ”percentage” (my variable txt box).
The Movie Clip has a 100 frames… here it comes I need to have whatever the variable number (“percentage”) is to determine which frame the movie clip (“percentage bar”) is standing on.

This has to be possible, don’t it?

Help Can't Convert String To Number With Number()
I'm pulling variables from an XML file and need to convert the strings from the XML to numbers. So, I have the following actionscript:


Code:
thisPC_Price = aPrice[0].stringValue();
trace(thisPC_Price);
trace(Number(thisPC_Price));
The first trace returns 100, which is the contents of the string (it's also treated like a string by the AS and if I try and do anything to it it will return NaN, as it should). The 2nd trace action returns NaN ..... and I have no idea why.

Anyone have any ideas?

Variable Number = Frame Number ?
Here's an easy one for anyone who knows actionscript...
I have a variable text box called "percentage" and a movieClip called "progressbar" (100 frames).
I want the number in my variable txt box "percentage" to tell "progressbar" to go to the corresponding frame number.
for instance if the number in the txt box is 15 the movieclip has to go to frame 15.

Thanks
- a Designer, forced to be a programmer.

[F8] Number + Number = String?
Hi, I wonder if anyone can help me with this.
This code gives me the result 100100.


PHP Code:



var one:Number = 100;
var two:Number = 100;
var result:Number = one + two;




result then prints as 100100.
I don't understand why.

Sum Of All Number From 1 To [place Number Here]
A nifty little piece of code I came up with while trying to figure out my combinations problem.

It is the result of me forgetting to calculate th product, and instead calculating the sum; kind of stupid, I know.

Not really anyting new, just optimal enough for me to like it.


ActionScript Code:
//calculates the sum of a numbers between 1 an i
function sum(i:uint):uint {
    i = (((i)*0.5)*(i+1));
    return i;
}
var n:uint = 25;
trace("sum of all the numbers
from 1 to " + n + "
is equal to " + sum(n));


and here it gives you the option of telling it where to start, and where to end.

ActionScript Code:
function sumAB(a:Number,b:Number):Number{
    if (a>b){
    return ((a-b+1)*((a+b)*0.5));
    }
    return ((b-a+1)*((a+b)*0.5));
}
var a:int = -5;
var b:int = -2;
trace("the sum of " + a + " through " + b+ " is " + sumAB(-5,-2) + "....");

Pick A Number ...any Number
I have 5 files text files that look some thing like this

Code:
primeRow_1=2,3,5,7,11,13,17,19,23,29,31,37
&primeRow_2=41,43,47,53,59,61,67,71,73,79,83,89
&primeRow_3=97,101,103,107,109,113,127,131,137,139,149,151
&primeRow_4=157,163,167,173,179,181,191,193,197,199,211,223
&primeRow_5=227,229,233,239,241,251,257,263,269,271,277,281
&primeRow_6=283,293,307,311,313,317,331,337,347,349,353,359
&primeRow_7=367,373,379,383,389,397,401,409,419,421,431,433
&primeRow_8=439,443,449,457,461,463,467,479,487,491,499,503
&primeRow_9=509,521,523,541,547,557,563,569,571,577,587,593
&primeRow_10=599,601,607,613,617,619,631,641,643,647,653,659
&primeRow_11=661,673,677,683,691,701,709,719,727,733,739,743
&primeRow_12=751,757,761,769,773,787,797,809,811,821,823,827
&primeRow_13=829,839,853,857,859,863,877,881,883,887,907,911
&primeRow_14=919,929,937,941,947,953,967,971,977,983,991,997
&primeRow_15=1009,1013,1019,1021,1031,1033,1039,1049,1051,1061,1063,1069
&primeRow_16=1087,1091,1093,1097,1103,1109,1117,1123,1129,1151,1153,1163
&primeRow_17=1171,1181,1187,1193,1201,1213,1217,1223,1229,1231,1237,1249
&primeRow_18=1259,1277,1279,1283,1289,1291,1297,1301,1303,1307,1319,1321
&primeRow_19=1327,1361,1367,1373,1381,1399,1409,1423,1427,1429,1433,1439
&primeRow_20=1447,1451,1453,1459,1471,1481,1483,1487,1489,1493,1499,1511
I call the file into flash like this

Code:
primeFileNumber = 1;
fileName = "system/primes_"+primeFileNumber+".prm";
loadVariablesNum(fileName, 0);
and process like this

Code:
prime_row = 'primeRow_'+random(20);
prime_ind = 1;
primeNumber = prime_row[prime_ind];
trace(primeNumber);
my problem id that I can not get a value from the file into the var primeNumber.

trace(primeNumber) just keeps reporting undefined.
Any Ideas...

I'm trying to use two numbers to pice a prime number from a random list, this is repeated twice to gain two number to form the base of cypher system.
The rest of my system works, I kust can not get the numbers of of the files.

I also need to know how to drop the vars load with loadVariablesNum.

Extract A Number From A Number
I've got a 5 digit number, for example 12345. I want to extract the second last number, in the example it would be 4. I'm sure there's a way to do this, but i don't know which phrase to use when i google. Can anyone please help me? Thanks!!

Check If Number Is Whole Number
i would like to know how can i know if the result of a variable is a whole number or not.
like...
var i++;
if(i =wholenumber) {
....
}

i need something like this. the number must be a whole number with no decimals or fractions
thanks

Check If Number Is Whole Number
i would like to know how can i know if the result of a variable is a whole number or not.
like...
var i++;
if(i =wholenumber) {
....
}

i need something like this. the number must be a whole number with no decimals or fractions
thanks

Why DOES It Work With A Number, And Not With A Var Containing That Number?
I have a flash movie, in which a click on the button should evoke an action, only if some value is smaller than lets say
1200. if I go like:

if(something < 1200){go and do this;}
then all works fine.

but if I go and do this(which should be the same...)
if(something < numbervar ){go and do this;}
in which numbervar is defined in the same timeline as the button like this:

var numbervar = 1200;

it does not work. Nothing happens....
Whats the difference between, 1200 written down, and 1200 via a var?

Why does it not work?
Hope someone can help me out here.
thanks Sam

I Know The Line Number. I Need The Last Char Index Number Of The Line.
Hi,

I have a multiline wrap textbox which is dynamic and has a variable assigned to it. I am importing text into this textbox. If the amount of text exceeds the height size of the textbox I want to split the text into two parts, so the part which exceeds the textbox ( the text which is not visible unless you scroll down) will be moved into another textbox located below the first textbox.

I know how to get the location of the last visible line in the textbox. I simply use

LastVisibleLine=MyTextbox.bottomScroll;

Now I have the location of the last visible line so my question is:

How can I get the location of the last character in the last visible line in the textfield?

Is it possible to count the lines in a textfield when the text is wraped. I've tried to count "
" and "
" and they don't detect the wrapping.
( Wrap: When the textfield detects if a line has reached the width of the texfield it automatically breaks the line so it will fit the textfield. )

Thank you.

I Know The Line Number. I Need The Last Char Index Number Of The Line.
Hi,

I have a multiline wrap textbox which is dynamic and has a variable assigned to it. I am importing text into this textbox. If the amount of text exceeds the height size of the textbox I want to split the text into two parts, so the part which exceeds the textbox ( the text which is not visible unless you scroll down) will be moved into another textbox located below the first textbox.

I know how to get the location of the last visible line in the textbox. I simply use

LastVisibleLine=MyTextbox.bottomScroll;

Now I have the location of the last visible line so my question is:

How can I get the location of the last character in the last visible line in the textfield?

Is it possible to count the lines in a textfield when the text is wraped. I've tried to count "
" and "
" and they don't detect the wrapping.
( Wrap: When the textfield detects if a line has reached the width of the texfield it automatically breaks the line so it will fit the textfield. )

Thank you.

Choosing A Random Number (that Isn't The Current Random Number).
I have a loader movie, that randomly chooses a clip to load from an xml list. Sometimes it 'randomly' chooses the same number which makes it look like the loaded clip is mistakenly looping (skipping). Here's the code:

Actionscript Code:
function randomImage() {
    if (loaded == filesize) {
        fadingPeople._alpha = 0;
        numberSelected = random(total);
        fadingPeople.loadMovie(image[numberSelected], 1);
       
    }
}

The code runs, waits for x seconds and then fire again. What I'm wondering about is how would I go about telling the random function to choose a random number that's NEQ numberSelected.

Thanks for any help.

How To Change ODD Input Number To EVEN Input Number?
Hi Flash Friends -

I'm hoping you can help me out with an Actionscript question...I've built a small commerce site in Flash MX designed to help women find their true bra size, however, I must make it compatible with Flash player 4.

I'm having trouble trying to figure out how to convert one of the input variables to an EVEN number if the user enters an ODD number.

My input text variables are "bandinput" and "brainput" -- and I need to ensure that bandinput is always an EVEN number.

My code is below and I really hope that someone can lend me a hand with this one ;-)

Thanks!
Jenny

---------------------

on (release) {

if (brainput-bandinput eq 0) {
cupsize = "AA";
} else if (brainput-bandinput eq 1) {
cupsize = "A";
} else if (brainput-bandinput eq 2) {
cupsize = "B";
} else if (brainput-bandinput eq 3) {
cupsize = "C";
} else if (brainput-bandinput eq 4) {
cupsize = "D";
} else if (brainput-bandinput eq 5) {
cupsize = "DD";
} else {
cupsize = "F";
}

sizeoutput = bandinput add cupsize;

play();
}

Converting SWF's...
Does anyone know of a way to convert .swf files to .fla?

Converting...
Hi all,

I'm trying to create some small animations from a .mov file supplied to us. The customer just wants a few scenes taken from it (door opening for 'Come on in' that sort of thing)

What is the best way of doing this? converting the .mov to jpgs and creating small movies...? Any suggestions welcome.

Thanks
Ash

Converting
how do u convert a flash movie into jpg or gif movie format? im trying to make an avatar and it wont let me make it a mov it just makes it a pic

Copyright © 2005-08 www.BigResource.com, All rights reserved