A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: [RESOLVED] _root help

  1. #1
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,255

    resolved [RESOLVED] _root help

    Basically my problem is when I click my button I have it so my character moves from one place to another as follows:
    PHP Code:
    on(release){
        if(
    _root.character._x 50 || character._root (this)) {
                    
    _root.character.gotoAndStop(4);
                    
    _root.character._x 235;
                    
    _root.character._y 201;
        }
        

    Instead of it directly rooting to _x = 235 _y =201 I would like it so it goes there with a certain speed instead of just like just appearing at 235, 201 if anyone can help I will appreciate this.
    Last edited by AS3.0; 12-23-2011 at 10:18 PM.

  2. #2
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Please post your FLA file, I need to so your structure
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  3. #3
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    mess around with this

    Actionscript Code:
    on(release){
        if(_root.character._x > 50 || character._root (this)) {
                    _root.character.gotoAndStop(4);
                    motionA = new mx.transitions.Tween(_root.character, "_x", None.easeNone, _root.character._x, 235, 4);
                    motionB = new mx.transitions.Tween(_root.character, "_y", None.easeNone, _root.character._y, 201, 4);
        }
       
    }

    (_root.character, "_x", None.easeNone, _root.character._x, 235, 4);

    (movieclip, type , easetype, clip current _x, moveto _x, duration(secs))

  4. #4
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,255
    omg thats freaking amazing thanks dude and thanks for trying to help nig 13 love you guys no homo haha

  5. #5
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,255
    wait any of you know like lets say my character reaches its point how to make it than _root.character.left.gotoAndStop(1);

  6. #6
    Prid - Outing Nig 13's Avatar
    Join Date
    Jul 2006
    Location
    Norway
    Posts
    1,864
    Tween has its own Event Handler for that, use this code for that:

    Actionscript Code:
    motionB.onMotionFinished = function(){
        _root.character.left.gotoAndStop(1);
    }

    Hope I helped now
    I am back, guys ... and finally 18 :P

    BRING BACK THE OLD DESIGN!! OR AT LEAST FIX THE AS TAGS

  7. #7
    Client Software Programmer AS3.0's Avatar
    Join Date
    Apr 2011
    Posts
    1,255
    oh thanks you think you can help me on this last thing
    http://board.flashkit.com/board/showthread.php?t=825904

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