ActionScript 2.0 :: Flash8 Variable To Control Button Visibility
Apr 21, 2009
i have a movieclip called allBUTTONS which contains 18 buttons. This movieclip will be called numerous time on the CDROM I am creating, and each time the number of buttons visible will change. So instead of writing the following code numerous times for however many buttons i want visible:
[Code]..
View 3 Replies
Similar Posts:
Jul 12, 2010
I have created a timeline with visibility button against each column. The timeline.swf is loaded into two empty movieclips to create a two-screen operation. Everything works fine except, I cannot for the life of me get the visibility button on the first swf to affect the visibility for the column on the second swf.
[Code]...
View 5 Replies
Aug 10, 2009
I've been trying to do is to move a string of thumbnails - thumbHolder_mc - incrementally (like every 386 pixels) left and right, controling it with arrow buttons. Code below works like a charm EXCEPT when I try to stop the tween motion on either end.
I tried everything - _visible = false, enabled = false, delete function, etc etc, nothing works. In the my script below, buttons get disabled, but never recover. Function never comes "back to life", which is what I thought it was supposed to do:
[Code].....
View 4 Replies
Feb 4, 2010
What I am trying to do is capture the name of the button which is clicked and add "hl" to it, which is the name of another movieclip already on stage. This part works. Then with that modified name I want to set the visibility of the second movieclip, ie "popUp0hl", to true. This is not working. None of these MCs are created dynamically by the way.
var highLight:String = evt.currentTarget.name + "hl"; //This traces out fine
this[highLight].visible = true;//Here is the problem area
View 7 Replies
Aug 19, 2009
I found an earlier post with the following solution for mouseover visibility control.
ActionScript Code:
instancename.onRollOver = function() {
this._alpha = 0;
} instancename.onRollOut = function() {
this._alpha = 100;
}
What changes would I make to use the space bar as a toggle for visibility? Or would I need something completely different?
View 3 Replies
Nov 12, 2009
I need to make the object visible when the external mp3 reaches 8.2 seconds, what I�m doing wrong...?
ActionScript Code:
my_sound.loadSound("audio/sound_1.mp3", true);
var my_sound:Sound = new Sound();
[code].....
View 9 Replies
May 9, 2011
I have 3 text fields that display weather conditions from the Weather.com XML web service. The 3 text fields need to be visible only during a certain segment of the Flash Video that is set as the application's background. Do I use AS3 to specify visiblity? If so, how do I reference a certain range of frames in which the fields should be visible?
View 1 Replies
Jun 10, 2002
Let's say I have three symbols (whether they are movie clips or graphics, I'm not sure yet, but let's assume they're movie clips). Okay three movie clips, each is 5 frames of animation. The clips are named bugs1, bugs2, and bugs3.
Okay, now I have a variable named bugsvalue. Here's what I want to do:
If bugsvalue == 1, I want bugs1 to appear on the screen. If bugsvalue == 2, I want bugs2 to appear on the screen. And if bugsvalue == 3, I want bugs3 to appear on the screen.
There's two ways I think this can work, but logistically don't know if either one will work. We can have all 3 on the screen, but have their visibility set to 0. When the variable is equal to their value, their visibility is set to 100 and they appear. I don't like this approach because it's means having all three on the screen, which increases demand on the computer.
The other way to do it is to have none of them on the screen. Then when their variable is equal, have the clip actually appear and then when the variable isn't equal anymore, to have that clip disappear.
If this is confusing, is there a way I can provide a .FLA so perhaps you can see what I want to happen?
All movie clips are in the library, but I don't know how to call something from the library to appear on the stage, and then disappear again when I don't need it on the screen anymore.
View 2 Replies
Apr 1, 2012
I've attached a source file below, I'm kinda stuck. Basically, its an FLA that has a variable that changes (smscounter) based on whatever number is read in from an XML file (on my server). There is a big movieclip called "rewinder" on frame 1 of the main stage. There are left and right buttons that navigate between frames within that movieclip "rewinder". What I'm trying to do in theory is:
if(frame != 2) {button_right.visibility = true};
if(frame == 2 && smscounter > 5) {button_right.visibility = true};
if(frame == 2 && smscounter < 5) {button_right.visibility = false}
I've been told that won't work simply because once a variable (visibility) is set, it's not going to just continually check it, so I have to dispatch an event? I've tried 3-4 tutorials and I can't get any to work. Now a few things: I would LOVE to avoid anything super complicated. All I need is on frame 2 for the button to not be there IF smscounter is below 5. Other tutorials required another class and document class, but I couldn't get them working The buttons are currently outside the rewinder movieclip. I put them inside and on each frame, but then I couldn't get them to react to a rollover. The code is about as optimized as if a first grader wrote it, mainly because I'm a designer and I've been having help along the whole way with this.[URL]..
View 1 Replies
Aug 21, 2009
I want to declare a variable on the main timeline that can be called from anywhere in my movie. So, _global var should be the right approach. I want to declare a movie clip 'MC1' "open", or "closed" so that when it is revisited, my flash file knows the user has been there before and performs a different task from the one it does when 'MC1' was first encountered. So, i need a 'if' statement to run from the variable, when the playhead encounters the movieClip.
[Code]..
View 2 Replies
May 29, 2009
I'm trying to make something that will show up in a dynac text field something like this:"[variable1] text text text [varibale2] text text text"I've linked the dynamic text field to a variable "resu" and set it to:var resu = variable1 + "text text text text" + variable2 + "text text text"The only problem is that when I make the variables random, they don't change
View 1 Replies
Feb 18, 2009
i have button which open specfic movie clips from my library and locate them on the stage.This all works well and good, but i would also now like a button to remove all of them except one when the user is finished playing around.i got the follwong code working, but it only works on movieclips that are already present on stage. when i export the file i get errors because the movie clip im trying to hide isnt currently on stage i think. i identify the hidden movieclips by their class name.
startover.addEventListener(MouseEvent.CLICK, removeallFunction);
function removeallFunction (event:MouseEvent):void
{
[code]....
View 1 Replies
Sep 29, 2009
I have 11 images i need to _x slide (left and right ) using 2 buttons. ( next and back )my goal is to show two images at a time ( contained inside img_MC..consisting of all 11) inside a 748 x 419 mask. I have accomplished this but the next button and the back button need to disapear when img_mc is at a certain _x position...so that if you are at the last frame you can only go back...and if you are at the first frame you can only go next.
so far going forward I can get next to show...and going back I can get back to show...but in the middle when I need them both to be there I only have one or the other.
[Code]..
View 1 Replies
Sep 29, 2009
I have 11 images i need to _x slide (left and right ) using 2 buttons. ( next and back ) my goal is to show two images at a time ( contained inside img_MC..consisting of all 11) inside a 748 x 419 mask. I have accomplished this but the next button and the back button need to disapear when img_mc is at a certain _x position...so that if you are at the last frame you can only go back...and if you are at the first frame you can only go next.
so far going forward I can get next to show...and going back I can get back to show...but in the middle when I need them both to be there I only have one or the other.
[Code]...
View 1 Replies
Nov 9, 2006
I need to add text on screen (for hearing impaired) to a simple movie I created. I just need to have text toggle on and off. I don't know how to actionscript the mc or button. Working in F8, publishing to F6.I did see the visibility on/off rollover thread... but I'm not actionscript saavy and can't make the leap to an onpress or onrelease button, rather than a rollover.
View 7 Replies
Nov 28, 2011
I want to disable little cheaters ability to click [Control] >> Play OR [Control] >> next frame and all that < > mumbo jumbo.[code]...
View 7 Replies
Nov 19, 2009
I'm attempting to make a "Wheel of Fortune" style game. Everything's going great except this one nagging problem. On the main game board screen (where the word puzzle is solved), I have placed small buttons with all the letters of the alphabet. When the player clicks a certain letter button, the corresponding letters, (if the word or phrase contains them) appear on the board. Well, this works just fine, but as of now, when a letter is chosen, all letters on the board appear at once.
Of course, in the real "Wheel of Fortune" game, if the word or phrase contains 2 or more letters that have been chosen, the letters appear on the board in a sequence, probably around 2 seconds apart (I'm sure most people are familiar with the game show). So, basically, I would love to know how to delay my letter MC's appearing, when the corresponding letter button has been clicked.
View 3 Replies
Jun 28, 2008
I have a mc tracking as a button with a working on(release) statement. Within the on release statement is this code that doesn't work for me:
_root.playbtn.pause_mc._visible = true;
_root.playbtn.play_mc._visible = true;
The first layer of the button has a mc with instance called play_mc
And the second layer of the button with a mc instance called pause_mc
The button instance on the stage is called playbtn.
View 7 Replies
Nov 21, 2009
I have the following code:
Code:
_root.TemplateListener = new Object();
_root.TemplateListener.onLoadComplete = function(target_mc:MovieClip):Void
{
trace (_root.mcBalloonBase.mcTemplate); // undefined[code]........
The loaded SWF 'bt_latex10.swf' have an instance named 'mcTemplate' in its stage. Since it is being loaded into a new empty movieclip called 'mcBalloonBase' that is at the stage of main movie, why it is returning undefined? How can I access the 'mcTemplate' after it be loaded?
View 2 Replies
Oct 23, 2006
how to control the visibility of certain buttons from an external file (like scroll bars). I have been able to do this with button function using a loaded variable and if statements on button release, but I have been unable to replicate this with visibility. I really need the button to be visible or not from the initial load of the .swf file. Any suggestions? I currently have to open flash and change the action script within the flash file and export a new .swf, and I want to be able to do it by changing a .txt file.
View 1 Replies
Sep 5, 2009
I've got these 150 buttons on my stage which all do the same thing. They test their value against myVariable to see if there's a match. If there is, it's a right answer and the user gets a point. The myVariable may be anything between 1 and 150. I have my button code on a single frame now but I'm looking at duplicating it 150 times (1 for each button instance). This seems a wasteful way of doing things. Is there any way I can extract a variable from the instance name? The buttons named btn1~btn150.
Is there any way to:
btn 1~150 onRelease
var newVariable = [instance name - "btn"]
I guess this requires some way to listen for an instance name.
View 3 Replies
Nov 30, 2009
I have one swf with a button which, when clicked, needs to go to another swf in a different php page but to a specific frame, not the start of the movie.In the first swf I have:
register_btn.onRelease = function() {
getURL("http://www.myurl.co.uk?f=register");
}
[code].....
View 1 Replies
Oct 27, 2007
for example i have 2 swf file a.swf and b.swf can a.swf sending variable to b.swf? can a.swf control some movieclip in b.swf? in a case a.swf is loadMovie to b.swf...
View 4 Replies
Oct 21, 2009
My code:
Code:
onClipEvent (construct)
{
[code]....
View 6 Replies
Jul 5, 2011
there are 2 items on stage, one is the "button" with instance name myButton and a dynamic text field.so the action script goes this way...
myVar=0;
myButton.onRelease=function(){
myVar++;
trace("click");
}
the dynamic text is initially zero (0) and when i click the button it counts the clicks up to here every thing works right but...when .swf file previewed in html after clicks if refresh is pressed the number is going back to zero.i want to upload this file and use on webpage.
View 5 Replies
May 10, 2008
how I can declare a variable that is retrievable when the browser reloads.
View 7 Replies
Mar 18, 2009
I'm trying to create a unique variable and reference to it with myRewind for some button functions.
I'm trying to create this rewind+variable as the unique identifier but it just seems to be using myRewind as the variable and overwriting it.
Code:
//Setup subsection rollovers
function createRollover(myContainer, rollName) {
btnName = rollName+"_btn";
mcName = rollName+"_mc";
[Code]....
View 2 Replies
Dec 29, 2009
Is there a way to recall a variable from a previous frame? I have a variable that was mathematically calculated in frame 3, that variable was then used in a dynamic text field. The problem I am facing is that the text field then disappears in frame 4. The only solution I can think of is reposting the text field in frame 4 but I am having trouble recalling the variable from the previous frame.
View 4 Replies
Jan 24, 2010
Basically, I wanted to 'save' the time thats been recorded in each of the 5 'games', so at the end there is a 'scores' page, with your times for each of the games.
I have managed to get the timer working for the games itself, but cannot find / work a method which saves them to the last frame?
I thought possibly converting the 'elapsed_time' into a different var (t1,t2 etc..) for each of the games? - doesn't seem to work timer_not_saving.fla
View 1 Replies
Nov 30, 2010
I am working on a project which there are two .swf file play side by side simultaneously. I need to use one of the file to control the animation in another file.
If they are in same .swf it should be easy. I can just use:
gotoAndPlay("frameNumber")
but there are two .swf now. (lets say movieA and movieB) I think I should use something like:
"LinkToMovieB".gotoAndPlay("frameNumber")
"LinkToMovieB" should be the link to movie clip in the movieB file.
my problem is how do I get the link to movie B's movie clip. or there is other proper way to do this task.
View 1 Replies