View Full Version : 3.0 help creating moving objects
emerald511
02-11-2008, 03:10 AM
I just started flash and I'm working on an actionscript 3 project for school due tomorrow. There are several things I cant remember how to do which I need to do.
I want to make several rectangles which you can drag around the screen and if they are in a certain spot they trigger a different object to move. How would I create those restrains?
emerald511
02-11-2008, 04:11 AM
Ok so Ive got my code partially worked out now however my visibility condition isn't working. What's wrong?
function moveMagnet(event:MouseEvent):void{
bunnyMagnet_mc.startDrag()
}
function moveMagnetStop(event:MouseEvent):void{
bunnyMagnet_mc.stopDrag()
if (bunnyMagnet_mc.x > 250){
bunnyMagnet_mc.visibility = false;
}
}
bunnyMagnet_mc.addEventListener(MouseEvent.MOUSE_DOWN, moveMagnet);
bunnyMagnet_mc.addEventListener(MouseEvent.MOUSE_UP, moveMagnetStop);
_Aerospace_Eng_
02-11-2008, 06:00 AM
Thats not the correct way to set a movie clips visibility. Adobe has some awesome help docs within their programs, I suggest you actually use them.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.