movement problem

This is a discussion on "movement problem" within the Flash & Multimedia Forum section. This forum, and the thread "movement problem are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Feb 9th, 2008, 18:58
New Member
Join Date: Feb 2008
Location: cluj
Age: 26
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
movement problem

Hi,

I am trying to make 2 circles (MC) move with the LEFT arrow after I click on one of them (selecting witch to move)(ex.clic ball1 move it with the key, then click ball2 and move it..). But I can move only one circle, the other it doesn't respond when I click on it. Can you help me with this?
---------ball1
on (press){ sel=1; } on (keyPress "<Left>"){ if(sel==1) this._x = this._x -5 }
---------ball2
on (press){ sel=2; } on (keyPress "<Left>"){ if(sel==2) this._x = this._x -5 }
------------first frame
set=0
Reply With Quote

  #2 (permalink)  
Old Feb 9th, 2008, 21:28
marSoul's Avatar
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 411
Blog Entries: 2
Thanks: 4
Thanked 4 Times in 4 Posts
Send a message via MSN to marSoul Send a message via Yahoo to marSoul
Re: movement problem

please attach your .fla file
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Reply With Quote
  #3 (permalink)  
Old Feb 9th, 2008, 21:43
New Member
Join Date: Feb 2008
Location: cluj
Age: 26
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: movement problem

my *.fla
Attached Files
File Type: fla s1.fla (29.0 KB, 2 views)
Reply With Quote
  #4 (permalink)  
Old Feb 10th, 2008, 10:19
marSoul's Avatar
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 411
Blog Entries: 2
Thanks: 4
Thanked 4 Times in 4 Posts
Send a message via MSN to marSoul Send a message via Yahoo to marSoul
Re: movement problem

If you want to control key press its better to use key listeneres, in this file i have created a function that moving balls but for ball1 i have assigned left key and for ball2 right key, so as i said for best control on keys you should use key listeners
if you need more information please tell me
Attached Files
File Type: fla moveball.fla (47.5 KB, 3 views)
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Reply With Quote
  #5 (permalink)  
Old Feb 11th, 2008, 05:56
New Member
Join Date: Feb 2008
Location: cluj
Age: 26
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: movement problem

One more thing,how can I block the 2 circles so they don't get one in to another.

What shlould I write inside the action ---- if (circle.hitTest
Reply With Quote
  #6 (permalink)  
Old Feb 11th, 2008, 09:42
marSoul's Avatar
Moderator
Join Date: Sep 2007
Location: Tehran - Iran
Age: 28
Posts: 411
Blog Entries: 2
Thanks: 4
Thanked 4 Times in 4 Posts
Send a message via MSN to marSoul Send a message via Yahoo to marSoul
Re: movement problem

Yes one way is to test with hittest, but the problem with hittest is it will test the hit with bounding box around circle so u will get collision when bounding boxes hit each other
so more accurate way is to calculate the distance between two objects
__________________
Designing For Communicating
Website : http://www.datisdesign.com
Weblog : http://blog.datisdesign.com

Last Blog Entry: Throughout IRAN (Dec 10th, 2007)
Reply With Quote
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
First image problem and inline list problem konnor5092 Web Page Design 8 Dec 1st, 2007 09:08
movement parameters..... ARGH callumazoo Flash & Multimedia Forum 6 May 31st, 2007 14:19


All times are GMT. The time now is 02:05.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43