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








Can You Assign A Numerical Value To A Letter?


For a current project I'm doing, I'm taking people's names and converting their name to a number. For example, the name Eli, E's are 5 points, L's are 2 points, and I's are 3 points. The grand total is 10 points and depending on how many points your name equals it gives you a title. I'm wondering if it's possible to do that and how to do it aside from writing out every single name in the entire name dictionary and adding up how many points their worth.

Thanks

Wattsman1111




FlashKit > Flash Help > Flash Newbies
Posted on: 08-28-2002, 02:28 AM


View Complete Forum Thread with Replies

Sponsored Links:

Textfield:OnChange - Random Letter Settles On Entered Letter - Impossible?
Hey guys, is this possible?

I've got an inputfield.
OnChange Event Handler.
When someone types a letter, i want the letter to become 0, then 1, then 2, and so on until 9 and then i want the letter to be there.

And when they click on another letter, same effect happens.

so at the end if i typed, "testing", each letter scrolls 0-9 like a roll dial and settles on the letter typed.

What i've managed to do is make it work, but if i type at normal speed and not slow, i end up getting something like:

t32t43g

any ideas?!

View Replies !    View Related
Animated Text - Writing Letter By Letter
Help! I need to write a simple flash animation that will 'write' the words Admiral Inn on the screen (in a script font) so it appears as if some invisible hand is writing it. Does anyone know how to easily do this?
thanx.

View Replies !    View Related
Fading Text In Letter By Letter With Actionscript?
Hi people!

Does anybody know if it is possible to animate text via actionscript.

For example, I would like to do that good old favourite of having text fade in letter by letter.

However, breaking apart every letter and indivdually fading them in one after the other not only takes a hell of a long time, but also (with large pieces of text) would cause huge file sizes.

I thought of masking, but I can't seem to get a soft edge on the mask to enable me to make it look like it is fading in.

Sooo.....

Does anybody know how to do this via actionscript,

OR...

Does anybody know how to get the soft edge on a mask to be able to create a similar effect.

Hope you can help

Cheers

Deadhands

View Replies !    View Related
Text Written On Screen (Letter By Letter)?
Just wondering if anyone knows of any code that would write text in a text box (text.text) letter by letter like something off Red October???????

Thanks laot,
Dave

View Replies !    View Related
Making Text Appear Letter By Letter?
Hi

I'm new to the world of Flash, so I hope this question isn't too 'easy' or complex!

BAsically what I want to do is to have some text appear (or fade in) letter by letter; but without chaning size, colour, shape, position etc...

Is there some piece of code that will let me do this? I know I can achieve this effect using loads of masks, but i don't really want to have to do that with each individual letter!

Any hel[p would be great, thanks!

PS. Think of the telewriter on BBC Grandstand; that sort of effect

View Replies !    View Related
Simple Letter After Letter Effect.
I was wondering is there any simple way or anyone know of a script that will take a string like "Hello my name is" and out put it like chater after charter like a type wrighter? so like H pause e Pause l Pause? I dont want ot maek clips for every setnece does anyone have any idea?

Thanks

View Replies !    View Related
Words Slide In Letter By Letter
hi. i saw this effect on some sites where the words slide in word by word making a pretty cool effect.

is it a frame by frame animation or is it done using actionscript?

thanks in advance

View Replies !    View Related
Text Effect - Letter By Letter
I´m looking for a text effect that loads the text thru xml, the text appears letter by letter, coming from and _x and _y making a trail of letters and forming the phrase.

Does anybody knows how to do it or a post about an effect like this?

View Replies !    View Related
Make Text Appear Letter By Letter
Does anyone have code, or know of a tutorial, for doing this?

Sorry for asking such a non-specific question. I want to do it but I don't know where to start.

Thank you!

View Replies !    View Related
Text Appears Letter By Letter
Does anyone have code or a link to a tutorial or site illustrating how to do this?

Sorry for such a non-specific question. I did a search that turned up nothing. Mostly I'm seeing stuff about horizontal scrolling text.

Thanks!

EDIT: This is the second posting of this, sorry. Oddly, the first I saw the original was RIGHT AFTER I POSTED THE SECOND ONE. Anyone have any idea what causes that? Or am I going crazy? Probably the latter.

View Replies !    View Related
Words Slide In Letter By Letter
hi. i saw this effect on some sites where the words slide in word by word making a pretty cool effect.

is it a frame by frame animation or is it done using actionscript?

thanks in advance

View Replies !    View Related
Text Letter By Letter
Could anyone tell me please how to get text on movie letter by letter

Thanks in advance

View Replies !    View Related
Delete Letter By Letter
I have a dynamic text field with some text for example "Hello". Previously I used this code to get typewritter effect:


Code:
typeText = "Hello";
typeInterval = setInterval(typeThis, 70, typeText);
counter = 0;
function typeThis(thisString) {
preloading_txt.text += thisString.charAt(counter);
counter++;
if (preloading_txt.text == typeText) {
{
clearInterval(typeInterval);
}
}
};
Now I would like to delete text from my dynamic text letter by letter.
How could I do that?

View Replies !    View Related
Text Letter By Letter?
Just wondering if anyone knows how to get text written in a text box letter by letter so it looks like it's being typed??????

Thanks! Dave.

View Replies !    View Related
Letter By Letter Text
okay, i've seen all these flash intros using text that comes in letter by letter then it leaves letter by letter instead of the whole word coming in or out

View Replies !    View Related
Text Appearing Line After Line And Then Letter After Letter
i´d like to make the text field appearing one line at a time, and when it reaches the last line, the letters of the last line appears one after another. Is it possible to be done?

View Replies !    View Related
Numerical Value Of I
Hello,
I have the following function:


PHP Code:



function duplicateButtons (disp) {
    but._visible=0;
    for (i=1; i<(disp+1); i++) {
        attachMovie ("button", "but"+i, i);
        _root["but"+i]._x=(i*30)+50;
        _root["but"+i]._y=350;
        _root["but"+i].num=i;
        _root["but"+i].onRelease=function() {
            display(i);
        }
    }





What I would like to have happen is for "i" to pass as a numerical value to another function I have, "display." Can I do that? How do I make display(i); read the "i" as a number?
Thanks in advance!

View Replies !    View Related
Numerical Methods
Hallo!
My aim is to convert some Delphi code => Actionscript code.
I am solving a simple system of two differential equations using Euler method (the most simple method).
The equation i have is: y''+w0*w0*y = 0 - this is the equation of movement for a free oscillator. To use Euler methos i must have first order differentiak equation, that why i divide that 2 order equation into two => we have a system:
z=y'
z'=-w0*w0*y

Euler method gives solution for 1'st order diff. equations, as e have in the system, I'll describe briefly how it works:


we have a differntial equation: y'(x)=dy/dx=f(x,y)
and initial condition: y(x0)=y0
Then the solution of the diff equation (anothewords y values) will ba calculated using this formula: yk+1=yk+h*f(xk,yk)
h - step for x

So..I have Delphi code, you can download source project and also the compiled file from here, that works fine:


Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
g1:=gettickcount();
timer1.Enabled:=true;
memo1.Clear;
memo2.Clear;
memo3.Clear;
memo4.Clear;
t:=0; h:=0.01; y:=1; z:=0; i:=0;
w:=10;
form1.Canvas.Brush.Color:=clred;
form1.Canvas.moveTo(round((g2-g1)/10),round(y*100)+500);
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
g2:=gettickcount();
label9.Caption:=inttostr(g2-g1);

z:=z+h*(-w*w*y);
y:=y+h*z;

u:=cos(w*t);
memo1.Lines.add(floattostr(t));
memo2.Lines.add(floattostr(y));
memo3.Lines.add(floattostr(u));
memo4.Lines.add(floattostr((g2-g1)/10));

form1.Canvas.Pen.Color:=clred;
form1.Canvas.LineTo(round((g2-g1)/100),round(y*100)+500);

end;
And here is a screen of delphi program:



And here is my ActionScript code (you can download flash source project from here ):


Code:
w=10; l=0;
lineStyle(1, 255 << 16 | 255 << 8 | 255, 100);
button code

Code:
on (release) {
t=0; h=0.01; y=1; z=0;
_root.moveTo(t/100,y*100+500);

ti=getTimer();

_root.onEnterFrame=function() {
t=(getTimer()-ti);

z=z+h*(-100*y);
y=y+h*z;

text2.text=y;
_root.lineTo(t/100,y*100+500);

}
}
and flash screen


fps i set to 120fps

And here is the problem: flash calculates good at the beggining, but after several seconds it takes more and more time to calculate y values, and the distance between sinusoidals - is increasing...
I am despered...don't know what to do...delphi works fine...but in flash - such a problem. But i really need that code to work good in flash

Could anyone help me?
I apreciate any ideas!
Thank you!

View Replies !    View Related
How Do You Get A Numerical Variable?
Hi, I'm making a game for a company in Thailand, where you need to click on Xes and then a tree will pop up, then a logger will pop up and try to cut it down. You have to click on the logger before he cuts the tree down. I want to make a page that comes on after the amount of time you have in each level. I wanted to have the number of trees that were still left on this page, but I don't know how to do that since it will change each time. I'm assuming that this uses Actionscript, and that there is a way to do this out there, so my question is: How do you get a variable that is the number of specific symbols left on the screen? I'm using Flash Proffessional 8.

View Replies !    View Related
Numerical Methods
Hallo!
My aim is to convert some Delphi code => Actionscript code.
I am solving a simple system of two differential equations using Euler method (the most simple method).
The equation i have is: y''+w0*w0*y = 0 - this is the equation of movement for a free oscillator. To use Euler methos i must have first order differentiak equation, that why i divide that 2 order equation into two => we have a system:
z=y'
z'=-w0*w0*y

Euler method gives solution for 1'st order diff. equations, as e have in the system, I'll describe briefly how it works:


we have a differntial equation: y'(x)=dy/dx=f(x,y)
and initial condition: y(x0)=y0
Then the solution of the diff equation (anothewords y values) will ba calculated using this formula: yk+1=yk+h*f(xk,yk)
h - step for x

So..I have Delphi code, you can download source project and also the compiled file from here, that works fine:


Code:
procedure TForm1.Button1Click(Sender: TObject);
begin
g1:=gettickcount();
timer1.Enabled:=true;
memo1.Clear;
memo2.Clear;
memo3.Clear;
memo4.Clear;
t:=0; h:=0.01; y:=1; z:=0; i:=0;
w:=10;
form1.Canvas.Brush.Color:=clred;
form1.Canvas.moveTo(round((g2-g1)/10),round(y*100)+500);
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
g2:=gettickcount();
label9.Caption:=inttostr(g2-g1);

z:=z+h*(-w*w*y);
y:=y+h*z;

u:=cos(w*t);
memo1.Lines.add(floattostr(t));
memo2.Lines.add(floattostr(y));
memo3.Lines.add(floattostr(u));
memo4.Lines.add(floattostr((g2-g1)/10));

form1.Canvas.Pen.Color:=clred;
form1.Canvas.LineTo(round((g2-g1)/100),round(y*100)+500);

end;
And here is a screen of delphi program:
http://img223.imageshack.us/img223/5061/delphi9qw.jpg


And here is my ActionScript code (you can download flash source project from here ):


Code:
w=10; l=0;
lineStyle(1, 255 << 16 | 255 << 8 | 255, 100);
button code

Code:
on (release) {
t=0; h=0.01; y=1; z=0;
_root.moveTo(t/100,y*100+500);

ti=getTimer();

_root.onEnterFrame=function() {
t=(getTimer()-ti);

z=z+h*(-100*y);
y=y+h*z;

text2.text=y;
_root.lineTo(t/100,y*100+500);

}
}
and flash screen
http://img113.imageshack.us/img113/1753/flash4cy.jpg

fps i set to 120fps

And here is the problem: flash calculates good at the beggining, but after several seconds it takes more and more time to calculate y values, and the distance between sinusoidals - is increasing...
I am despered...don't know what to do...delphi works fine...but in flash - such a problem. But i really need that code to work good in flash

Could anyone help me?
I apreciate any ideas!
Thank you!

View Replies !    View Related
Help With Numerical Values
This ActionScript is creating reading an XML file, and laying out thumbnail images. I'm stuck though! Each thumbnail is given a value of thumbnail[x], going from 0-5. I wrote some mouse actions and need to access each thumbnail's number, not entire name (where I have it in red below).

"this" actually equals "thumbnails.thumbnail0", "thumbnails.thumbnail1", etc. But I need just the # on the end of that.

Can any AS guru's out there help me?


Code:
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
numimages = this.firstChild.childNodes.length;
spacing = 62;
for (i=0; i<numimages; i++) {
picHolder = this.firstChild.childNodes[i];
thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
thumbHolder._x = i*spacing;
thumbLoader = thumbholder.createEmptyMovieClip("thumbnail_image", 0);
thumbLoader.loadMovie(picHolder.attributes.thmb);
thumbHolder.title = picHolder.attributes.title;
thumbHolder.main = picHolder.attributes.main;

thumbHolder.onRelease = function() {
closeoutOver(this);
loader.box.loadMovie(this.main);
over.over(this).gotoAndStop(3);
};

thumbHolder.onRollover = function() {
if (over.over(this)._currentframe == 3) {
over.over(this).stop();
}else{
over.over(this).gotoAndStop(2);
}
};

thumbHolder.onRollout = function() {
if (over.over(this)._currentframe == 3) {
over.over(this).stop();
}else{
over.over(this).gotoAndStop(1);
}
};
}

}

View Replies !    View Related
Help With Numerical Values
This ActionScript is creating reading an XML file, and laying out thumbnail images. I'm stuck though! Each thumbnail is given a value of thumbnail[x], going from 0-5. I wrote some mouse actions and need to access each thumbnail's number, not entire name (where I have it in red below).

"this" actually equals "thumbnails.thumbnail0", "thumbnails.thumbnail1", etc. But I need just the # on the end of that.

Can any AS guru's out there help me?


Code:
myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
numimages = this.firstChild.childNodes.length;
spacing = 62;
for (i=0; i<numimages; i++) {
picHolder = this.firstChild.childNodes[i];
thumbHolder = thumbnails.createEmptyMovieClip("thumbnail"+i, i);
thumbHolder._x = i*spacing;
thumbLoader = thumbholder.createEmptyMovieClip("thumbnail_image", 0);
thumbLoader.loadMovie(picHolder.attributes.thmb);
thumbHolder.title = picHolder.attributes.title;
thumbHolder.main = picHolder.attributes.main;

thumbHolder.onRelease = function() {
closeoutOver(this);
loader.box.loadMovie(this.main);
over.over(this).gotoAndStop(3);
};

thumbHolder.onRollover = function() {
if (over.over(this)._currentframe == 3) {
over.over(this).stop();
}else{
over.over(this).gotoAndStop(2);
}
};

thumbHolder.onRollout = function() {
if (over.over(this)._currentframe == 3) {
over.over(this).stop();
}else{
over.over(this).gotoAndStop(1);
}
};
}

}

View Replies !    View Related
Numerical Value Of String
is there a nice sweet way of translating a string name like "george" into a numerical value where A=11,B=12... .... Z=36.. been trying touse toString and it just aint working

can any1 help??


Z

View Replies !    View Related
Arranging Numerical Values
hi there i have made a calculator that displays many results at once. the problem is is that i want the answers to line up in a ascending column eg 1 2 3 4 5 6. what would i do to get flash to do this.

whats happening is is i have 3 colums that length, width and height and they are multiplying themselves using the formula 2n1, 3n1, 4n1 and so on
so if h = 2 l= 3 and w = 4 the 3 columns should look loike this

h l w
n1 2 3 4
n2 4 6 8
n3 6 9 12

so this i want to read
2
3
4
4
6
6
8
9
12

do you get it, how do i set flash to make the results appear like that

whew...........thanks

View Replies !    View Related
String 2 Numerical Expression(yes/no?)
Is there any way to get at a number within a string and convert it to an expression (or a usable number)?

If not, how do you get at that number in your variable that you dynamically loaded, since Flash automatically makes strings out of them?

Am I missing something?

Thanks in advance.
(I know this isn't specifically MX related, but I'm using FlashMX and thought maybe thier was some added functions that I wasn't aware of.)

View Replies !    View Related
Numerical Input Validation
Does anyone have a routine they can share to check if a user only inputs numbers into a input box.

Thanx in advance!

View Replies !    View Related
Trimming Numerical Variables
i need to be able to trim a numerical variable down to 4 decimal places ie 1.0338998 to 1.033

does anybody know any good scripts to do this?

thanks in advance

Fozzybear

View Replies !    View Related
How To Stop A Numerical Number
Hi there, I have a minor probelm.


I have a button which when I click on it, the number in the dynamic textbox will increments by 1.

The source is like that:

On release
Text ++

However I wanted it to stop at 10...How I shall do it???
I did try using for loops or >=10 somthings like that but I still get cant it...

Pls advice.
Thank you

View Replies !    View Related
Numerical Variables From Textfile
hello all,
I was curious if anyone knows how to bring numerical variables into flash for use in conditional statements. I have a file with numerical variables and if var 'test' > 2 then I want it load a movie, if greater than 3 then load another movie. I am sure you get the point. Any help would be appreciated.
Thanks Joey

Code:
loadText = new loadVars();
loadText.load("test.txt");
var test=_root.loadText.text;

function get_var(){

if(testa>2) {
LoadMovie("movie1.swf","emptymc1");
}
elseif(testb>3) {
LoadMovie("movie2.swf","emptymc2");

}

else{
LoadMovie("movie3.swf","emptymc3");
}
trace(test);
}

mc.onPress= get_var();

View Replies !    View Related
Vars Not Being Treated As Numerical?
A tricky problem I'm having.

In Flash, if I set a variable as var + var1 + var2, it returns the sum of those vars' numbers, as expected. BUT, if I pass these variables from HTML, or a URL, they're treated as text and so, when added together, they simply concatenate.

So if var was 5, var1 was 10 and var2 was 15, the result for above statement would return 51015, instead of the desired 30.

Any ideas!? This only happens when the vars are arriving from outside Flash.

View Replies !    View Related
Check If Input Is Only Numerical
hello, i'm still on flash mx, and i'm trying to make a form.

I have it all working as input fields, however, I was curious if there is a way to validate the field to make sure that only numbers were input.

any help would be much appreciated.

thanks
tyler

View Replies !    View Related
Grouping Numerical Instances
Hi,

I'm making a flash game, where one of the components is to make a set of movieclips move to the left.

Each movieclip is named platform0, platform1, platform2 etc etc but it's inefficient to use:

_root.platform0._x -= 10;
_root.platform1._x -= 10;
_root.platform2._x -= 10;

For each movieclip. I was wondering if there was any way to make every movieclip that has platform# as its instance name do the same thing.

Thanks a lot,

Matt

Ps. Just remembered, this is for flash 5/actionscript 1

View Replies !    View Related
[MX] Currentframe; Does It Need To Equal Something Numerical?
Just wondering if you can do something like this

if (_root.header._currentframe == "2dgraph")

or does _currentframe need to equal something numerical?
ie. if (_root.header._currentframe == 1)

Ive labeled the frame 2dgraph but its not returning a result. Also, if you cant do this, is there a way i can get the value or the frame labeled "2dgraph"?

Any help appreciated!

View Replies !    View Related
[MX04] Iterate A Numerical Value
Hey everyone new to the boards, been reading for a while though.

Anyhow to my problem, I have made my a character jump for a module at Uni
using the following code


// This is where he has hit the floor
if (this._y > 535.9)
this._y = 535.9;

// This is where he is in mid air
if (this._y<535.9)
this._y = this._y - jump;

// Apply gravity to jump force
jump -= gravity;

if (Key.isDown(key.SPACE))

{
// Set the jump force and shift once to stop logic problem

jump = 25 - removeJump
this._y = this._y - jump;

this.gotoAndStop(4);

trace(jump);
trace(this._y);
}

Ive tried creating a "removeJump" variable that I hoped could be incremented with "var removeJump = 2++", meaning the characters "jump" would decrease after he has left the floor. Unfortunately flash does not like my use of the ++ operator in this instance.


Sorry for the noobish question but Im pulling my hair out and I have to get the coding done for this tonight


Oh and I understand there are lots of good tutorials on the net for platformers but the tutors I have at the moment have been able to spot copy paste jobs a mile off.

So help much appreciated!

Thanks

Mike

View Replies !    View Related
Random Numerical Increment
Hi guys,

I was wondering if anyobody could help me figuring out this thing.
I have this function:

Code:
MovieClip.prototype.cascade = function() {
var nInterval:Number = 200;
var c:Number = 0;
delay_fx = function () {
if (c<_global.nTotal) {
with (eval("this.thumbnail_mc.card"+c)) {
fadeIn();
}
} else {
clearInterval(delay);
}
c++;
};
delay = setInterval(delay_fx, nInterval);
};

The function is later being called in a loop. What I would like to do is to have the variable "c" to increment randomly from a value of 0 to a value stored in the global var nTotal without having any number repeat itself. Any hints would be greatly appreciated.

Thanks

View Replies !    View Related
Unbelievable Numerical Error
Watch the trace in your output window for a bug surprise when teh number is between 1 and -1.

Code:
this.createEmptyMovieClip("triangle_mc", 1);
triangle_mc._x = Stage.width/2;
triangle_mc._y = Stage.height/2;

triangle_mc.lineStyle(1, 0xFF00FF, 100);
var counter:Number=-5;
triangle_mc.onEnterFrame = function(){
if(counter < 5){
counter+=.1
trace(counter);
triangle_mc.lineTo(counter*10, Math.atan(counter)*10);
}
}

View Replies !    View Related
Shorten Numerical Values Possible?
Hi I'm lost here, I retreive a value through a variable,
which will be traced as e.g 15.22548871


I need this value but shortened to be retreived in another variable, but I need it in 1 decimal (e.g 15.2).

Is this possible and if so can anyone help me on this?


Many thanks in advance.

I tried looking it up, but I can't find anything (I don't really know the exact english term for doing such a thing either)

View Replies !    View Related
SwapDepth In Numerical Order
Hi, I'm working on a project and I've broken it down so it will be easier to manage. The first thing I want to do is:

I'd like to have 3 movieclips (more eventually but I'll start with 3) that are numbered, 1, 2, 3 in their instance name. They will each overlap.

I want a button that will, when pressed, change the stacking order of the movieclips in order of number. It will start with 1, and when the button is pressed number 2 will be placed above, and so on.

When number 3, or whatever the highest movie is, is above the others, I would like the process to start again, so that when the button is clicked, movie number 1 will have the highest stacking order, and so on.

This is just the first part of my project, and hopefully I'll learn alot from any help I get.

Thanks!

View Replies !    View Related
Formatting Numerical Value Eg : 2000 Into 2,000
Hi, my name is IGX and I have question :

Is there anyway in Flash to format displayed number with comma or decimal point for example : 2000000 should be displayed as 2,000,000 for more ease to our eyes, is there any available way ?

Thank you.

- IGX

View Replies !    View Related
Actionscript Numerical Stepper
I am using flash mx 2004 and need help with something.

As part of a program I have a stepper where a user can click up and down to enter the number of people in there party(weddings or anything like that). I then have to divide this number up into as many groups of four as can be made and then the remainder of people into groups of two. It should then output to the user the number of groups of four created and number of groups of two.

I.E. User inputs 15.

//Actionscript takes this number and performs calculation to produce

3 tables of four.
2 tables of two.

Any help with the process involved here would be greatly appreciated as i am a novice and having a few problems locating a solution

View Replies !    View Related
Assigning Numerical Values To Letters
For a current project I'm working on in Flash MX, I'm taking people's names and converting their name to a number. For example, the name Eli, E's are 5 points, L's are 2 points, and I's are 3 points. The grand total is 10 points and depending on how many points your name equals it gives you a title. I'm wondering if it's possible to do that and how to do it aside from writing out every single name in the entire name dictionary and adding up how many points their worth.

Thanks

Wattsman1111

View Replies !    View Related
SetInterval - Non-numerical Interval Problem
I am feeding data from my XML file into my Flash file, and I want to define the amount of milliseconds for the 'setInterval' value in my XML file.

Instead of specifying a numerical value in my Flash file, I put the reference to my XML file (where the value IS a numerical value).

However, this is not interpreted as a number. I then attempted the number() function to turn the resulting string into a number, but this didn't work either.

code:
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("slides.xml");
slides_xml.ignoreWhite = true;
var counter = 1

function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);
tInterval = number(slides_xml.lastChild.firstChild.attributes. delay);

}
}


function updateSlide(newSlideNode) {
imagePath = newSlideNode.attributes.jpegURL;
slideText = newSlideNode.firstChild.nodeValue;
windowLoc = newSlideNode.attributes.windowLoc;
loadMovie(imagePath, targetClip);
}
function change_clip(){
nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
restart();
} else {
currentIndex++;
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
};
if (counter == totalSlides) {updateSlide(firstSlideNode); counter = 1;}
else {counter = counter + 1};

};

function restart() {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length;
firstSlideNode = rootNode.firstChild;
currentSlideNode = firstSlideNode;
currentIndex = 1;
updateSlide(firstSlideNode);

}


setInterval (change_clip, tInterval);



...and this is my linked XML file:


<Slides>

<slideNode jpegURL="images/banner1.jpg" windowLoc="_self">http://www.hello.com.au</slideNode>

<slideNode jpegURL="images/banner2.jpg" windowLoc="_blank">http://www.amazon.com</slideNode>

<slideNode jpegURL="images/banner3.jpg" windowLoc="_blank">http://www.theage.com.au</slideNode>


</Slides>


<Interval>

<tInterval delay="1000"></tInterval>

</Interval>



Any help appreciated!! Thanks!

View Replies !    View Related
Input Text Numerical Validation
Hi, I'm a newbie in actionscript and I need help for my math for kids game. I'm trying to check the numerical value in each (input text) boxes -- if the value is wrong, when user click the submit button, the wrong numbers will turn into red color. User will then redo the question in black colored number.
The questions are not random.

I'm now learning how actionscript works but this project needs to be done asap so I really thank you for any helps!

View Replies !    View Related
Pass A Numerical Variable With Quotes
Hi All

I posted about this a while back but the issue was never resolved. I'm using fuse to do some animation and if you want your animation to be relative instead of absolute you use quotations. Problem is when you try and pass a variable instead of just hardcoding it.

Anyone know how one would do this?


Code:
this doesnt work:
var navHeight:Number = 144;
var t:Fuse = new Fuse();
t.push({target:theWhole.button, y:'function(){return String(navHeight)}', seconds:1, ease:"easeOutQuad"});
t.start();
this works:

Code:
var t:Fuse = new Fuse();
t.push({target:theWhole.button, y:'144', seconds:1, ease:"easeOutQuad"});
t.start();

View Replies !    View Related
Sorting Variables Into Numerical Order
Hi
I have a load of variables which need sorting into numerical order. They arent yet in an array but can be if the solution requires this.
I was just wondering if Flash has a set way of putting numbers in to numerical order and if so, what is it and if not then how is the best way to go about doing this?
Thanks

View Replies !    View Related
Display The Numerical X & Y Values Of Cursor
I am trying to find away to have the the actual numerical x & y poistion of the cursor displayed within my site. First off does anyone know if this is possible. The reason I am asking is I have a site that is based on an outlined map of the world, at the bottom of the map I have a text heading for location of latitude and longitude. I would like the values for both latitude and longitude to change depending on where the cursor is over the world map. Any and all help would be great.

Thanks in advance,

View Replies !    View Related
Help Increasing/decreasing Numerical Text
Hi, I'm new to flash, so would appreciate any help. I have a dynamic text box and two buttons. Within the text box I would like to display a number, starting at zero. When the up button is clicked I'd like the number in the text box to increase by one, until it reaches 12. When the down button is clicked, I'd like the number in the text box to decrease by 1 until it reaches 0.

Can you help?

View Replies !    View Related
Sorting A Numerical Array By Variable Name
I'm creating a game and am in the middle of creating an inventory system, and I have an array for all of my items and an array for how many of each item is currently held. I then have a set of text boxes that I assign the item names and quantities to with a for loop. I need to constantly sort these arrays as new items are added to keep the items in order, but when the quantities array is sorted it throws everything off and all my quantities end up matching up with the wrong items. What I need to do is sort them by variable name so that itemArray(item1, item2, item3) matches up with itemQArray(item1.quantity, item2.quantity, item3.quantity). Is this even possible or will I have to rework my inventory system without the arrays?

View Replies !    View Related
Numerical Stepper Component. Help Needed
lets say the values of my numerical component vary from 1 to 10. next to the stepper there is a button. each number in the stepper together with the button lead to a specific URL, for example, if you choose 1 in the stepper the button goes to www.blah.com, if 2 then www.flashkit.com and etc. any idea how to do this? thanks!!!

View Replies !    View Related
How Can I Output Xml Info In Numerical Order?
Hello all,
I have a calendar movie which receives dates info from an xml file (such as events, appointments, etc)

My problem is that the events appear in my movie's dynamic text box in the order in which they are placed in the xml. Each event in the xml file has a day number, title, description and url link.

How can I get the events to display in numerical order from smallest to largest according to the day number instead of having to do it manually?

Hope this makes sense

Here's the AS:


Code:
function chgMonth(mnth)
{
activeDate = new Date(activeDate.getFullYear(), mnth, activeDate.getDate());
gotoAndPlay(4);
} // End of the function
function chgYear(yr)
{
activeDate = new Date(yr, activeDate.getMonth(), activeDate.getDate());
gotoAndPlay(4);
} // End of the function
function initCalander()
{
for (i = firstDay; i < lastDay + firstDay; i++)
{
theDay = eval(i);
theDay.dayNumber = i - firstDay + 1;
theDay.gotoAndStop(2);
} // end of for
if (activeDate == today)
{
tellTarget(todayDay + firstDay - 1)
{
gotoAndStop(3);
} // End of TellTarget
with (ring)
{
todayDayCal = eval(todayDay + firstDay - 1);
_alpha = 80;
_width = todayDayCal._width;
_height = todayDayCal._height;
_x = todayDayCal._x;
_y = todayDayCal._y;
} // End of with
} // end if
} // End of the function
function initEvents()
{
for (j = 0; j < currEventset.childNodes.length; j++)
{
currAttribs = currEventset.childNodes[j].attributes;
if (currAttribs.link.length)
{
montheventspanel = montheventspanel + unescape("<font color='#FF0000'><b>" + currAttribs.day + " </b> <a href='http://" + currAttribs.link + "' target='_blank'><font color='#CCCCCC'><b><u>" + currAttribs.title + "</b></u><br></font></a></font> <font size='-2'>" + currEventset.childNodes[j].firstChild.firstChild.nodeValue + "</font><br><a href='http://" + currAttribs.link + "' target='_blank'><font size='-2' color='#990000'>[ VIEW FLYER ]<br><br></font>");
}
else
{
montheventspanel = montheventspanel + unescape("<font color='#ffffff'><b>" + currAttribs.day + " </b>" + currAttribs.title + "</font> <font size='-1'>" + currEventset.childNodes[j].firstChild.firstChild.nodeValue + "</font><br>");
} // end else if
tellTarget(parseInt(currAttribs.day) + firstDay - 1)
{
gotoAndStop(4);
} // End of TellTarget
} // end of for
if (currEventset.childNodes.length == 0)
{
montheventspanel = "no events scheduled";
} // end if
} // End of the function
var today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
_parent.activeDate = new Date(_parent.chosenYear, _parent.chosenMonth, _parent.chosenDate);
activeDate = _parent.activeDate;
var eventsData = _parent.xmlData.currentEvents.xmlObj;
Here's the XML:


Code:
<yearevents year="2006">

<month id="0" name="January">
<event day="15" title="TEST 3" type="fest" link="www.google.com"><description>This is the event description</description></event>
<event day="19" title="TEST 3" type="fest" link="www.google.com"><description>This is the event description</description></event>
<event day="30" title="TEST 3" type="fest" link="www.google.com"><description>This is the event description</description></event>
</month>


<month id="1" name="February">
<event day="5" title="TEST 3" type="fest" link="www.google.com"><description>This is the event description</description></event>
<event day="11" title="TEST 3" type="fest" link="www.google.com"><description>This is the event description</description></event>
</month>

</yearevents>

View Replies !    View Related
To Format Numerical Display Eg: 2000 Into 2,000
Hi, my name is IGX and I have question :

Is there anyway in Flash to format displayed number with comma or decimal point for example : 2000000 should be displayed as 2,000,000 for more ease to our eyes, is there any available way ?

Thank you.

- IGX

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved