A Flash Developer Resource Site

Results 1 to 18 of 18

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

  1. #1
    Senior Member
    Join Date
    May 2016
    Posts
    451

    resolved [RESOLVED] (how do this ) dynamic text = number in around circle

    hello
    because my English language is bad

    i hope the pic explains required

    Attached Files Attached Files

  2. #2
    Senior Member
    Join Date
    May 2016
    Posts
    451
    this is important for me
    please help me

  3. #3
    Senior Member
    Join Date
    May 2016
    Posts
    451
    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 ;

    please heeeeeeelp

  4. #4
    Senior Member
    Join Date
    May 2016
    Posts
    451
    please

  5. #5
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,834
    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:
    addEventListener (Event.ENTER_FRAME, onEnterFrame);
    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. #6
    Senior Member
    Join Date
    May 2016
    Posts
    451
    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. #7
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,834
    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. #8
    Senior Member
    Join Date
    May 2016
    Posts
    451
    yes
    i want learn this
    please

  9. #9
    Senior Member
    Join Date
    May 2016
    Posts
    451

  10. #10
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,834
    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.
    .

  11. #11
    Senior Member
    Join Date
    May 2016
    Posts
    451
    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

  12. #12
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,834
    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?
    Last edited by swak; 04-08-2017 at 05:38 PM.
    .

  13. #13
    Senior Member
    Join Date
    May 2016
    Posts
    451



  14. #14
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,834
    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.
    .

  15. #15
    Senior Member
    Join Date
    May 2016
    Posts
    451
    swak

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

  16. #16
    Senior Member
    Join Date
    May 2016
    Posts
    451

  17. #17
    Senior Member
    Join Date
    Feb 2005
    Posts
    1,834
    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.
    .

  18. #18
    Senior Member
    Join Date
    May 2016
    Posts
    451
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center