Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > Flash (all versions)
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Flash (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old January 5th, 2011, 12:33 PM
Registered User
 
Join Date: Jan 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to move movieclips using code in AS 2.0

to move a movieclip in flash using code it is very simple, give the instance name of char (or any other name, but you will have to change the name in the code) to the movieclip you want to move.

open up the actions panel and click on your movieclip. now if you want to move the movieclip up with arrowkeys, copy&paste this code into the actions panel;

onClipEvent(enterFrame){

if(Key.isDown(Key.LEFT)){
_root.char._x-=10

// this can be copied&pasted, but do not copy the onClipEvent part
// don't forget that the y axis is reversed!
}
}

"char" is the instance name, and the _x can be changed to _y

dont forget to change it to RIGHT, UP, or DOWN
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I move on .....???? pennkaiser BOOK: Beginning ASP.NET 4 : in C# and VB 3 August 14th, 2010 04:18 AM
How do you move the mouse outside the form and to move diagonally? fangzhien Visual Studio 2005 0 July 28th, 2009 11:06 PM
Using VBA Code to Move Data Nanette Access VBA 1 November 3rd, 2006 04:16 PM
buttons and movieclips kocken85 Flash (all versions) 0 March 3rd, 2005 07:27 AM
Move a file via code fordrs3 VB How-To 2 June 26th, 2003 02:04 PM



All times are GMT -4. The time now is 12:22 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.