Counting number of objects moved to target

  • Mrc1n4
  • Novice
  • Novice
  • Mrc1n4
  • Posts: 26
  • Loc: Slovenia

Post 3+ Months Ago

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

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

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. }
  • Mrc1n4
  • Novice
  • Novice
  • Mrc1n4
  • Posts: 26
  • Loc: Slovenia

Post 3+ Months Ago

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 8 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.