Welcome to Virtual Tutorial World Guest!




Simple Movement

 
Post new topic   Reply to topic    VTW Forum Index -> Actionscript
View previous topic :: View next topic  
Author Message
computergeek67
Administrator
Administrator


Joined: 31 Jul 2007
Posts: 144
Tokens: 147
Location: US

PostPosted: Fri Sep 28, 2007 12:22 pm    Post subject: Simple Movement Reply with quote

First make an object. To make it simple, make a circle. Press "F8" to turn it into a Movie Clip (MC). Press "F9" to open the actions panel. Then add the actions:

Code:

onClipEvent(enterFrame){
    if(Key.isDown(Key.UP)){
    this._y -=3 }
    if(Key.isDown(Key.DOWN)){
    this._y +=3 }
    if(Key.isDown(Key.LEFT)){
    this._x -=3 }
    if(Key.isDown(Key.RIGHT)){
    this._x +=3
}
}


The code basically says that the speed that the MC will travel at is three and it will travel in any basic direction.


_________________



Come to me if you have any questions
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    VTW Forum Index -> Actionscript All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Card File  Gallery  Forum Archive
Powered by phpBB © 2001, 2005 phpBB Group
Virtual Tutorial World ©2007-2008 computergeek67

Affiliates