List Info

Thread: _alpha vs _visible




_alpha vs _visible
country flaguser name
United States
2007-07-20 16:46:18
I'm working on some inherited code--rather old code at
that--and the
original coder did something I'm not sure I understand.

There's a pop-up window, with movie clips, that appears
under certain
circumstances. The original coder put the pop-up in
position, then set the
_alpha of all the parts to 0. When she wants the pop-up to
appear, she sets
the _alpha to 100.

Is there an advantage to that over setting the _visible
property? For that
matter, my usual practice, from my Director life, would be
to put the pop-up
off-stage, and then just move it on-stage when I wanted it
to appear.

Comments about the advantages or viability of the various
methods?

Cordially,

Kerry Thompson


_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

RE: _alpha vs _visible
country flaguser name
United States
2007-07-20 16:59:23
Kerry,

In terms of system resources being consumed, setting
_visible = false is
preferable to setting _alpha = 0.

Regards,

-Keith 
http://keithrei
nfeld.home.comcast.net
 


-----Original Message-----
From: flashnewbie-bounceschattyfig.figleaf.com
[mailto:flashnewbie-bounceschattyfig.figleaf.com] On
Behalf Of Kerry
Thompson
Sent: Friday, July 20, 2007 4:46 PM
To: 'Flashnewbie Mailing List'
Subject: [Flashnewbie] _alpha vs _visible

I'm working on some inherited code--rather old code at
that--and the
original coder did something I'm not sure I understand.

There's a pop-up window, with movie clips, that appears
under certain
circumstances. The original coder put the pop-up in
position, then set the
_alpha of all the parts to 0. When she wants the pop-up to
appear, she sets
the _alpha to 100.

Is there an advantage to that over setting the _visible
property? For that
matter, my usual practice, from my Director life, would be
to put the pop-up
off-stage, and then just move it on-stage when I wanted it
to appear.

Comments about the advantages or viability of the various
methods?

Cordially,

Kerry Thompson


_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

Re: _alpha vs _visible
country flaguser name
United States
2007-07-20 17:00:49
I think putting it offstage until you want it to be seen is
fine, and so 
is turning the visibility on/off (one drawback of the latter
is that the 
thing could appear briefly and then vanish, which wouldn't
happen if 
it's offstage).

Setting a movieclip invisible means that none of it's mouse
events will 
be responded to (not true of setting alpha to 0), so it's a
good way to 
disable mouse activity on a movieclip as well as hide it. 
On the other 
hand, sometimes you *want* parts of a movieclip that are not
seen to be 
active (eg, to define the hit area of a button movieclip) so
then 
alpha=0 is preferable. 

Another big advantage of setting something invisible instead
of alpha=0 
is then the processor won't try to render it.  I found once
when I made 
a slideshow of pictures that alpha-tweened in
(programmatically) 
sequentially, things got very slow and jerky when I set the
pictures' 
alpha to 0 to hide them, apparently because the processor
was trying to 
render all the pixels in all the alpha 0 movieclips.  But
when I set 
them to invisible, and then just set the alpha to 0 for the
one I wanted 
to fade-tween in next, it worked much more smoothly.

my two cents,
Helen


Kerry Thompson wrote:

>I'm working on some inherited code--rather old code at
that--and the
>original coder did something I'm not sure I understand.
>
>There's a pop-up window, with movie clips, that appears
under certain
>circumstances. The original coder put the pop-up in
position, then set the
>_alpha of all the parts to 0. When she wants the pop-up
to appear, she sets
>the _alpha to 100.
>
>Is there an advantage to that over setting the _visible
property? For that
>matter, my usual practice, from my Director life, would
be to put the pop-up
>off-stage, and then just move it on-stage when I wanted
it to appear.
>
>Comments about the advantages or viability of the
various methods?
>
>Cordially,
>
>Kerry Thompson
>
>  
>
_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

Re: _alpha vs _visible
user name
2007-07-20 17:00:56
Alpha, the item is still there, it's clickable, you can pass
info to it,
it's just in hiding. Setting it's visibility shuts it off
entirely, it's
still there, you just cannot do anything with it as it is
invisible to the
code until it's visibility has been turned back on. Also,
when the alpha has
been changed, the item is still using memory.


B.

On 7/20/07, Kerry Thompson <alphacyberiantiger.biz>
wrote:
>
> I'm working on some inherited code--rather old code at
that--and the
> original coder did something I'm not sure I
understand.
>
> There's a pop-up window, with movie clips, that appears
under certain
> circumstances. The original coder put the pop-up in
position, then set the
> _alpha of all the parts to 0. When she wants the pop-up
to appear, she
> sets
> the _alpha to 100.
>
> Is there an advantage to that over setting the _visible
property? For that
> matter, my usual practice, from my Director life, would
be to put the
> pop-up
> off-stage, and then just move it on-stage when I wanted
it to appear.
>
> Comments about the advantages or viability of the
various methods?
>
> Cordially,
>
> Kerry Thompson
>
>
> _______________________________________________
> Flashnewbiechattyfig.figleaf.com
> To change your subscription options or search the
archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.c
om
>
_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

RE: _alpha vs _visible
country flaguser name
United States
2007-07-20 17:24:35
Keith Reinfeld wrote:
 
> In terms of system resources being consumed, setting
_visible = false is
> preferable to setting _alpha = 0.

Thanks, Keith. I think the original coder was more of a
designer, and
setting _alpha was probably natural to her.

How about the other option, moving the pop-up off and on the
stage? That's
the preferred method in Director, but I'm not sure what the
ramifications
are in Flash.

Cordially,

Kerry Thompson


_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

Re: _alpha vs _visible
country flaguser name
United States
2007-07-20 17:34:27
Sorry, but this isn't true. A clip with _visiblity=false can
still 
receive code. Example: create a 2-frame clip with different
content 
in each frame. Create buttons to turn visibility on and off,
and 
other buttons to send it to frame 1 or frame 2. TestMovie.
Send the 
clip to frame 1. Turn off visibility. Send it to frame 2.
Turn on 
visibility: it is now on frame 2.

Marc

At 03:00 PM 7/20/2007, Bob Wohl wrote:
>  Setting it's visibility shuts it off entirely, it's
>still there, you just cannot do anything with it as it
is invisible to the
>code until it's visibility has been turned back on.
_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

Re: _alpha vs _visible
user name
2007-07-20 17:37:46
On 7/21/07, Kerry Thompson <alphacyberiantiger.biz>
wrote:
> How about the other option, moving the pop-up off and
on the stage? That's
> the preferred method in Director, but I'm not sure what
the ramifications
> are in Flash.

I'd think that the renderer would recognize that it's off
stage and
not waste any resources, but I don't know. I'd go with
_visible, if
only because it says what it does. After all, whether _x =
1000 is off
stage entirely depends on the position of the container.

Mark
_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

RE: _alpha vs _visible
country flaguser name
United States
2007-07-20 19:53:03
> After all, whether _x = 1000 is off stage entirely
depends on the position
of the container.

The trick is to set the _x and _y values to negative values
greater than the
dimensions of the movie. In all honesty, as a carry over
from Director I do
tend to use this practice from time to time in Flash. The
benefit I've found
is that when I am not using a mask and working in the Flash
IDE, I can
preview the movie and see what is happening with the
off-stage movie clip.

And, as was pointed out, setting the visible property to
false, does not
disable the movie clip from receiving events. If you want to
do that you
should also set the enabled property to false.


_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

Re: _alpha vs _visible
user name
2007-07-20 21:18:48
On 7/21/07, Hairy Dog Digital <adminhairydogdigital.com> wrote:
>
> > After all, whether _x = 1000 is off stage entirely
depends on the position
> of the container.
>
> The trick is to set the _x and _y values to negative
values greater than the
> dimensions of the movie.

What I meant was that, when you or somebody else reads the
code,
_visible = false unmistakably means one thing: the clip
isn't visible.
When I read _x = 100 (or _x = oldX or whatever, if you have
to use
this at least don't hard code the position), my first
thought will be
that the intention is to move it. Understanding that the
intention is
to make it appear depends on knowing that the clip had been
hidden by
moving it off stage. When I read _visible = true, I know the
coder
intents to make it visible (or at least ensure that it is).
Likewise,
when I read _x = -1000, I need to know that is off the
stage.

When there is a property that does what I want, and is even
named
descriptively, I use it.

Mark
_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

RE: _alpha vs _visible
country flaguser name
United States
2007-07-20 21:50:40
> What I meant was that, when you or somebody else reads
the code, 
> _visible = false unmistakably means one thing: the clip
isn't visible.

Agreed and I understood that. I was just commenting about
*why* I might move
an MC offstage. And if you saw my code you'd know that's
what the negative
_x value was for.


_______________________________________________
Flashnewbiechattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashnewb
ie

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.c
om

[1-10] [11-12]

about | contact  Other archives ( Real Estate discussion Medical topics )