Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








[F8] Visibility


Hi im a noob to actionscript. im having trouble getting this simple piece of code to work. basically i have a button and a text box, when the button is clicked i want them to disappear and another text box come up as if it was to display a result, can anyone help? here is my code:

this.createTextField("testR",this.getNextHighestDe pth(),200,200,200,50)
this.visible=false;
this.testR.border=true;
this.testR.text="display";




this.createEmptyMovieClip("container",this.getNext HighestDepth())
container.createTextField("testT",container.getNex tHighestDepth(),100,100,200,50)
container.testT.border=true;
container.testT.text="hello";
container.attachMovie("Button","hideBut",container .getNextHighestDepth())
container.hideBut.onRelease=function(){
this._parent._visible=false;
this._parent._parent._visible=true;

}




FlashKit > Flash Help > Flash ActionScript
Posted on: 11-14-2006, 10:17 AM


View Complete Forum Thread with Replies

Sponsored Links:

Visibility
hey all,
I'm having some problems with changing the visibility of a graphic ( i also tryed MC too). This is the code for the button to change the vis:

on (rollOver) {
gotoAndPlay (145);
}
on (rollOut) {
gotoAndPlay (135);
}
on (release) {
gotoAndPlay (160);
}
on (press) {
a = "1";
}
on (release) {
if (a == 1) {
setProperty ("_root.introtext", _visible, false);
}
}


I have some other stuff to play diffrent frames for diffrent features. but the Vis does not change on the graphic?? Any suggestions?? There is no code on the graphic telling it to appear, rather I just started it 100% vis on a frame... What am i doing wrong?

View Replies !    View Related
Visibility
I am trying to make a MC visable when i mouse over a button and inVis when i move out. I have that working, but how do I go about resetting the MC to frame one?? Because when I mouse out and the MC is over it stays on the last frame (i have the MC stop() at the end). Is there any way i can reset the MC???

View Replies !    View Related
Set Visibility Of MC's
Hi all

I am having abit of trouble trying to get MC's to be visible at certain stages of the movie. I ahve tried using the '_visible' function to no avail.

Firstly I would like to be able to set the visibility of certain MC's in frame 1.

Next I would like to know how, when clicking on another MC that action could turn on/off the visibility of other MC's.

Any help from you 'gurus' out there would be greatly appreciated. I am using Flash5.

On another matter, to get the above to work do I need to individually name/label the MC's or can I just use the names in the library?

Thanks guys

Len

View Replies !    View Related
Visibility On/off
I am trying to make a button act as a simple switch to make a movie clip visible or not. I have the following code, but it doesnt turn it back on. Why? thanks
Dan


on (press) {
if (_root.red4cupid._visible=true) {
_root.red4cupid._visible = false;
}

else {
_root.red4cupid._visible = true;
}

}

View Replies !    View Related
Visibility
How can I make a button appear/dissappear without having to use
_alpha=100/_alpha=0.
I tried using _visible but it did not work. If I use alpha the button it still there and it can be used.
Can anyone help?


Thank
Tom

View Replies !    View Related
Visibility
Hi all,
I created a big mechine image, all parts in this are a buttons and when cliks any part of machine you will see a popup image of that part in bigger in size.
my quary is how i will hide other popup windows when I click other part of image, giving _visible = false is some what i need to give for all popup window names, rather any easy fuctions are works, how to do this with minimum code.

thanks in advance
wating for replay

View Replies !    View Related
Help, Anyone (Visibility)
Well I am working on a game with mx, it was originally in flash 5, but that should not matter,
this game you are supposed to be able to walk around(I finished that script) and pick up items, now originally, I was going to have it so when you walk over the item it picks it up and goes into your inventory, but my collision test wasn't working, because my code was
onClipEvent(enterFrame){
this._visible=false;
if(keygot==true){
this.visible=true;
}
this was for the clip as the item in the inventory,
now in the actual character that you controlled i had...
onClipEvent(enterFrame){
if(_root.key.hitTest(true){
keygot=true;
}
}

and yes I named the movie clip of the keys instance to 'key'.

Could someone tell me what I am doing wrong? Please?

View Replies !    View Related
Set Visibility
is set visibility flash 4 compatable?

View Replies !    View Related
Set Visibility
Hi all, aint posted for ages but here goes!!

I have 10 geographical maps which I want to be able to set the visibilty of with 10 buttons.

so I have 10 maps one on top of the other.

I have 10 buttons

all maps have instance names of map1 etc..

when I click "button 1" I want "map1" to appear but the button to stay in the over state.

then when I click "button 1" again I want "map1" to disappear and the button to go back to a normal state.

Same goes for the other buttons maps..

Cheers If anyone can help!

David

View Replies !    View Related
Visibility
is there any way to set the visibility of a symbol in actionscript 2?

i was thinking something like test.visible=false;

but it didnt work, can anyone help me with this.

thank you

View Replies !    View Related
Set Visibility
Alrighty, I have tried this 3 ways none works, I know someone can help with this as is it sorta elementary.

On the Main timeline I set one of my MovieClips visibility to false.

Later I want an embedded movie clip to play and at the end set the visibility of the movieclip on the main timeline back to true.

Making it dissappear works fine, it's making the embedded movieclip set the visibility back to true that is failing.


Should be about 1 line of code, maybe 2 but it isn't working.

_root.XX.vsisble = "true"

??

Please help me.

View Replies !    View Related
How Do I Set Visibility
I am working on a navbar. When you click on one of the nav buttons, I want a "window" containing sub-menu options to appear directly beneath it. I am aware that I should place the movie containing the sub-menu under the corresponding nav button and set the visiblity to zero. But what action script do I place in the Nav button's down state to cause the movie containing the sub-menu to appear?

View Replies !    View Related
Visibility
all,

ok I'm struggling with my logic and looking for a little help. I have two movie clips mute and volume when I rollover mute i want volume to be visible...and not visible onRollOut ...(no problem there) but I need to be able to move from mute to volume without loosing visibility essentially I want to do exactly like YouTube does with there volume control and mute button but as soon as my cursor moves off the mute button could someone direct me as to how to accomplish this effect ?

mm

View Replies !    View Related
Visibility
How do I set a button visible to false?

Stage -> ControlsBG -> btnPlay

I have tried all three and none of these work:

ActionScript Code:
stage.controlsBG.btnPlay.visible = false;
Stage.controlsBG.btnPlay.visible = false;
stage.btnPlay.visible = false;

View Replies !    View Related
Visibility
I bild a page in flash8 proffesional and some people who doesnt have the flash player 8 doesnt see the appearence of my buttons.
How to make a proper publish setting that It works without instal flash playeru8.
I have allready tryed to change the publish settings in to flash5 bu It says wont be possibile cause of action script 2.
So what would be the best solution,shoul I build a special button with download flash player8? If yes How do I build button which can download the flash player

View Replies !    View Related
Visibility
hi is there a way of having somthing invisable that isnt done by alpha 0 becouse you can still see a faint kinda outline is there like some actionscript for it?

View Replies !    View Related
Visibility
hi is there a way of having somthing invisable that isnt done by alpha 0 becouse you can still see a faint kinda outline is there like some actionscript for it?

View Replies !    View Related
H E L P (mc Visibility)
I have i little problem...

I have movieclip that has to start out being invisible
this._visible = false

- Or something like that
What is the code for changing the visibility of an mc from the start???
PLEASE HELP!!!

View Replies !    View Related
PLEASE HELP Mc Visibility
Hoping for a swift reply on this one guys.....

I need to make a movieclip invisible using the _visible code, and it has to be invisible from the first frame.
How do you script this without using onEvent???
Can you script this without using onEvent????

PLEASE HELP!!!

View Replies !    View Related
Visibility
hey guys,
kinda lost with a problem
say if i want to change the visibility of a button/MC on a clip of a button..
will this do it?

mcButton.onPress = function(){
mcRed1._visible = 0;
}


or do i have to use _alpha, both don't seem to work for me..

Thanks

View Replies !    View Related
Set Visibility Via Asp
I have a MS SQL db with some values in, if a column value is equal to X then i would like to set the visibility of a movieclip to true. How easy would it be to achieve this?

I've set an ASP page that outputs the info from my database in the variable1=value1&variable2=value2 format but do not know how to get this data into flash and use it!

Are there any tutorials that cover this, as I'm new to using Flash & DB and may get easily confused. I've taken a look at the Power of LoadVars Object article, but it doesn't seem to help me

More detail:
I have a table with eg. 20 rows. There would be a movie clip pre-placed within my Flash movie for each row in the database. On getting the data from the database into flash (via asp being on an ms platform) the movie clips are not by default visible, only those whose corresponding column is X will then become visible.

View Replies !    View Related
Visibility
I have an MC called Port,
When I add this code to it:
_root._visibility=false
even though the MC is on a different layer,
the whole document become not seen.

Can any help me with my not so could syntax

thanks in advance
sephers181

View Replies !    View Related
Problems With Visibility
Hi,

something troubleing me:

I have three movie clips:

1) sound.swf, which has in the first frame a preloader with the folowing
action:
if (_framesloaded) {
gotoAndPlay (2);
tellTarget ("_level2.muska") {
_visible = true;
}
} else {
gotoAndPlay (1);
}

and in the second frame the actual music.

2) first.swf, which is the first page, that has on the first frame a
preloader and on the second the contents plus a hole in the background (to
see the preloader of sound.swf). Than in the same frame (2) i have a
movieclip called "music" that includes a button (for music on/off) and fills
the hole in the background (positioned in the same place). This is set to:

onClipEvent (load) {
_visible = false;
}

3) menu.swf, which loads sound.swf into _level1 and first.swf into _level2

So, the idea is to have the page loaded in the following sequence: first the
menu, than the first page, which in the hole in the backgroudn displays the
preloader of the sound.swf and then, when music is loaded, it starts playing
and the button for on/off appears.
Everything works as it should except the button doesn't show... any ideas
why?

Thanks, matej

View Replies !    View Related
Thanx For The Help With Toggling Visibility
ok guys

Thanx for your suggestions on scripting for toggling the visibility of a movieclip, after playing around for a while I came up with this script which works pefectly:

on (release) {
if (_level0.roads._visible eq true) {
setProperty (_level0.roads, _visible, false);
} else {
setProperty (_level0.roads, _visible, true);
}
}
Nice One!

Simon

View Replies !    View Related
Visibility Problem
Is it possible for when a button on the main stage is pressed to have an action on that button that targets a clip on the main stage that has had it's visibility set to false, And have the button action set the clip's visibility to true and then go play a frame in that clip?

Meaning a movie clip is on the stage but invisible until a button is pressed outside the clip and told to go play a frame in the clip and then when it is done playing the frame have a stop action and another action setting it's visibility back to false. Is this possible? If so could someone please explain to me how this is done. I would so appreciate any help. Thanks all.

Mike

View Replies !    View Related
Mouseover Visibility
Hello there. I started using Flash yesterday to create a flowchart that a user can follow through by clicking on the process boxes to lead to the next process/desicion etc...

All that works fine, but i want information to be displayed about each process in a box that fades into view when the user rolls the mouse pointer over the process. can anyone tell me how to do this please?

Thank you.

View Replies !    View Related
Visibility Question
i am trying to get a movie clip to change from visible to non-visible. heres the scenerio:

i have a button, a movie clip and a dynamic text box.
every time the button is pressed , variable 'a' has 1 added to it
i want the movie clip named 'b' to be visible all the time except when a=3.
the dynamic text is only to show what variable a is equal to.

this is the script i used on the movie clip (this action script is attached to the movie clip)

{if a = 3
this.visible = false
}
{if a = 4
this.visible = true
}

but when i run the movie, the movie is never visible at any value of 'a'

whats wrong?

i would apreciate any help. thanks

View Replies !    View Related
Problem With Visibility...
Here is the scoop... I have the code below attached to a button on my stage... It displays a graphic that is draggable.. my problem is that it seems to "stick" after trying to roll off. It's very finicky, I want it to go away if you drag off the button but again it's finicky.

on (rollOver) {
standings_b._visible = true;
startDrag ("standings_b", true, 11, 36, 60, 43);
}
on (rollOut) {
stopDrag ();
standings_b._visible = false;
}

[Edited by nollieflip on 03-08-2002 at 06:21 PM]

View Replies !    View Related
Checking For Visibility - How?
I am trying to make a menu-like thing.
There is a button I am using to show/hide another object.
And that is where the problem is.

How do you check if an object is visible?
Might sound like a dumb question but I am stumped.
No matter what I put, it just seems to ignore the condition.

Thank you for your time~

View Replies !    View Related
Visibility Of Layers
Hi there,

is is possible to put an action on a button which indicates that a layer has to become (in)visible?

View Replies !    View Related
Visibility Button
Ok i want a visibility button but heres my problem i have 3 MC's two of them are text and the other is a mouse trailer i want when you press the button its makes one of the text disppear and the other appear then the circle appear and when you press it again it disappears but whats happening is its going over both of the if statements and there canceling each other out so i tried to make it work in a twisted sort of way maybe you can help me
thanx in advance

[code]
on (release) {
if (ball._visible=true) {
_root.a = 1;
}
if (ball._visible=false) {
_root.a = 2;
}
if (_root.a=1) {
ball._visible = false;
turnoff._visible = false;
turnon._visible = true;
}
if (_root.a=2) {
ball._visible = true;
turnoff._visible = true;
turnon._visible = false;
}
}
[code/]

View Replies !    View Related
SetProperty Visibility Help
help me please!

i need to learn how you use the setProperty+visibility stuff to make the contents of a layer be visible, and invisible, with a click of a button?

please point me with specific instructions or a tutorial.....

PLEASE HELP ME! I WILL WORSHIP ANYONE THAT HELPS ME

View Replies !    View Related
Buttons And Visibility
I have a button and a image symbol that I want to make appear/dissappear (toggle) depending on the actions performed by the user. I just can't figure out how to do this.

thanks

View Replies !    View Related
SetProperty Visibility....
Hi,
I am trying to load a scene with buttons at the top of the page. Attached to each button is a movieclip that I would like to appear when you press the button. I am trying to do this using the visibility option for the setProperty. Unfortunately this doesn't seem to be working for me...

This is the code I am using when the page first opens:

stop ();
setProperty ("text", _visible, "true");
setProperty ("bass", _visible, "false");
setProperty ("piano", _visible, "false");
setProperty ("drum", _visible, "false");
setProperty ("trumpet", _visible, "false");
setProperty ("sax", _visible, "false");


Is this wrong? Can someone please help?

Thanks!

View Replies !    View Related
HHHeelllpp Me With Visibility
I'm having real problems with the _visible property of a movie clip.
I just can't modify it

the stage is made of a blue circle (clip)
and a premade button

here's the code i've been writting on the button

on (release) {
_root.btntest._alpha = "30";
}

and it just doesn't want to work
Can anybody help me ??

View Replies !    View Related
Visibility Problem
thanx but i figured it out now I have another prob...i want to write is the visibility of somthing 100 then goto "this" flame numkber

how would i write that in code.

Thanx in advance

View Replies !    View Related
Too Many Calculations And Visibility
I'm working on a 3D application with a bunch of calculations. Some of those calculations are manipulating objects that are off of the stage. All those calculations make it very slow on below average computers.

My question- Does anyone know if I set the visibility to 0 of an object that is being manipulated by actionscript does the actionscript still manipulate the object even though is isn't visible?

What about masking it? If the object is not under the mask are the calculations still taking place?

Any other suggestions on how to eliminate the math being performed on objects off stage. I know that I could probably just check the x&y coordinates, but I really want to avoid doing that for every item in the movie.

Thanks.

View Replies !    View Related
Visibility Of Aline
Hi
I am having version 5 of Flash.I have drawn a line with a bar at the end.Value of X-axis apears in a text box as I darg the bar across the line.
I want the line to become visible as I drag the bar to the origin and become invisible as I drag it in the opposite direction.What should I do for it without writing code.

View Replies !    View Related
Reseting Visibility
i have 2 movieclips randomly placed on the x axis moving down the stage. once their y position is greater than 390 i have them return to a random position on the x axis, ok no problem.

but i also have a ball inside of the two movieclips that you hand to the two movieclips walking by. so when you hand it to one of them the ball becomes visible, but i want the ball to be invisible once they restart their path. so i set the visibility to 0 once they leave the stage. now if i try to hand another ball to one of the movieclips the ball wont show up at all.

anyone have any ideas how to fix this problem? if you need a better explanation just ask. Thank You!

View Replies !    View Related
Visibility Probs
I am trying to hide and show a series of movieclips using the visibility function. The clips all have to reside in the same frames (different layers) on the same timeline so that I can preserve user selcted component states. Any suggestions would be greatly appreciated. Also, if anyone knows of an easier way to do this, please tell me.

Thanks

View Replies !    View Related
Visibility Probs
I am trying to hide and show a series of movieclips using the visibility function. The clips all have to reside in the same frames (different layers) on the same timeline so that I can preserve user selcted component states. Any suggestions would be greatly appreciated. Also, if anyone knows of an easier way to do this, please tell me.

Thanks

View Replies !    View Related
Set And Mc's Visibility From A Button
how do i do this

i have a button in the mc and here is the code

Code:
on(press){
this._visible=false;
}
then on the timeline where that mc is i have this code on a button


Code:
on(press){
homewin_mc._visible=true;
}
homewin_mc is the instance name of the targeted mc


it should work but its not working.
any suggestion? bug maybe?

thanks in advance

View Replies !    View Related
Layer Visibility
How do I make a layer invisible, then when the user clicks a button the layer will be visible? Can this be done through actionscript?

thanks

andy

View Replies !    View Related
Sound And Visibility
Hi, can any one direct me to a tutorial or tell me if its possible to switch a movie clip's visibility on and of depending on whether a particular sound is being played?

Or more simply put how can a movie clip check if a sound is being played or not?

thanks.

View Replies !    View Related
Visibility Via Actionscript..
I have a symbol, gauge_mc

on the main timeline i have the script:
gauge_mc._visible = false;

when I play the movie the symbol is still there
there is also a button which makes the symbol invisible (or is supposed to) via gauge_mc._visible=true;
gauge_mc.gotoAndPlay(2);
As it is an animated symbol, the last frame contains the action _root.gauge_mc._visible = false;

is there any reason why none of these visibility settings work?

View Replies !    View Related
Visibility Issues
I have an empty movie clip called target and am loading my movie movie.swf into it.
The ActionScript looks something like this:
loadMovie ("movie.swf", "_root.target");

Now changing visibilty of the whole movie works fine, etc. with
setProperty ("_root.target", _visible, "0");

But inside of movie.swf I have a movie called button (Instancename button) which I want to swich on and off. Doing so in movie.swf works fine, but is there a command to swich it off (=set visibility to 0) while loading it?
I was thinking of:
loadMovie ("movie.swf", "_root.target");
setProperty ("_root.target.button", _visible, "0");
but this does not work! No matter what form of addressing "button" I use, it just will not turn invisible.

So maybe it’s not possible to load a movie and change parameters within it at the same time? Please somebody give me an answer!

View Replies !    View Related
Changing Visibility
i have a movieclip that moves from left to right on the screen. I want it to change the visibility of something in the main timeline when it reaches the right side of the screen. Right now i have:

if (this._x>=550) {

back = math.round(math.random()*3);

if (back=0) {
_root.back0._visible = true;
_root.back1._visible = false;
_root.back2._visible = false;
_root.back3._visible = false;
}
else if (back=1) {
_root.back0._visible = false;
_root.back1._visible = true;
_root.back2._visible = false;
_root.back3._visible = false;
}
else if (back=2) {
_root.back0._visible = false;
_root.back1._visible = false;
_root.back2._visible = true;
_root.back3._visible = false;
}
else if (back=3) {
_root.back0._visible = false;
_root.back1._visible = false;
_root.back2._visible = false;
_root.back3._visible = true;
}
and a bunch of other stuff....
When i trace the visibility of the movieclips, they are changing, but when i test the movie, back1 shows and that's it, it never goes away and nothing else appears or disappears...

View Replies !    View Related
Visibility Problem
Could anyone be kind enough to let me know why my text disappears in this fla file? And perhaps suggest a fix?

View Replies !    View Related
Layer Visibility Help
Is there a way to make one layer jump in front of other layers when the mouse is over on object on that layer? I have five buttons, on mouse over, the movie in the "over" part of the button plays and the image grows in size. I want the button to move to the front of the other buttons while the mouse is over it. Is that possible?

Any help you can offer would be greatly appreciated.

View Replies !    View Related
Visibility Problem
I have this AS on a button which makes a mc visible.

on (rollOver) {
_root.arrowup._visible = 1;
}


Is there any AS that could make this mc gradually 'alpha/fade' up from 0 to 100%
with acceleration/inertia? rather than it either being visible or invisible.


thanks

View Replies !    View Related
Visibility Problem
Hi

I use InstanceName._visible = false; on a seperate layer, but as it seems, my MC becomes visible again, whenever there is a key frame on any other layer. The same goes to _alpha=0 and removeMovieClip().

Is there any other way to hide an object without repeating the code on each new key frame?


Thanks in advance

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved