Advanced Search

Results 1 to 3 of 3

Thread: "alpha" vs "visible"

  1. #1
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Default "alpha" vs "visible"

    circ is my object

    I set the property to
    circ.alpha="0";
    or
    circ.visible=false;
    I have been using alpha
    is there an advantage to using one or the other?

    trivial, maybe but inquiring minds want to know

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Same effect. Different results.

    Alpha = 0 sets the transparency of an object to 0 (i.e. it's not visible anymore).

    Visible = false removes the object from the display list temporarily but it does NOT delete the object. So, if needed, the object can be recalled by setting visible=true. So, using the visible property frees up some system resources.

    Another advantage (if this is the desired effect) is that visible = false objects cannot take mouse events, whereas alpha = 0 can. Sometimes what happens is that there are alpha=0 objects still left on the stage and even though they aren't visible, still perform the actions as if they were.

    So, if the goal is to remove an object from the display list (i.e. put it away in storage, so to speak), then use visible. If it's for a tween, etc... use alpha. Even with tweening, I usually set the object to visible = false in the callback function.

  3. The Following User Says Thank You to Medyman For This Useful Post:

    evan (07-30-2008)

  4. #3
    Join Date
    Jan 2008
    Location
    Near Chicago
    Posts
    247
    Thanks
    105
    Thanked 2 Times in 2 Posts

    Default

    That makes alot of sense.
    BTY I did get that cursors thing to work in As3 -not as pretty though.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •