Can't Remove MovieClip AS3

  • (2 Pages)
  • +
  • 1
  • 2

24 Replies - 5434 Views - Last Post: 15 August 2013 - 05:36 AM

#16 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 998
  • View blog
  • Posts: 4,173
  • Joined: 14-February 08

Re: Can't Remove MovieClip AS3

Posted 13 August 2013 - 07:56 AM

You're thinking of it the wrong way around

if(Coin1)



Is the same as if Coin1 is not null. So by seeing your trace of "null object" you're actually seeing that Coin1 is not null, not that it is. Understand?
Was This Post Helpful? 0
  • +
  • -

#17 llamaboy226  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 12-August 13

Re: Can't Remove MovieClip AS3

Posted 13 August 2013 - 08:08 AM

That actually makes far more sense than my way of thinking about it haha. Thank you very much, you've been a huge help to me and my team.
Was This Post Helpful? 0
  • +
  • -

#18 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 998
  • View blog
  • Posts: 4,173
  • Joined: 14-February 08

Re: Can't Remove MovieClip AS3

Posted 13 August 2013 - 08:29 AM

Glad to help. Is it working now?
Was This Post Helpful? 0
  • +
  • -

#19 llamaboy226  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 12-August 13

Re: Can't Remove MovieClip AS3

Posted 13 August 2013 - 08:54 AM

No, it still doesn't work. But I've wasted more than enough of your time and due to the strange format of our code I personally believe there is no proper way to actually remove the coins. The only thing I can do is hope that I might be able to re-position them so that the player can't hit them. Our main problem is that the coins give us score, but they're giving us score indefinitely. We want each coin to just give us 10 points and be done with it. However, turning them invisible obviously doesn't make them actually gone, and our format doesn't allow us to remove them.
Was This Post Helpful? 0
  • +
  • -

#20 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Can't Remove MovieClip AS3

Posted 13 August 2013 - 04:36 PM

It would be better for you to work out how to remove the coins. There must be somewhere where the coin class is defined, telling you if it is derived from anything. The reason why you can't find the info is because you haven't found this info.

Guesswork isn't going to work.
Was This Post Helpful? 1
  • +
  • -

#21 llamaboy226  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 12-August 13

Re: Can't Remove MovieClip AS3

Posted 13 August 2013 - 05:37 PM

Yes, the problem is, the coin class is not ever specifically defined, because our "lead" formatted the programming in a weird way. You may have noticed we don't even have a project package. We haven't called any classes because it doesn't allow us to do so, because we don't have a package. What we have, is a large compilation of code snippets that, against all laws of probability have been producing great results. The problem lies in us trying to do anything where we would need to have any classes called. That is why I needed to find a sneaky work around.
Was This Post Helpful? 0
  • +
  • -

#22 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 998
  • View blog
  • Posts: 4,173
  • Joined: 14-February 08

Re: Can't Remove MovieClip AS3

Posted 14 August 2013 - 04:32 AM

View PostButchDean, on 14 August 2013 - 12:36 AM, said:

It would be better for you to work out how to remove the coins. There must be somewhere where the coin class is defined, telling you if it is derived from anything. The reason why you can't find the info is because you haven't found this info.

Guesswork isn't going to work.


The problem is that the Coin class is actually a MovieClip added to the stage. It will derive from MovieClip or Sprite, that much is clear. The problem is finding out which part of the display list the object has been added to so that it can then be removed. My above code should work, getting the parent of the object and then removing from that, but that created another null object reference as the code is somewhere trying to access the object after it has been set to null and removed from the stage.
Was This Post Helpful? 0
  • +
  • -

#23 anonymous26  Icon User is offline

  • D.I.C Lover

Reputation: 0
  • View blog
  • Posts: 3,638
  • Joined: 26-November 10

Re: Can't Remove MovieClip AS3

Posted 14 August 2013 - 09:16 AM

What development environment is being used? A good one will give a graphical representation of the overall structure of the code. Eyeballing the actual code is clearly challenging.
Was This Post Helpful? 0
  • +
  • -

#24 stayscrisp  Icon User is offline

  • フカユ
  • member icon

Reputation: 998
  • View blog
  • Posts: 4,173
  • Joined: 14-February 08

Re: Can't Remove MovieClip AS3

Posted 15 August 2013 - 01:13 AM

Must be the Flash IDE, which is lacking to say the least :s
Was This Post Helpful? 0
  • +
  • -

#25 llamaboy226  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 12
  • Joined: 12-August 13

Re: Can't Remove MovieClip AS3

Posted 15 August 2013 - 05:36 AM

We are using Flash Professional CS5 but unfortunately our deadline is this morning at 8:30 and we've found some work arounds that will allow us to present to the client and make it appear as though we have it all working. We'll be able to reformat everything after having shown it to the Client, and then everything will work perfectly fine. Thank you for all the great tips as I'm sure they'll help once we've reformatted.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2