TwelvestoneFlash

I guess _visible doesn't work like I thought it did.


Sign in

  • Waiting for Godot ( 730 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 5.1 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.9 k posts )
    general front end design an...
  • Back End ( 9.7 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
JERKSTORE
 
2009-03-29

I have a two movie clips, a parent and a child. I want to be able to hide the child (without deleting it) and no longer have the size of the child affect the size the parent reports itself as.

However, if I just do:

mcParent.mcChild._visible = false

Then even though the child is hidden, its dimensions still affect the parent's size. Is there a way to disable a clip, so not only is it not visible but it also doesn't have dimensions either?

All this time, I thought _visible=false was already doing this, but I guess I never ran into a sizing problem like this before so I never noticed it.

(AS2)

JLM
 
2009-03-29

Jerkstore your best bet is to create your own x and y parameters and hide and show there is however no reason in as2 not to loop through and store everything about a movieclip before temp removing. Look at working with inherited or composite versions of the MovieClip. Compositing where you create the required movie methods and store a movie instance in your class, it can be more work, but it allows you to process properties ie if !_child._visible return minW else return _here._width

DontBogartMe
 
2009-03-29

too lazy to look this up... but doesn't getBounds() do what you want Jerkstore?

Arsis
 
2009-03-30

getBounds won't do it.

You could try making the child _xscale and _yscale = 0;

Sucks though.

JERKSTORE
 
2009-03-30

Thanks for all of the info guys.

JLM, I'll definitely look into Compositing in the future, but for this project I just need it working asap k

Arsis, setting the _xscale and _yscale to 0 worked like a charm - can't believe I didn't think of that myself.

Thanks.

Arsis
 
2009-04-01

Originally posted by: JERKSTORE Arsis, setting the _xscale and _yscale to 0 worked like a charm - can't believe I didn't think of that myself.

But did it make you feel all icky inside? it should have.

JERKSTORE
 
2009-04-01

Yes.

Flux
 
2009-04-01

We did a lot of tests with _visible= false back in the day (mx flash player 6) to see if making clips invisible would optimize performance of our flash application. Turned out that objects that were invisible would still affect framerate. We found out that in order to optimize performance we had to place the invisible items on e.g. _y=10000 to make our application run faster. Very weird.

JERKSTORE
 
2009-04-01

That is weird. Sounds like I'm not the only one who thought _visible did more than just hide a clip from view and mouse interactions.

Storm
 
2009-04-01

When you ASSUME you make an ass out of U AND FLASH!!

That'll teach ya.

Arsis
 
2009-04-06

visibility only determines if an object is to be rendered or not... it will not remove it from the event system and it it will remain accessible like any other clip.

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

I guess _visible doesn't work like I thought it did.