._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
DevShed > Flash Help
Posted on: July 7th, 2004, 12:28 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
_visible = True/false ?
i'm making a fps where u have 2 shoot the enemy more than once 2 kill em. the way i did this was to make a movie clip of him and everytime tha button over the clip was pressed (shot), it would go2 the next frame with a different pic of the enemy (one of him w/ a bullet in his head). i also wanted to put a health bar over each enemy so u culd c how may more times u wuld have 2 shoot him 2 have him dead. but after i put them in the whole screen was 2 crowded. so now my idea was 2 only show the health of the enemy that ur mouse was over. what i did was to put in the health bars code(movie clip):
Onclipevent (load) {
_visible = false;
}
In the button that tell the enemy to advance 2 the next frame, i put the code(ehealth = enemy health bar{instance name}):
On (rollOver) {
ehealth = _visible = "true"
}
but that didnt work. then i tried:
On (rollOver) {
var ehealth
_visible = "true"
}
didnt work either
i'm confused about it. i know i have to use set variable 2 change the visiblity from false to true, but i cant figure owt how 2 tell (in the code) what thing 2 turn from false to true. ?? does anyone know how to solve this ??
If (_parent.MC._visible = True)
Does this code make any sense:
code:
on (rollOver,release,releaseOutside) {
if(_root.bczoom.BCcities.Kirkstone._visible = true){
_parent._parent.upscroll.up.gotoAndPlay(flashing);
}
}
I have the movie clip Kirkstone scroll under a mask. If it is under the mask, does that mean Kirkstone._visible = false?
I'm not sure I understand _visible. Thanks in advance for any help.
Help - On (rollOver) _visible = True;
I'm trying to get this actionscript to work properly.
on (rollOver) {
test._visible = true;
}
on (rollOut) {
test._visible = false;
}
currently the "test" MC shows up when the .SWF opens, and when I
'on (rollOver)' it then will disappear and then reappear on (rollOver).
How can I can get the "Test" MC to only show up 'on (rollOver) {'
"test" MC resides inside of another MC, 'photo" also in 'photo' MC is the button that triggers 'on (rollOver) {'
thanks
NYC.
Why _visible=true Does Not Work?
I have an horizontal sliding mc.When the target position is reached, I set the buttons to _visible=false, they are no more useful because the end of slider is reached.But then I want to set them to _visible=true when the slider changes the position back.
Everything works except _visible=true.
Can someone tell me why?
PHP Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
new Tween(mc, "_x", Bounce.easeOut, 1151, 0, 1, true);
var target = 0;
next.onRelease = function() {
target -= 770;
new Tween(mc, "_x", Strong.easeInOut, mc._x, target, 1, true);
if (target == -770) {
this._visible = false;
trace(target)
} else {
this._visible = true;
}
};
prev.onRelease = function() {
target += 770;
new Tween(mc, "_x", Strong.easeInOut, mc._x, target, 1, true);
if (target == 0) {
this._visible = false;
trace(target)
} else {
this._visible = true;
}
};
Mc._visible=true But Still Invisible
Hi,
I have a possible glitch. If I have a movieclip that
has ._visible=false and I change it to _visible while hovering the
mouse over it, it won't appear, but the debugger still says that
_visible=true!!! And if I repeat that process but hover the mouse
somewhere else, it won't appear also which bugs me. BUT! If I start
from fresh and the mouse is NOT hovering over it, it will appear and
if I repeat it and the mouse is hovering over it, it will appear...
STRANGE!
It seems there is some initialization problem there but I can't find
it. If hovered over in the beginning, it will stay hidden all the
time, if not, it will appear even if hovered over... HELL!
Yeah and RollOver and RollOut with onRelease are defined in the first
frame, but the movie has only the first frame.
WTF ???
(Sorry for that quirky explanation, but it's what I get)
_visible = True Listener
Anybody know if I can I make a listener object broadcast a visible event?
Similar to the following:
//TEST BUTTON++++++++++++++++++++++++++++++++++++++++++++++++++++++++//////////////////////////////
var listenerObject:Object = new Object();
listenerObject.myList._visible = true;
function(eventObj:Object) {;
// My code here
controls_LH.mybutton._visible = false;
}
broadcasterObject.addListener(listenerObject);
//OBJECTIVE: if myList.visible=true then hide the button
MyButton._visible = True NOT WORKING
hi,
I have a main.swf that has five buttons to load different external swf.
eg; 'news' button calls the news.swf, 'gallery' button calls galery.swf and so on..
my query is:
when I click on the 'news' button on the main.swf I have the following code:
on (release){
loadMovieNum ("./news.swf", "2");
noticias._visible = false;
}
now..
when it loads it hides the 'news' button which is good, on the external swf that has loaded I have a button that takes you back to the main.swf,
on (release){
unloadMovieNum ("2");
noticias._visible = true;
}
it successfully unloads the movie BUT it does not show the 'news' button.
I have change the 'linkage' propeties of the 'news' button to:
-export for runtime sharing
-export in first frame
URL:./main.swf
your help will be appreciated,
cheers
unisa
[F8] A .swf Inside A .swf _visible = True; Command - Help ?
hi im new to AS and iv got a file called: "index.swf", which contains/loads in a SWF file called "3D.swf". the 3D.swf file has a movieclip inside called "Back_bit_lager_mc"
so iv buttons in "3D.swf" to turn the _visible of the MC - "Back_bit_lager_mc" to ture or false.
when i publish "3D.swf" and run it, it works fine, but the problem is when i run "index.swf" which loads in "3D.swf" the command dosnt work..
im using the AS:
on(release){
_root.Back_bit_lager_mc._visible = true;
}
but how would i edit this to make it work when its in side index.swf ??
Thanks Si
_visible Of All Movieclips On Stage Is True Or False....how?
ok i have a dynamic menu...
when i move over with my mouse the submenus should be visible and when i roll off they should be invisible...
its important because the submenus are dynamicliy named and i dont know how much they are and how many they are....
my question: is there a command that can talk to all movieclips in a timeline or in a parentmovieclip at once...
i thougt about a solution to store alle names in a arry when they containermovieclip is duplicated....but before i want to ask if there is a easyer solution....
thx
Mc._visible=true But Still Invisible (new Stuff Added)
old stuff
{
Hi,
I have a possible glitch. If I have a movieclip that
has ._visible=false and I change it to _visible while hovering the
mouse over it, it won't appear, but the debugger still says that
_visible=true!!! And if I repeat that process but hover the mouse
somewhere else, it won't appear also which bugs me. BUT! If I start
from fresh and the mouse is NOT hovering over it, it will appear and
if I repeat it and the mouse is hovering over it, it will appear...
STRANGE!
It seems there is some initialization problem there but I can't find
it. If hovered over in the beginning, it will stay hidden all the
time, if not, it will appear even if hovered over... HELL!
Yeah and RollOver and RollOut with onRelease are defined in the first
frame, but the movie has only the first frame.
WTF ???
(Sorry for that quirky explanation, but it's what I get)
}
new revelations
{
Right, I found the prob, however it still is a funny one (for me).
That movieclip uses GlowFilter (glow on RollOver) and if it catches RollOver BEFORE being declared visible, it parses some nonsense into filters and messes the visibility up. It still catches events, changes the cursor on RollOver, but stays invisible no matter what.
The import code for GlowFilter resides at frame one (only one frame in that movieclip) along with event declarations, shouldn't it have been executed at the start of application ? Obviously, I don't want that movieclip to be visible at the start, so I set it's ._visible=false at frame 1 of his parent. Does this prevent the code from being executed or what ? Does the codeflow stop at it's parent when told that the child's visibility is false, so the unlucky movieclip never gets initialized ?
Clearly, if RollOver is caught before GlowFilter is imported, the code messes it all up.
I'd welcome any progressive thoughts.
}
_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 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?
Visible Property = True On Frame 100
I have a series of (6) buttons placed directly on the stage that I don't want to see until frame 100, or basically after "100 frames in time" which is when everything on the stage is settled in and done animating. I can't seem to get this seemingly simple task to work. I have an "actions" layer on the first frame with this statement for (1) of the (6) buttons as an example:
btnSoundIsOff.visible = false;
This of course works like a champ, you can't see this button at all. Unfortunately I can't seem to get it to become visible. I tried placing this statement on Frame 100 of the main timeline and realized that it can't possibly work:
btnSoundIsOff.visible = true;
I only have (1) Frame on the main timeline not including a preloader, so of course Frame 100 never gets played. I have also tried adding the visible button statements at frame 100 of my last movie clip animation but then I get run-time errors of undefined this and that. I am not grasping a important fundamental concept of AS3 apparently. I need the buttons to appear after 100 frames and also be able to work. What am I missing? Thank you, I hope I have explained enough of my crisis if not please let me know.
_visible Of Btn/f1 "true" If F30 Played
Hi,
I want to set _visible of a button on frame 1 to true if frame 30 is played, so that when viewers go to frame 30, they'll have the option to come back to frame 1, and then the button becomes visible. If they haven't come to f 30 yet and come back, the button is invisible.
Thanks for your help.
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???
???
Timer Seconds Aren't Seconds On Fast Connection?
On my flash site at
http://www.yogashanti.com
there is a timer which displays my random quotes for arund 20 seconds, but on fast connections woooooah!
How do i resolve this without setting the seconds to a looong length of time (which would mean on dial-up connections each quote will be there forever.
I hope i made it clear what the problem is - sorry if it seems un-clear.
Many thanks in advance
Cesca
How To Start A Sound At X Seconds And Stop At X Seconds?
I'm trying to figure out how I can make the sound file that I load into Flash start at x seconds and end at x+30 seconds.
So basically, I just want a 30 second sample to play starting at a specific time position. Does anyone have any advice on how to do this or have links to somewhere I can read up on it?
As always, thanks for any help
-Ind
Convert Seconds To Minutes:Seconds
Hey guys,
I am currently using the following code to display the secconds of a FLV being played:
ActionScript Code:
time_txt.text = Math.round(_root.video_mc.videoZ.playheadTime*100)/100;
I need to change this to display MM:SS (minutes:seconds) rather than just seconds and decimals.
Any idea how I can do this?
The javascript people here at work suggested something like this:
ActionScript Code:
function strPad(str, places, pad, side) {
while (length(str) < places) {
if (side == "left") str = pad add str;
else str = str add pad;
}
return (str);
}
time_txt.text = Math.floor(_root.video_mc.videoZ.playheadTime / 60) add ":" add strPad(_root.video_mc.videoZ.playheadTime % 60, 2, 0, 'left');
Any help would be lovely.
Thank you!
Scott
If Lalala = True Goto Sing, Else If NE True, Goto Humm
ok, I asked this question about a month ago, I cant find the post though, and I want to go into a little more detail anyways. Using something like if(...) = True to verify a web page, or directory, or even a file. How do you specify that? What is the exact AS for 1. an offline file, and two, a Online Web Page. Like if http://www.dick.net/vagina.htm = True goto sex, else if ne True, goto disney.
Thanxz
(P.S. This is in no way related to my example, i was bored!)
AKA If File Exist
Minutes And Seconds From Seconds
Hi
I have a video player and trying to make a time indicator of minute and seconds.
I got fairly close, however it started to count backwards
Anyone got a script? Thanks
Get Property Visibility Set Property Visibilty
I am trying to work out some navigation on a site to make it more user friendly.
I have a number of buttons which when clicked set their correspoding graphic to visible and all the other relevant graphics to invisible.
This is so I can get the graphics to appear in the same place but only one visible at any time so no overlap.
What I already have is a rollover so that when the user rolls over the buttons the corresponding graphic will appear. Then dissappear on rollout. And the script to place my graphic in the right place and make it visible. Here is the script.
on (rollOver) {
setProperty("_root.drag0", _visible, "1");
setProperty("_root.drag1", _visible, "0");
setProperty("_root.drag2", _visible, "0");
}
on (rollOut) {
setProperty("_root.drag0", _visible, "0");
setProperty("_root.drag1", _visible, "0");
setProperty("_root.drag2", _visible, "0");
}
on (release) {
setProperty ("_root.drag0", _x , 323.4);
setProperty ("_root.drag0", _y , 360);
setProperty("_root.drag0", _visible, "1");
}
The bit I can't work out is how to get the graphic which has last been clicked and locked visible (rather than temporaly visible on rollover/out)to revert to being visible on the rollout of the other buttons.
I think I need to use the get property and set property but can't quite work out how to link the two so that it checks which graphic is visible before the rollover on a different button, makes it invisble on the rollover and reverts it back to being visible on the roll out.
Sorry That was long finding it hard to explain.
Thanks for any help you can offer. I am using flash mx 6.0.
Preloder ScaleX Property And X Property
Hi!
within the loader listener's progressevent I had my preloader mc update the scaleX property and works fine, thus, it moves and scales just like a preloader does until it reaches 100. My only concern is when scaleX updates the preloader mc 'x' location seems to be moving as well making the preloader clip looked liked it scales on both sides (both ends of the line). As i examined the preloader mc 'x' property it stays the same all throughout. This is weird.
anyone?
thank you in advance.
Is This Okay? If(btn.ROLL_OUT==true && Btn2.ROLL_OUT==true){
Is this okay?
Code:
a1.addEventListener(MouseEvent.MOUSE_OVER, mouseOutHandler);
a2.addEventListener(MouseEvent.MOUSE_OVER, mouseOutHandler);
function mouseOutHandler(event:MouseEvent):void {
if(a1.ROLL_OUT==true && a2.ROLL_OUT==true){
gotoAndStop(1);
}
}
_visible On MC's
Help... Here's the scenario:
I have 8 swf's loading into seperate, blank (holder) MC's. What I want is for the MC's to be invisible until a button is pressed, then the 1 MC corresponding to
the button becomes visible. When a second button is pressed another becomes visible and the rest go invisible. I don't know how to explain it properly, but you
should get the drift. The code on each button may look something like this:
on (release )
_root.MCone (_visible=true)
_root.MCtwo (_visible=false)
_root.MCthree (_visible=false)
_root.MCfour (_visible=false)
_root.MCfive (_visible=false)
_root.MCsix (_visible=false)
_root.MCseven (_visible=false)
_root.MCeight (_visible=false)
The code on each MC will be maybe like this:
onClipEvent (load)
(visible=false)
The reason for doing this is so that I can load all the clips while the intro is running to increase the smooth running of the site. Please could someone help me
with the code for the visibility on the clips AND the buttons...
Many thanks for any help given...
_visible
Hey guys, thanks for all the help so far, you have been very helpful, and i have learned a lot from it.
I have another prob here
I have made this spacegame where i have enemies coming agains me, and when i crash, its game over (hit test)
but when i am at the game over screen the enemies keeps coming over the screen. I want them to dissapear when i crash and its game over.
the game are on keyframe 1 and the gameover is on keyframe 3.. Everthing else dissapear (background, points, etc..) but not the enemyes (
Can anybody help me with this ?
thnx
Synthieboy !
_visible, Help Please
using buttons to handle MC properties (_visible). they work fine on the initial click but NOT if you click them a second time (on the second click it hides the clip again, but on the third click it functions properly????). script is as follows:
on (release) {
_root.mc1._visible=true;
_root.mc1.gotoAndPlay(1);
_root.mc3._visible=false;
_root.mc4._visible=false;
_root.mc5._visible=false;
_root.mc6._visible=false;
_root.mc7._visible=false;
_root.mc8._visible=false;
}
the default state of the MC's is
onClipEvent (load) {
_visible=false;
}
what am i doing wrong???
_visible ?
I am trying to do this with two buttons. One button only becomes visible when the other is clicked. I know the commands, but just can't get them to work.
I have two buttons, "generate" and "checkButton"
To the first button, called "generate" I apply this code:
_root.checkButton._visible = 0;
and
on (release) { _root.checkButton._visible = 1; }
Help??
_visible Bug?
Can anyone else reproduce this error?
I have an empty MC that I'm loading an .swf into.
Before I execute loadmovie, i'm setting the _visible property to false. AFTER I execute the loadmovie, I again set the _visible property to false.
The MC is still visible on the stage, even though the property reports itself as being false.
._visible ?
Hey all, I've got this form that I'm working on, with input boxes. Over the boxes is an mc of text (single frame), essentially labeling the input boxes and notifying users what info to put where. What I'm looking to do, (unsuccessful so far) is, that when the user clicks on any box to input their info, the mc visible = false.
I guess another way to word it, is there any code that can be used with selecting an input box?
Thanks,
Robb
This.MC._visible=0;
Hello,
I have 2 MCs in my library.
From the main MC, I created an instance of the firtst MC of the library. (MC1)
In the newly created MC1, I created an instance of the second MC in my library (MC2).
I want to make MC2 invisible from MC1.
I tried this actionscript :
this.MC2._visible=0;
MC1.MC2._visible=0;
But it doesn't work. After looking in newsgroups I also tried the following :
this["MC2"]._visible=0; but without success.
I'm a beginner and don't have much experience, can someone help me with this please?
_visible Help
The function below is executed and all runs well (i.e. the percentage preloader works fine and displays the percentage values in my Dynamic Text Field which has a Var label of 'loadText'. It is stored inside my percentage_mc movieclip on the main timeline), however, when the whole movie has loaded, I need to be able to hide the text field from view, but it's not working with the code I have below.
Any idea on what i'm missing? (apart from a good actionscript brain!)
Thanks for reading.
Attach Code
percentage_mc.onEnterFrame = function() {
getPercent = target.getBytesLoaded()/target.getBytesTotal();
this.loadText = Math.round(getPercent*100)+"%";
if(Math.round(getPercent*100) >= 100) {
delete this.onEnterFrame;
this.loadText._visible = false;
}
}
Object.property.property ?
I'm making a movie that will read data from an object and build some rows and columns of radio buttons, but I'm having some trouble dealing with the objects that I'm using to store data on the _root.
Here's what I'm trying to test:
I have the following code on the root of my movie:
PHP Code:
radio_button_object = new Object ();
radio_button_object.row_2 = 2;
radio_button_object.row_2.radio_button_1 = true;
radio_button_object.row_2.radio_button_3 = true;
Within a movie clip named "radio_button", I've got the following code:
PHP Code:
myObj = eval ("_root." + this._name + "_object");
// inside a for loop I'm going through rows
// inside that for loop, I have another for loop that goes through columns
for (i...) {
for (j...) {
if (myObj ["row_" + i]) {
if (myObj ["row_" + i + ".radio_button_" + j]) {
(eval ("row_" + i + ".radio_button_" + j)).gotoAndStop ("selected");
}
}
}
}
I've tried:
PHP Code:
myObj ["row_" + i ["radio_button_" + j]]
and:
PHP Code:
myObj ["row_" + i] ["radio_button_" + j]
But I've had no luck.
Essentially, I'm looking for object.property.property, except that the object name and all property names are variables.
Can anyone help me out?
Thanks!
cooper
www.pigdogtoad.com
My Property Is Your Property.thankyou.
im trying to create a drag and drop where you drag the image to the left of the screen and if dropped more than half way across the stage the image has a word,but once dropped can also be dragged back to how it was originally. I was thinking its something to do with getting thexproperty(as its all horizontal)
I'm new to flash so would really appreciate anyones help,
ta.
_visible Problem...HELP
Hello!
I am loading 10 swf's into 10 instances of a clip as a holder (as needed for positioning). In frame one of the clip that does this, I have all the instances set to _visible false. The next frame loads all the swf's into the clips. Then a mouse over list toggles the visibility for the various clips on and off. The last part works great. Like a javascript roll. However, when the movies load, even though the clips at this point in frame one where set to _visible false, I see the movies stacked up, and the last clip, 10, is still visible. There is another button on the interface that turns all those clips off and that works. Why do I see the movies in the clips when they load, even though the clips have been set to _visible false? Is there an order or processing or something? If I (and I haven't done this yet) set the mc's to visible false in frame 1 on the main timeline, would that behave any differently? It should work whereever I put it, right?
db
_visible Problems...HELP
I am loading 10 swf's into 10 instances of a clip as a holder (as needed for positioning). In frame one of the clip that does this, I have all the instances set to _visible false. The next frame loads all the swf's into the clips. Then a mouse over list toggles the visibility for the various clips on and off. The last part works great. Like a javascript roll. However, when the movies load, even though the clips at this point in frame one where set to _visible false, I see the movies stacked up, and the last clip, 10, is still visible. There is another button on the interface that turns all those clips off and that works. Why do I see the movies in the clips when they load, even though the clips have been set to _visible false? Is there an order or processing or something? If I (and I haven't done this yet) set the mc's to visible false in frame 1 on the main timeline, would that behave any differently? It should work whereever I put it, right?
db
|