Changing The _visible Property Of A Symbol
As above, how do I set & change the visible propery of a symbol?
The only reference to visibility I could find was under properties in the actionscript menu.
FlashKit > Flash Help > Flash ActionScript
Posted on: 08-23-2001, 01:48 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
_visible Property?
In my main timeline i have a movie clip instance called "menu_mc" that consists of 4 buttons that animate. So when i first load the my swf or whatever i want it so 3 of the 4 buttons dont show. I tried going "_root.menu_mc.buttonName._visible=false; but it doesnt seem to work. Am i doing something wrong or what? plz help thanks!!
[F8]using _visible Property
I'm creating a standalone .exe file in Flash. Instead of loading external swf's (the whole file needs to be completely self-contained if possible) I'm trying to use the _visible property to turn a slide show on and off. However, when I assign a "_visible = true" property to a button, the movie only stays visible for one frame then blinks off again.
Complicating this somewhat is that I'm using a scroll pane component. The button which turns on the _visible property is inside the scrolling content, and the slide show plays on a layer in front of the scroll panel. So the end result I'm looking for is being able to make the slide show visible from inside the scrolling content, then turning it off again with a button that is either inside the slide show or a separate mc.
Thanks for any help!
Gerry
_visible Property
I am loading external swfs as my webpages, but when i roll over them and go over a location where i have buttons on my homepage behind the external swf i still get the little hand pointer, but there is no button in the swf just on the homepage(parent swf) behind it. I thought of trying to make the buttons not visible when i load an external swf but that was no help because then they go away before the page is loaded. Is there an alternative to this problem. Please Help!
Help With Text._visible Property
In my movie when I get to a certian key frame I want to make 2 text fields that are in the next frame invisible. But I don't seem to understand the syntax correctly.
Would not do something like this in the keyframe before you get to the frame with the text? I need to control it from one frame ahead.
Code:
evelutionText1._visible=false;
evelutionText2._visible=false;
Problem With _visible Property
i got this as error
**Error** Symbol=Clock, layer=a, frame=1:Line 6: Syntax error.
clock_mc.0_mc._visible =false
this is the code
clock_mc.0_mc._visible =false
0_mc is a movie clip that is inside clock_mc, another clip, WHATS WRONG :S this is driving me crazy
Please Explain _visible Property...
Can someone please explain how the _visible property works and how I can use it with loading external movies into my main.swf...
I have 3 movies loading into my main and I want to hide two of the movies until my main movie is preloaded. I am using a preloader for the main movie but I don't need it for the other two movies...
Any help is appreciated.
Help With _visible Property Onload...
Hi All,
I'm hoping someone can help me with this... I have 2 EXTERNAL movies being loaded with initial load of my site into my main.swf, one of which (movingbg.swf) is being loaded with a preloader. The problem is that my other movie (menubar.swf) is loaded before my first movie. I think I should use the _visible property to solve this and here is what I have so far...
On second.swf I have:
onClipEvent (load)
{
_y;
_y = 0;
this._visible = false;
}
On my preloader located in my main I have:
this.onEnterFrame = function ()
{
var _l1 = _root;
percent = _l1.empty.percent;
if (_l1.empty.percent == 100)
{
_l1.menubar._visible = true;
this._visible = false;
} // end if
};
I am stuck because I have no idea what to use in the first frame of my main movie. I think I am on the right track here... please let me know if I am not.
Any help is greatly appreciated.
Question On The _visible Property
As in, I want to load up a bunch of jpegs, but not display them on the stage.
Is there a way to load jpegs and swfs, into the library, and not even worry about killing their visibility on the stage?
thanks
Property Assignments Etc. Ignored (_visible And SwapDepths Mainly)
Hi!
I have a lot of functions which are called in an onClipEvent(enterFrame) based on a lot of boolean variables. One of the functions sets ._visible = true and .swapDepths(nDepth)
on a clip, but it doesnt happen. if I try to trace the ._visible property, it's true, but in the debugger it's still false. the clip doesn't show either. I even tried to call ONLY .swapDepths in one frame, but this results in some random behavior.
Seems like only 60% of my new settings is applied, but all of the code is correct. (believe me, I'm not green)
Is there some rules not described by Macromedia for those properties and methods? Like "this action must be executed in a frame for iteself".
I haven't found anything in the documentation.
please help!!
bonghead
_visible Property Not Displaying Correctly
I have a problem with programming a simple Memeroy game, where you have to find pairs. Only two cards can be revealed at a time. If it is a pair they will stay visible, if not they should be turned again after waiting some seconds. The pictures are the underlaying layer, the backside of the cards are in movieclips of which the visible property is changed and invisible buttons on top trigger the thing.
The SWF can be viewed at http://www.mhofele.de/Memory3.swf
The code should be fine, because all the trace prompts are correct, but somehow I can't see the visibility changing on the second cards. Can someone see what is wrong with it?
Here's the code of the buttons. (There is only a global variable in the framescript, no other scripts)
Code:
on (release) {
trace ("Beginn");
if (A2._visible == true) { // this script is only doing something, when card was not revealed
trace ("card is not yet revealed");
// 1. Click
if (aufgedeckt < 1) {
trace ("1. Click");
A2._visible = false; // reveal card
aufgedeckt++;
trace ("Variable 'aufgedeckt' was increased by 1");
k = A2;
trace ("movieclip is saved in global Variable k");
trace ("k = " + k);
}
// 2. Klick
else {
trace ("2. Click");
trace ("reveal card");
setProperty("A2", _visible, false); // reveal card
trace (" is partnercard already revealed?");
if (D2._visible == false) { // if partnercard (pair) is revealed
aufgedeckt = 0;
trace (" Card was already revealed, var 'aufgedeckt' is set to 0");
}
else { //if 1. Click was not the partnercard: wait and then turn the cards
//Timer
trace ("Timer for waiting: wait 3 seconds");
x = getTimer()/1000;
y = x+3;
while ((getTimer()/1000) < y){
trace ("Timerstart:" +x +"Timer plus 3 seconds" +y);
setProperty("A2", _visible, false); // Karte aufdecken
}
trace ("Timer finished, now turn cards again");
trace ("turn this card");
setProperty("A2", _visible, true);
trace ("now turn the card that was revealed first");
trace (" What is in k? " + k);
setProperty ("k", _visible, true);
aufgedeckt = 0;
trace ("cards are turned and 'aufgedeckt' was set back to 0");
}
}
}
}
[Edited by MoniH on 05-25-2002 at 05:28 AM]
Looping And Setting _visible Property
Hi everyone, I've been a lurker for awhile, but now I'm stuck myself.
I'm basically trying to load a given number of .swfs into new mc's and then turn the _visible = false but it's not working. I think I'm reference the mc's correctly since the positioning is working...here's the code. And it is getting in the if..then statemement. THe movies are loading and positioning, just not hiding. Thanks!
PHP Code:
for (x= 1; x <= maxSlide; x++) {
var sName = "slide" + x;
this.createEmptyMovieClip(sName,x+1);
this[sName]._x=0;
this[sName]._y=50;
var sPath = "content/" + sName + ".swf";
trace (sName + ", " + sPath);
if (x>1) {
trace ("in loop, " + sName);
this[sName]._visible = false;
}
loadMovie(sPath,sName);
}
CreateEmptyMovieClip() And Setting _visible Property
I am attempting to create a series of empty MCs, load an external .jpg into each created MC and then make the MCs invisible so I can have my way with them later in the file.
My code is as follows:
Code:
var slideCount = 1;
while (slideCount<=6) {
createEmptyMovieClip("slide"+slideCount, slideCount);
loadMovie("img/img"+slideCount+".jpg", "slide"+slideCount);
setProperty("slide"+slideCount, _visible, false);
slideCount++;
}
The creating and the loading are working fine. But it seems it is not possible for me to set the _visible property of the created movie to false. Strangely, any other property I attempt to manipulate this same way (_alpha, _x, _xscale, everything else I've tried) works. But not _visible. I've even tried using direct references in later frames to make these created clips invisible and it's not working.
What am I missing here? So baffled.
._visible Property True...only For Several Seconds?
Hi everyone,
I'm wondering if there is a way to make a movie clip only visible for several seconds. Instead of saying
Code:
this._visible = true;
Is there a way that "true" could be replaced with the amount of seconds somehow?
Thanks for any advice here.
Brian
_visible Property Resets After Scene Redraws
Hi,
I have a button on a scene. I make it invisible onrelease and goto a different scene. When I come back it is visible again.
What can I do besides not leave the current scene?
_name Property Changing But Not Changing
I am working on an application where a user can select a movieclip that has been dynamically placed on the stage and then choose Send to Front or Send to Back (compared to the other objects on the stage with it).
As part of this process I am renaming the instances using code that basically looks like this: setProperty(myMovieClip, _name, newMovieClipName);
Using the debugger I noticed something unusual. In the properties tab the _name property changes to the newMovieClipName value I am assigning it. But the target it shows remains unchanged (_level0.container_mc.myOldMovieClipName).
I think this is causing problems elsewhere when I try to target these movie clips. Does anyone know how to completely change an instance's name, or is this just the way it works? Any insights are appreciated.
Does "_visible" Property Really Invisible?
A simple Question!
I have a movieClip with a lot of tweens... When I set the "_visible" property to FALSE, does my movieClip still running for my CPU??? Does my CPU still calculate the tweens of my Mc???
Thank's for lightning me???
???
Symbol Changing Into Different Symbol
When I drag a symbol onto the Stage from the Library, I am getting a weird result.
If the location (on the Timeline) is a keyframe directly after a keyframe which contains Symbol X then the Symbol I was dragging turns into Symbol X!
If I separate the two keyframes with some empty Timeline, I can put an instance of the new Symbol on the Stage just fine.... but if I drag the keyframe back to the frame right after Symbol X, it turns the new symbol into X!!!
What's up with that??!
Gradual Property Changing
What is the most elegant way to make a property of a movieclip gradualy change? Is it making a new movieclip named "timer" with a few frames and in each one is a setProperty() that changes the wanted target? Is there a more elegant way?
I want to make a movieclip of my choice change it's alpha from 100 to 0 but without that object having more frames.Can I do that without a new movieclip? Hmm, it sounds quite nice talking about it.. that could be the nicest way. But allways striving for perfection. I hope I spelled all this correctly..
Duplicating And Changing Property
hello..
i am working on a small puppet type applet for children.
The puppets are individual movieclips with limited animation that can be controlled by key board input. say move hands or rotate body. Now i want a movie clip to get duplicated in to a plane graphic ( almost like a snapshot of the movieclip at that particular time. say, hands moved up) by a mouse/keyboard event. This should be a stand alone graphic symbol with a different name. I would change the properties of the parent movie clip later but those changes shouldnt occur for the duplicated symbol.
Please help me out.. thanks
anand.
Duplicating And Changing Property
hello..
i am working on a small puppet type applet for children.
The puppets are individual movieclips with limited animation that can be controlled by key board input. say move hands or rotate body. Now i want a movie clip to get duplicated in to a plane graphic ( almost like a snapshot of the movieclip at that particular time. say, hands moved up) by a mouse/keyboard event. This should be a stand alone graphic symbol with a different name. I would change the properties of the parent movie clip later but those changes shouldnt occur for the duplicated symbol.
Please help me out.. thanks
anand.
Changing _alpha Property Of A Sybol
Alright, i have a button, that would change the background, but the button, is part of a movieClip, and i set the background to a symbol(outside of that movie), i'd like to use _alpha method to make it visible once you click on it, and i medenge to do that as long as the button is not part of a MovieClip. Any one can help me out? How can i set a ClickOn to change a proparty of a particular symbol?
Thanks all
Changing .text Property From Eventhandler
Code:
var FacilityPassListener = new Object();
LName.addEventListener("focusIn", LNameListener);
LNameListener.handleEvent = function(eventObj) {
trace("listener is LNameListener"); //as expected
if (eventObj.name == "focusIn"){
login_mc.myText._y = row2; //no change
login_mc.myText.text = "enter name."; //no change
}
I'm able to fire the correct event via the inputtext control (LName) but I can't get the code inside the handler to control the text field.
I've reviewed notes on the delegate class but that doesn't appear to apply to this situation. Or does it?
Changing An Object Property With It's String Name?
If I have the full path name of an object like:
var1 = "parentObject.firstChild.secondChild";
and I want to change the value:
parentObject.firstChild.secondChild.price
How can I do this with access ONLY to the string variable var1?
My situation is more complicated than given above... but essentially it's the problem given above, where I only have access to the string variable.
I've tried something like:
this[var1].price
But that doesn't work.
I can get access to the variable with eval(var1 + price)... but with the rules of the use of eval changed from Flash5, I can't use this.
Any ideas?
Does anyone understand my mad problem?
Any help would be appreciated.
Thanks.
OM
Changing Text Property Using Script
I'm using 3D Flash Animator. I have an action where I need to change the "text" property of a text element. The problem is the .text property is not changable. I can trace and see the correct output (Example: my element is Text10, the following code outputs the correct value...
Trace(element("Text10").text)
outputs 11 (my original text)
Trace(getDate())
outputs 31 (todays date)
I can use following without errors:
element("Text10").text = getDate()
element("Text10").show()
My element shows, but it's still 11
I need to display and change the current date and it's not feasable to have 31 elements to do this.
ARGH!!!!!!!!!!!!!!!!!!!!!!!!!!
HELP!!!!!!!!!!!!!!!!!!!!!!
my email is webmaster@jerseythings.com
Also, where do I report bugs in 3D Flash Animator?
Thanks in advance.
Scaling And Changing Property Size
I currently created an exe file to run on C/D for class that is 1024 by 768. Now I would like to scale the main movie and all the movies loading into the main movie to 800 by 600. Is their a way to reduce the size (scaling down) everything on the main timeline and then reduce the property size so that I do not have to go to each element in each layer?
Thank you,
Ruth
Changing Property Values From Within A Function
I'm wondering how I can change a property of an instance from within a function inside a method. I have some code here... Basically I just need to set _lynn_idle to false when a tween is occuring and _lynn_idle to true when the tween is finished. Unfortunately I can't seem to simply set it to false or true inside these listener functions like I'm able to anywhere else (seems the variable is only local to the function when I need it to access the variable associated with the instance). Any help is much appreciated.
Attach Code
private var _lynn_idle:Boolean;
public function moveToTile(tilecoord:Array):Void {
// move lynn with a tween
var startx:Number = _lynnmc._x;
var starty:Number = _lynnmc._y;
var endx:Number = (30*tilecoord[0])+(30*tilecoord[1]);
var endy:Number = 15*(tilecoord[0]-tilecoord[1]);
// determine how long the tween should take
var movedur:Number = 12;
var moveListener:Object = new Object();
moveListener.onMotionChanged = function():Void {
_lynn_idle = false;
// check depths of props and swap
}
moveListener.onMotionFinished = function():Void {
_lynn_idle = true;
// rebuild floor
_lynn_pos = tilecoord;
_global.room.newFloor();
// doAc() to props
}
var moveLynnx:Tween = new Tween(_lynnmc, "_x", Regular.easeInOut, startx, endx, movedur, false);
var moveLynny:Tween = new Tween(_lynnmc, "_y", Regular.easeInOut, starty, endy, movedur, false);
moveLynnx.addListener(moveListener);
}
Changing Property Values From Within A Function
I'm wondering how I can change a property of an instance from within a function inside a method. I have some code here... Basically I just need to set _lynn_idle to false when a tween is occuring and _lynn_idle to true when the tween is finished. Unfortunately I can't seem to simply set it to false or true inside these listener functions like I'm able to anywhere else (seems the variable is only local to the function when I need it to access the variable associated with the instance). Any help is much appreciated.
Attach Code
private var _lynn_idle:Boolean;
public function moveToTile(tilecoord:Array):Void {
// move lynn with a tween
var startx:Number = _lynnmc._x;
var starty:Number = _lynnmc._y;
var endx:Number = (30*tilecoord[0])+(30*tilecoord[1]);
var endy:Number = 15*(tilecoord[0]-tilecoord[1]);
// determine how long the tween should take
var movedur:Number = 12;
var moveListener:Object = new Object();
moveListener.onMotionChanged = function():Void {
_lynn_idle = false;
// check depths of props and swap
}
moveListener.onMotionFinished = function():Void {
_lynn_idle = true;
// rebuild floor
_lynn_pos = tilecoord;
_global.room.newFloor();
// doAc() to props
}
var moveLynnx:Tween = new Tween(_lynnmc, "_x", Regular.easeInOut, startx, endx, movedur, false);
var moveLynny:Tween = new Tween(_lynnmc, "_y", Regular.easeInOut, starty, endy, movedur, false);
moveLynnx.addListener(moveListener);
}
Changing SelectedIndex Property Of Combobox From XML
I have a combobox that holds the states as data. I am returning XML that shows the states in the two letter abbreviation (ex. MN), I need to be able to update the combobox based on the XML returned data. Any ideas on how to implement this?
ActionScript Code:
<mx:FormItem label="State: ">
<mx:ComboBox id="stateCombobox" dataProvider="{statesList.state}" prompt="Select a State" selectedIndex="-1" change="validateForm(event);"/>
</mx:FormItem>
<state label="Minnesota" data="MN"/>
XML:
<User>
<State>MN</State>
</User>
Changing An Object Property With It's String Name?
If I have the full path name of an object like:
var1 = "parentObject.firstChild.secondChild";
and I want to change the value:
parentObject.firstChild.secondChild.price
How can I do this with access ONLY to the string variable var1?
My situation is more complicated than given above... but essentially it's the problem given above, where I only have access to the string variable.
I've tried something like:
this[var1].price
But that doesn't work.
I can get access to the variable with eval(var1 + price)... but with the rules of the use of eval changed from Flash5, I can't use this.
Any ideas?
Does anyone understand my mad problem?
Any help would be appreciated.
Thanks.
OM
Changing .exe Flash Symbol?
Hi, I have seen this done before, but I don't know how they did it. When you export a flash MC to an EXE file, it has that brite pink sun spot thingie, can you change it to, say, a symbol of your own choosing? If so, how?
-Kevin
AS: Changing Symbol Behavior
Hey there,
I was wondering if there is a way of changing an instance behavior via ActionScript. Just that
Cërf.
Changing The Alpha Of A Symbol Using As
hi there
Im trying to change the alpha of a button gradually
ie. when one button is clicked all other buttons goto %50.
Is this possible to do with using mc's.
I new to this and any help would be much appreciated.
thank you
MX|changing Symbol And All Instances Of It
Is there a command that changes every instance of a movieclip at once, no matter where the instance of the clip is in the main movie? Or a command that changes the (library) symbol, so that all the instances change along with it.
I want to do something like Mymovieclip.gotoAndStop but all the instances have to be affected by it...
Please help!
Thanks!!!
Changing Symbol In Instance
I've got a movieclip-symbol (called "white_border") wich has the instance "changer".
When I click on a button I want another movieclip-symbol (called "blue_border") in place of "white_border" to play but still with the same instance.
blue_border has the same hight and weidth as white_border and has to be on the same position as white_border is on the stage.
Can someone help me ? plssssss :$
Changing A Symbol/mc By Clicking... How?
Hi!
I want to make a symbol inside a movieclip change when the user clicks on a button.
This symbol is actually another movieclip with an animation. Since I'd have to make 20 animations, one for every option, I guess I rather do just one and its content could change as a variable is changed by one of 20 single buttons.
Can anyone show me a script to make it possible?
[I hope to have made myself understandable]
Thanx!
Changing Alpha On A Symbol
I am trying to create a symbol and over the course of several frames have it go from 0 alpha to 100. Shouldn't be hard, or so I thought. I am doing the following:
Open a new document, by default there is a keyframe in frame 1;
Then I Draw a Box and convert it to a graphic symbol;
I then go to frame ten and enter a keyframe;
I confirm that in frame 10 that the alpha in the color panel is set to 100;
I then add a motion tween;
I then go to frame 1 to change the alpha to 0 but when I do, it changes the alpha for the symbol in both key frames.
If someone could tell me what I am doing incorrectly, I would be very appreciative.
Thanks,
Andy
Changing Symbol On The Same Layer...
hello everyone, i am doing this flash site and i have done an animation with one symbol and i want to do exactly the same animation but just with a different symbol and so on the same layer with using a different rollover button to change the symbol. is it possible cos i just can't figure it out
Changing Symbol On The Same Layer...
hello everyone, i am doing this flash site and i have done an animation with one symbol and i want to do exactly the same animation but just with a different symbol and so on the same layer with using a different rollover button to change the symbol. is it possible cos i just can't figure it out
Changing The Alpha Of A Property When Clicking A Button
I have this code in AS 3.0:
stop();
myBtn.buttonMode = true;
myText_mc.alpha = 0;
myBtn.addEventListener(MouseEvent.CLICK, ClickFunction);
function ClickFunction(event:MouseEvent):void{
myText_mc.alpha = 1;
}
I want the alpha of the movieclip called myText_mc to start at 0 (not seen) and then appear when clicked...it does not work, what did I do wrong?
Thanks
Changing The Visibility Of A Symbol With A Button...
okay... I'm new to actionscripting... so work with me. I'm just playing around with some buttons and I want to get a symbol to disappear when a button is pressed an to reappear when a different button is pressed. I've read in some books about this type of thing, but I was reading these at Barnes and Noble and had no money to purchase them.
Help Changing Color Of A Symbol Dynamically
Hello,
I have a situation that I need a bit of help on creating a dynamically colored box in Flash MX...here's the scenario...
1. I created a movie clip (it just a basic black rectangle)
2. I gave the movie clip a variable name of 'bground'
What I want to do is to be able to change that color (#000000) of the movie-clip to another...say red for instance (#CC0000), dynamically...
It will be done through an XML file actually (probably through an admin on the final version), but if I could get some sort of basic code help on getting me started, that would be great...
Thanks much...
Seanc
Changing Size Of Symbol Instance
How do you control the size of a symbol instance with scripting? If you can just point me to a tutorial or something, that's fine.
Thanks in advance..
Changing An Instance Symbol Dynamically
I'm creating a preview window for a flash I'm working on, and I have several animation that I would like to show up in the preview window based on what button you pressed. I can't figure out a way to make a single instance of a movieclip, then change what movieclip it is displaying at run time. I think I can do it by attaching the movie clip to root, then deleting it and creating the new one. However, I don't want to have to delete & recreate a clip each time they press a button, I just want it to dynamically swap to a different clip, is this possible?
Changing All Symbol Instances Together Dynamically
Hello,
I want to change all the instances of a certain symbol on the stage at one time. Possibly fading them to a new colour or even changing the alpha values of all of them at once. Does anyone know how I can do this using actionscript?
Thanks,
Cronus
Stumped On Changing Text In A Symbol.
I am having a problem figuring out how to have text in a symbol changed using actionscript. I have a small animation that shows a name and fades out. That is working great, but I need to repeat this process with 19 different names.
Should I use a .txt file to store the names? And if I were to do this how would I set up the text file so that it will only grab one name at a time instead of the entire list?
Any help is appreciated, beacause I am just diving into actionscripting and have managed to stump myself on my first attempt to try it.
|