Skip to main content
Inspiring
September 20, 2015
Answered

Object factory

  • September 20, 2015
  • 1 reply
  • 506 views

How do I get a function to collect a movieclip object, doing that after I catch it, it disappears from the scene ... but can be manufactured again, maybe from a clash between different object?

For example: I picked up the object, disappears from the site. When this same object touching a particular location it back to a position + =% visible, have to be collected again.

The most important topic is how can I make the object disappear when I pick up, and show up when it rings at another secondary object.

Thank you.

This topic has been closed for replies.
Correct answer Ned Murphy

The number of frames has no bearing on the approaches I suggested.  In fact, those suggestions would need to occur in just one frame so you don't need to change anything in that regard.

Your explanation of when things disappear or not is not clear, but if touching the object that is supposed to disappear is necessary then you probably only want to change the alpha property from 0 to 1 and vice versa.  An invisible object cannot be interacted with but one that has its alpha set to 0 can be.

1 reply

Ned Murphy
Legend
September 20, 2015

One way would be to switch its visible property between true (visible) and false (not visible).  Another way would be to remove the object from the display list (removeChild) and then either add it back in, (addChild) or create a new instance of it.  If there is only going to be one of these objects at any time then you are likely better off just have the one and playing with its appearance.

vvvverTAuthor
Inspiring
September 20, 2015

But my project takes place in a single frame.

Let's say I create a square and put his name mast, and the object that should go away when a character starts. Should he take the object disappears, and when it touches the mast returns visibility.

Ned Murphy
Ned MurphyCorrect answer
Legend
September 20, 2015

The number of frames has no bearing on the approaches I suggested.  In fact, those suggestions would need to occur in just one frame so you don't need to change anything in that regard.

Your explanation of when things disappear or not is not clear, but if touching the object that is supposed to disappear is necessary then you probably only want to change the alpha property from 0 to 1 and vice versa.  An invisible object cannot be interacted with but one that has its alpha set to 0 can be.