-
Hi folks,
im not that experienced in AS
well, i just want to code a simple counter that counts from 0 to a given integer.
for example and my thoughts:
a given textfield for the countoutput named "showme" with presetted integer 0
code for it
showme=Number(showme)+1
runs in a loop on the timeline
well, problem now, this line of code, counts infinite, and i just want to count to a given integer.
What to code that this counter stops at, for example, at 200
Maybe an "IF" command would help, dunno exactly.
thx in advance
-
Code:
for(i; i<=100; i++)
{
trace(i);
}
Just replace 100 with what ever number you want and replace trace with something like
myTextBox.text = i;
-
Originally posted by Squareball2
Code:
for(i; i<=100; i++)
{
trace(i);
}
Just replace 100 with what ever number you want and replace trace with something like
myTextBox.text = i;
This will count to 100 in a single frame - probably not what was intended.
-
Originally posted by nmain
Originally posted by Squareball2
Code:
for(i; i<=100; i++)
{
trace(i);
}
Just replace 100 with what ever number you want and replace trace with something like
myTextBox.text = i;
This will count to 100 in a single frame - probably not what was intended.
From what the original poster said, that is what I gather they want to do. What do you think they mean?
-
oh wait do you mean like it should show 1 then 2 then 3 and so on?
-
Yea helps a bit
well, last post is right.
the original idea for what i want to use that counting stuff is a scripted animation.
i just need a textbox and a piece of script that counts from 0 to the "xmouse" integer returned by getproperty, to move one endpoint from a line from XY pixel 0 to XY pixel of returned value of xmouse property.
thats all, but dunno how to count up to an integer that is already defined.
the for loop works, but it counts that fast that the line reaches immediatly the return XY value my xmouse property at movie startup.
-
Ok try this ON a movie clip
Code:
onClipEvent(enterFrame)
{
i;
if(i <= 100)
{
i++
}
_root.theTextBox.text = i;
}
Make sure that you target your text box correctly.
That should work.
-
textfield on stage _root.showme
Create an empty movie clip, drag it on stage and add this script to it with onClipEvent(enterFrame):
onClipEvent (enterFrame) {
if (count>200) {
_root.counter.stop();
} else {
_root.showme = count++;
}
}
Forgot to mention that the instance name of the mc is counter!
[Edited by oldnewbie on 04-14-2002 at 09:02 PM]
-
-
it works :)) but runs really crappy
http://www.elektrobong.com/linemove.fla
current version of the linepointmovement im trying to figure out.
works really ****, but better than before with no function and a brain shortly before blow up.
help to this would be nice, because i have no idea how to code a smooth working linepointmovement.
thx a lot in advance, still trying to figure that out
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|