Forum Topic: _root

(215 views • 12 replies)

This topic is 1 page long.

<< < > >>
Questioning

Regone

Reply To Post Reply & Quote

Posted at: 6/7/06 07:35 PM

Regone NEUTRAL LEVEL 11

Sign-Up: 04/10/05

Posts: 46

My flash is a cocklicking peice of... well.... why wont this work: i have a dynamic text, with number 0 and var "redb". then i have a movieclip, with a frame with this code: _root.redb +=10

But when i start the movie, it just says 10 then 1010 then 101010... i want it to say 10-20-30...

when i have the dynamic at 10 and the code in the movieclip at _root.redb -= 1 , it says NaN.. WTF help me plz!


None

T-H

Reply To Post Reply & Quote

Posted at: 6/7/06 07:38 PM

T-H LIGHT LEVEL 38

Sign-Up: 01/07/04

Posts: 4,903

I think its reading your redb variable as a string, thats why it concatenates the 10 on every time.

where you define it , use

var redb:Number = 0;

tell me if it still doesnt work.


None

Chaz

Reply To Post Reply & Quote

Posted at: 6/7/06 07:39 PM

Chaz LIGHT LEVEL 21

Sign-Up: 09/27/05

Posts: 4,103

try adding redb = 0 on the main timeline.

Click sig for "The Cell 2" Production Blog.

BBS Signature

None

Regone

Reply To Post Reply & Quote

Posted at: 6/7/06 07:40 PM

Regone NEUTRAL LEVEL 11

Sign-Up: 04/10/05

Posts: 46

it still doesn't work. the number is at 0. the code is now _root.main += 1 (i changed var)
but it still says 0 then 01 then 011 and so on...


None

Chaz

Reply To Post Reply & Quote

Posted at: 6/7/06 07:45 PM

Chaz LIGHT LEVEL 21

Sign-Up: 09/27/05

Posts: 4,103

At 6/7/06 07:40 PM, Regone wrote: it still doesn't work. the number is at 0. the code is now _root.main += 1 (i changed var)
but it still says 0 then 01 then 011 and so on...

change +=1 to ++;

Click sig for "The Cell 2" Production Blog.

BBS Signature

None

Regone

Reply To Post Reply & Quote

Posted at: 6/7/06 07:46 PM

Regone NEUTRAL LEVEL 11

Sign-Up: 04/10/05

Posts: 46

i did now, but then it says NaN :S


None

Chrispington

Reply To Post Reply & Quote

Posted at: 6/7/06 08:54 PM

Chrispington EVIL LEVEL 31

Sign-Up: 07/02/04

Posts: 1,247

_root.redb = _root.redb + 10;

BBS Signature

None

Lopas1

Reply To Post Reply & Quote

Posted at: 6/26/06 01:07 PM

Lopas1 LIGHT LEVEL 22

Sign-Up: 06/06/05

Posts: 2,824

on first frame add:
_root.main = 0;
_root.main += 1;

On second frame add:
_root.main += 1;

on third frame add:
gotoAndPlay(2);

Then it will count as hell!

Add my Xbox Live Gamertag: Macintawtsh
Mah new ride! :D

BBS Signature

None

Lopas1

Reply To Post Reply & Quote

Posted at: 6/26/06 01:09 PM

Lopas1 LIGHT LEVEL 22

Sign-Up: 06/06/05

Posts: 2,824

And can you please remove Lopas1 from you're sig... someone might think you're in love!!LOL

maybe YOU (NOT ME) are...

Add my Xbox Live Gamertag: Macintawtsh
Mah new ride! :D

BBS Signature

None

Snubby

Reply To Post Reply & Quote

Posted at: 6/26/06 01:11 PM

Snubby FAB LEVEL 20

Sign-Up: 12/04/04

Posts: 3,145

_root.createTextBox("redb", _root.getNextHighestDepth(), 5, 5, 50, 22);
_root.onMouseDown(){
_root.redb += 10;
}

there ya go


None

Snubby

Reply To Post Reply & Quote

Posted at: 6/26/06 01:12 PM

Snubby FAB LEVEL 20

Sign-Up: 12/04/04

Posts: 3,145

At 6/26/06 01:11 PM, Snubby wrote:

_root.createTextBox("redb", _root.getNextHighestDepth(), 5, 5, 50, 22);
_root.onMouseDown = function(){
_root.redb += 10;
}

BAAAH!!!


None

liaaaam

Reply To Post Reply & Quote

Posted at: 6/26/06 01:13 PM

liaaaam NEUTRAL LEVEL 21

Sign-Up: 12/11/04

Posts: 12,766

_root.main = Number(_root.main)+1;


None

Mr-Money

Reply To Post Reply & Quote

Posted at: 6/26/06 01:30 PM

Mr-Money NEUTRAL LEVEL 15

Sign-Up: 11/05/05

Posts: 2,272

Have your variable and then -(-10);

10 is just an example, but by doing -(-Number), it will add the number.


All times are Eastern Standard Time (GMT -5) | Current Time: 07:54 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!