Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 12-01-2006, 07:29 PM   #1
msnyder
Registered User
 
Join Date: Dec 2006
Posts: 1
Default Hit-testing Multiple Clips

I'm using Flash 8, trying to make a game. The problem is that there is a lot of one movieclip, they happen to be boxes, and basically my issue is trying to figure out a way in which to have one set of collision code work for all the boxes. My original idea was to add a line for each side of the box (Top, Left, Right, Bottom), and which the way my code works i want to disable the ability to move in that direction once you collide with the box. The problem with this is I do not know how to refer to lines made in my movieclip to represent the boundries of the box and not let the moving character go past them.

onClipEvent (enterFrame) {

if (this.hitTest(_root["TopLine"]))
{
movespeedUp=0
}
else
movespeedUp= 11
}

this is my code for stopping the character from going outside the frame. The movespeedUp is declared at the beggining of the code :

onClipEvent (load){
moveSpeedRight=11
moveSpeedLeft=11
moveSpeedUp=11
moveSpeedDown=11
}

Basically, my question is how do I refer to the moveSpeedRight property when in another movieclip?
msnyder is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Movie Clips on Multiple Layers (Playing Problem) Yasin ActionScript 2.0 8 07-13-2006 09:05 AM
unloading multiple movie clips asprinwizard ActionScript 2.0 2 06-08-2006 02:21 PM
How can I load multiple movie clips and mp3 so that the swf file will work? wlester ActionScript 2.0 0 09-16-2005 09:01 AM
Problem Stopping multiple movie clips msabo Simple Stuff (Newbies) 2 07-04-2003 03:22 PM
target multiple clips Nick ActionScript 1.0 (and below) 1 01-13-2003 06:32 PM


All times are GMT. The time now is 01:42 AM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.