Flash WOLF
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Flash WOLF

Learn Flash Together!
 
HomeLatest imagesSearchRegisterLog in

 

 Mouse Controled

Go down 
AuthorMessage
DDWOLFER
Admin



Posts : 4
Join date : 2008-07-15
Location : On an island! duh!

Mouse Controled Empty
PostSubject: Mouse Controled   Mouse Controled Icon_minitimeTue Jul 15, 2008 8:07 am

Hey,

In this topic I am going to teach you how to make a mouse controled object like how Virtual Worlds control there characters.

First make a character or a object. The highlight the character, and press F8 and name it and make it a movieclip. Then highlight it again and press F9 and Action Script should pop up. Copy and paste this code below.


onClipEvent (load) {
_x = 239.1;
_y = 184.9;
speed = 2;
}
onClipEvent (mouseDown) {
endX = _root._xmouse;
endY = _root._ymouse;
}
onClipEvent (enterFrame) {
_x += (endX-_x)/speed;
_y += (endY-_y)/speed;
}

There are a few bugs with this one but I will fix it. Press Ctrl and Enter to test the moive and it should start working. post on this topic if you have any questions.

Thanks,
DDWOLFER
Back to top Go down
https://flashwolf.forumotion.com
 
Mouse Controled
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Flash WOLF :: Flash CS3 Pro :: ActionScript 2.0-
Jump to: