[RESOLVED] (how do this ) dynamic text = number in around circle
A Flash Developer Resource Site

# Thread: [RESOLVED] (how do this ) dynamic text = number in around circle

1. ## [RESOLVED] (how do this ) dynamic text = number in around circle

hello
because my English language is bad

i hope the pic explains required

2. this is important for me

3. i try this code but it works all time

if ( _parent.circle.circle2.t3._x >= 1117 and _parent.circle.circle2.t3._x <= 1119) {
_parent.tex.text = 3 ;

5. if ( _parent.circle.circle2.t3._x >= 1117 and _parent.circle.circle2.t3._x <= 1119) {
_parent.tex.text = 3 ;
This won't work for a number of reasons. The main being that t3 is contained inside circle2. Because of this t3's x will be relative to circle2. There are other reasons that this would be a bad way but that's the main. A better way to handle this would be to use angles instead.
Code:
var r:int = 0;
var o:int = 1;
function onEnterFrame (e:Event):void {
if (r>=360) {
r = 0;
} else {
r++;
}
o=(r==0)?1:Math.ceil(r/18);
t.text=r+"\n"+o;
}
t.text is a textfield I used for output. Don't need it. You find the 18 by using 360 divide by number of numbers.

6. first
thanks swak
i used your code in my swishmax but do not work
can you please edit my file to work fine
excuse me for my bad English language
thanks again

7. Sorry, I don't have swishmax. I can explain it if you'd like but it'd be good to learn this kind of this.

8. yes
i want learn this

9. Here's you go.
Movie2.swi
I did two things with this.
I changed the rotation of the text to rotate counter clockwise.
I change the rotation to last from 15 to 20 frames.
I used this: _parent.tex.text = _parent.circle._currentFrame+1 ;

The code I was sharing earlier can be better but this should work fine.

10. thaaaaaaaaaaaaaaaaaaaaaaaaaaaaank yooooooooooooooooooooooooooooooou

veeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeery

mutchhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

swaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaak

but if effect > 20 . it means move effect = 30
not work fine
what do i do if i want this
thaaaaaaaaaaaaaaaaaanke again

11. The reason I did it the way I did was it's the simplest. The problem with that is it's very inflexible. What I mean by that is if you want to make any changes, like the speed of rotation, then you don't have very many options for it to work very well. To do it properly I'd want to just remake the whole thing. I'm not too familiar with swishmax so I'd want to use flash instead.

Basically to do this right there's several changes you'd have to make. 1) change the rotation from a preanimation to using code to rotate it. 2) Change the code to run continuously instead of when you press the button. In the end you'll have to figure out what exactly you want out of this. The more you want, the more it'll be worth.

Not sure what you're asking with you're earlier post. What do you mean by effect?

12. I see. You'll have to make sure the number of frames the animation has is multiples of 20. Then just adjust the text code like this:
Code:
_parent.tex.text =  Math.ceil((_parent.circle._currentFrame+1)/(_parent.circle._totalFrames/20));
The Math.ceil is for rounding the number up.
(_parent.circle._totalFrames/20) This will automatically account for when you adjust the length of the animation. Just make sure you keep it as multiples of 20. Otherwise you'll get wierd issues.

13. swak

from this time you are my teacher and i am your student
thank you swak
thank you very mutch

14. If everything's finished then change the title to this: "[Resolved](how do this ) dynamic text = number in around circle" This will show that the problem's finished.

15. ok my teacher

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap