Counting number of objects moved to target

  • Mrc1n4
  • Novice
  • Novice
  • No Avatar
  • Joined: Apr 04, 2006
  • Posts: 26
  • Loc: Slovenia
  • Status: Offline

Post February 22nd, 2007, 3:11 pm

Hi, I wonder how to count number of objects (drag&Drop), which are dropped on a specific place(movie clip).
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post February 22nd, 2007, 3:11 pm

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post February 22nd, 2007, 11:14 pm

Code: [ Select ]
targetToDropOn.objCount = 0;
obj.onRelease = obj.onReleaseOutside = function()
{
  if (this.hitTest(targetToDropOn)
  {
    targetToDropOn.objCount++;
    trace(targetToDropOn.objCount);
  }
}
  1. targetToDropOn.objCount = 0;
  2. obj.onRelease = obj.onReleaseOutside = function()
  3. {
  4.   if (this.hitTest(targetToDropOn)
  5.   {
  6.     targetToDropOn.objCount++;
  7.     trace(targetToDropOn.objCount);
  8.   }
  9. }
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • Mrc1n4
  • Novice
  • Novice
  • No Avatar
  • Joined: Apr 04, 2006
  • Posts: 26
  • Loc: Slovenia
  • Status: Offline

Post February 25th, 2007, 3:50 am

Ok it works. I added this code to an MC:

on (rollOver) {
trace(objCount);
if (objCount >= 7) {
gotoAndPlay("20",1);
}
}

It traces number of objects moved at it, but it wont play scene 20 when 7 or more object are moved at it. Why?

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 34 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.