Using A Button To Force A Certain Layer To The Top
I have a horizontal navigation bar with a series of six buttons. When someone hovers over a button, that button needs to be at the very top of it's group for it to display properly. Is there a way to make a button tell an mc that it should display on top of all the others?
telltarget maybe?
on (rollover, dragover){ {telltarget("/mc-name"){ swithtothehighestdepth; }
You get the idea I'm sure.
DevShed > Flash Help
Posted on: December 5th, 2004, 07:52 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Using A Button To Force A Certain Layer To The Top
I have a horizontal navigation bar with a series of six buttons. When someone hovers over a button, that button needs to be at the very top of it's group for it to display properly. Is there a way to make a button tell an mc that it should display on top of all the others?
telltarget maybe?
on (rollover, dragover){
{telltarget("/mc-name"){
swithtothehighestdepth;
}
You get the idea I'm sure.
Can You Force The Bg Of A Button To A Spicific Layer?
Ok, shot in the dark here? I am trying to get a button to always show the bottom layer as its background. For example:
lets say I have 4 layers
0: photo
1: blue
2: green
3: yellow
each layer is stacked on top of the next and each takes up 1/4 of the frame.
[ 0 ][ 1 ][ 2 ][ 3 ]
I have a button on each layer.
I want the background of each button to show the section of the photo( on layer 0 ) it resides over.... so as the button moves you see the image under all the layers.
Thanks
Edited: 02/05/2007 at 05:17:05 PM by bliesveld
How Do You Force Instances With The Same Name On The Same Layer To Update?
Maybe someone can tell me why flash doesn’t redraw components’ x,y positions if they have the same instance name and are on adjacent frames? (movieclips work fine, just not components) If I have a button on frame 1 and a button on frame 2 both with the same instance name but different locations on the stage, frame 2’s button doesn’t show up in the position I placed it, it stays at the position of frame 1 but still has the properties of frame 2’s button. The label changes and everything. If I stick a button on a frame in between and give it a different instance name there is no problem. I thought it might be the style manager bug http://www.gskinner.com/blog/archives/2007/12/cs3_component_b.html but it didn’t seem to affect. This happens for textareas too and probably all components although I haven’t tried them. I’ve tried using drawNow() and validateNow() with no luck either http://www.adobe.com/devnet/flash/articles/creating_as3_components_pt3_05.html
Thank you!
// put this on frame 1 along with a button on the stage with instance name: b
function doit(event) {
if (currentFrame == 1)
gotoAndStop(2);
else
gotoAndStop(1);
}
b.addEventListener(MouseEvent.CLICK, doit);
stop();
// put another button on frame 2 along with this code and also make it’s instance name: b but move it so it’s not in the same x,y coordinates as the button on frame 1
stop();
Something possibly related. I have a movieclip on a layer, one instance with name “a” on frame 1 and one instance with name “a” on frame 2 and it has event listeners inside it that update something on the movieclip. Unless I put the movieclips on separate layers the event listeners won’t reset each frame. (example: a button with a tooltip onmouseover that you want to change the text of from frame 1 to frame 2) You’d think if they were on separate keyframes at least but no, they need to be on separate layers too.
I want the movieclip to update each frame. Any ideas?
Force Downstate Of A Button?
Is there a way to tell the button to show the downstate while keypress is down?
Im using this code on the button:
Code:
on (release,keyPress "6") {
getStartTime.gotoAndPlay("stop");
addPoints = 6;
}
It listens to the keypress and executes but it doesn't press the button visually, is there a way to do that? I've tried to name the downstate with a label but that didn't work for me. Any ideas?
Button Force Rollover
I really dont know what to google so I decided to ask it here. I was looking for Button classes but it seems like there's none? So how do I control buttons? like if I mouse over Button A, it will make Button B on rollover state. I tried "gotoAndStop(2)" since the rollover is the 2nd frame but it doesnt work with buttons I guess..
Any ideas?
Force Rollover On A Button
Hi,
I am trying to force a rollover on a button. I know I would usually do it by defining button as a movie clip and using gotoAndPlay() on it to go to rollOver state, but I already have a whole thing designed, and I just need this small modification. Is there any way I can tell a button to go to its Over frame?
Thanks
Can Flash Force-Click A Button For You?
I have a button that has an OnClick event attached to it. Is there a way for Flash to click the button for you once the user presses "Enter" (for example)?
Force A Button To Show The Over-state...
hi everybody.
here's a simple question:
in my animation there is a button.
the button is red in the up-state and blue in the over-state.
can I - using actionscript - force my button to only show the over-state / go to the
over-state and stay there?
...so that my button remains blue?
thanks in advance
felisan
Force A Button To Show The Over-state...
hi everybody.
here's a simple question:
in my animation there is a button.
the button is red in the up-state and blue in the over-state.
can I - using actionscript - force my button to only show the over-state / go to the
over-state and stay there?
...so that my button remains blue?
thanks in advance
felisan
Using Actionscript To Force A Button State
I would like to use actionscript to force a button to go to a specific state and stay there. Here's what I wish would work:
Quote:
if (variable eq "blahblah") {
buttonName.gotoAndStop(1);
}
else {
buttonName.gotoAndStop(0);
}
That's not working for me, though... Thanks for any help.
Rotating Menu/ How To Prevent Button Sound When Button Is Under Another Layer
I have a rotating menu on my site. The menu buttons have a sound effect when they are rolled over.. I have a layer overtop of the rotating menu, but the buttons still rollover (and that sets off the sound effect.) when they are hidden by the top layer. How can I prevent this? It there any _x _y actionscripting that I can do to prevent this?
Here is the site if you want to see what I'm talking about:
http://www.webraptor.com/index2.html
Thanks,
-- Jeff
Mc In A Layer Above Button. But..
Hello,
my Flash animation is to emulate a room : check it out at www.touristes-de-candolle.com/site (I have not finished it as you can see)
Here is how I made the buttons.. I made the mcs for animation, and I made a different layer, called buttons layer, where I made "invisible" buttons for each link. The problem is, when you roll over the board in front of the staircases, it still links to the staircase. even though the board is in a layer above the buttons' layer.
How do I change that?
Thanks,
Manojo
Button Layer
Hello,
Having trouble figuring out what the correct actionscript for a button that is trying to access a labeled frame within a movie that is part of a larger movie. It works if I play it by itself outside of the larger movie, but I'm not sure how to get it to work within. This is what I have so far:
on (release){
_level0.gotoAndPlay ("next")
}
I've tried changing it to:
contents._level0.gotoAndPlay ("next")
...but it didn't work. "contents" is the symbol that the file is being loaded into.
Cheers
I Need Layer Button Action Help
I have an invisible moon that is over text that says "Touch Me"
I have a fade that I want to work only when the invisible button is pressed. I need help with a code that will do that.
THANKS
on(release){
code to start fade
}
Is the action to put on a button but I need to put the action on the first frame of the actions layer.
Do I use the same code there? I am really confused trying to go from the button to the layer and using code to activate the button.
[MX] Do I Need New Layer For Hit Area On Button
i'm not exactly certain where i learned how to make buttons but it showed me to make the hit area on a seperate layer.........i'm working on a project with a lot of buttons and the extra time really adds up.....just wondering if its okay to keep my hit area on the same layer as up, over, down???
Button That Applies To One Layer
Ok ive been working on this sig for a very long time, and its basically a static background, only theres two video clips, one is a 340 frame video, that i want to keep playing continuosly, but the other is a 32 frame video - which i only want to be activated when i click a button, i have NO idea how to do it, ive made a button, but when i click it it instead resets BOTH videos??
please help.
Button Layer Problem
I have a bunch of buttons on the same layer, and each button is on top of another button a little. So for instance, button 1 covers a part of button 2, and button 2 covers button 3 a little and so on...
I was wondering if it's possible so that when the mouse is rolled over a button, that button comes to the top??
Button Visible On Top Most Layer
Hi, I have a template for showcasing 6 movieclips(video). On click of any movieclip thumbnails the video will get maximized and start playing on top of other thumbnails. the issue is when i do mouseover on the maximized video. i get a hand cursor symbol which belongs to other movieclips which is under the maximized video.
can any one help on this???? please....
Button Layer Issues
Greetings!
I'm trying to create a series of buttons that simply enlarge when you hover over them. When a button enlarges, it should just "overlap" another button, essentially hiding the overlapped buttons.
However, what happens is this:
http://www.ireallyshouldbewriting.com/TESTS/test.html (there will be about 12 of those buttons in all)
TOP BUTTON HOVER: What I *want* to happen!
BOTTOM BUTTON HOVER: What I don't want to happen! (the top button blocking the bottom image)
I'm assuming the more buttons I add the more overlap problems I'll be adding.
I've tried putting both buttons on the same layer and then on different layers, and neither fixed the problems. I guess what I'm asking is there any way to make sure the "over" and "click" states are always on top?
any suggestions? Thanks!
Initially I did the page in dreamweaver: (here) but that created its own set of problems with overlaps.
Button Layer Problem.
I just haven't been able to figure out this problem.
I'm working on a site wherein there are a bunch of round buttons. When you roll over one, it gets larger and the image in a polariod changes. When you click you go to the appropriate site.
Now, I created this page, but decided it was just sooooo inelegant -- I put all the buttons on every layer, there are about 8 million symbols and generally editing it (like moving a button) is a disaster. But that's the only way I could get it to work. (Can you tell I'm learning flash by trial and error?) On the other hand, it does what I want it to.
It's located here: http://www.ireallyshouldbewriting.com/notsoserious/index.html
You can see that it takes a little bit to load all the images.
So, for easier editing and what I'm assuming is "more elegant" I am trying to put all the buttons on the same layer. If I want to move a button, all I have to do is drag it somewhere. With the version that has all the buttons on each layer, I have to drag all instances on each layer (so about 10 instances) and try to line them up on top of each other, perfectly.
So here I am trying to improve the design. All the buttons are on the same layer. The problem is, when you roll over one of the buttons, and it becomes larger.... part of it is hidden behind another button. If you go to this site and roll over the circle with the rabbit in it, you'll see that the circle with the pencil overlaps it and hides part of the rabbit button:
http://www.ireallyshouldbewriting.com/notsoserious/may11_2008/
So I posted this problem on a flash forum and got the following advice:
quote:on rollover function for buttons add the line:
this.swapDepths(100);
assuming you have no more then 100 depths already, else change number to 420 or something
Well, I must have done something wrong, because when I assign a button to do that, all the buttons disappear. (roll over the circle with the goose in it to see what I mean.) I tried using the same action on the rabbit button, but instead using "this.swapDepths(1);" -- but it didn't change anything.
What am I doing wrong?
the flash file is here: here
the swf is here: here
the html is here: here
thanks folks, for any help......
Button Layer Issue
Hello,
Having trouble figuring out what the correct actionscript for a button that is trying to access a labeled frame within a movie that is part of a larger movie. It works if I play it by itself outside of the larger movie, but I'm not sure how to get it to work within. This is what I have so far:
on (release){
_level0.gotoAndPlay ("next")
}
I've tried changing it to:
contents._level0.gotoAndPlay ("next")
...but it didn't work. "contents" is the symbol that the file is being loaded into.
Cheers
Button Change Layer
Hi There,
first time for me to use this forum and I'm new to flash.
Wonder if somebody could help me with button AS3.
I've seen the tutorials 'Flash Buttons with Action Script 3' here: http://www.layersmagazine.com/flash-buttons-with-action-script-3.html and this don't worked for me.
Tried to make my own but PROBLEMS.
First here what I want to learn:
- have layer 1 with one button
- new layer 'action1' with action for button on layer 1
- have layer 2 with text
- from start You only see layer 1 with the button
- when click this button You see layer 2 with text and not see layer 1 and it's stop here
this is my AS3 code:
btn1.addEventListener(MouseEvent.CLICK, click1);
function click1(evt:MouseEvent):void {
gotoAndStop("5");
}
When I 'Test movie' it's shows boths layers and don't stop.
Please need help...
Edited: 01/15/2009 at 05:55:02 AM by Stephpen
How Can I Disable A Button That Is Under A Layer With Some Content? Please Help :-/
I made a new site and everything works fine. There are just 4 Buttons that think to make a lot of trouble....
These buttons are located at "---LAYER2---" Now if I click on one of the buttons, a menue slides from right to the left into the movie. This menue is located in "---LAYER13---". The new menue includes the new buttons that are used to navigate through the site.
But the problem is, that I can still click on the buttons in "---LAYER2---" that once were used to get the menue sliding in.
How can i "deactivate" these buttons after clicking them ???
Please help me, I'm goin' crazy.....
How Can I Make A Layer Invisible In Swf With A Button?
Hi,
I want to learn how can I hide a layer.I mean I have a layer in fla and I want everything on that layer invisible in swf.I also want to control it with a button.
That is how I will use it;
In my cartoon there will be voice-over and also speech bubbles for the same lines.I want to user choose if he/she also want to see the bubbles or not.
Maybe I can put all the bubbles in a movieclip if it is easier to hide the mc, not sure.
Thanks in advance for your help.
Hide / Unhide Layer With Button AS
ok
i have 3 layers.
1.Button : (plenty of keyframes)
2.MC::circle : (plenty of keyframes)
3.MC::highlight: (plenty of keyframes)
all the buttons should have the same AS.
on(releas) {
show->layer->highlight
}
if the button isnt pressed the layer highlight should be hide.
is there any cmd to hide/unhide a layer ?
Making A Button Not Work When It Is Behind A Layer
Heres the story...I have button that becomes exposed my moving from behind the timeline layer above it. Now, my problem is that you can still activate the button (which I dont want) when it is hidden behind the above layer. Is there a simple way to be able to make it unoperable when it is not exposed?
[F8] I Want To Close A DIV Layer With Flash Button
Hi
how can i do this:
1. i want to close a DIV layer with a flashbutton on the page.
2. how do i interact soo that the div layer closes?
in javascript/html and Dreamweaver i use this script:
<script type="text/javascript">
<!--
function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
if (obj.style) { obj=obj.style; v=(v=='show')?'visible'v=='hide')?'hidden':v; }
obj.visibility=v; }
}
//-->
</script>
and contact the script with:
<a href="#" onclick=" MM_showHideLayers('HMLayer','','hide')">close</a>
but, how do i do that in flash?
/ Fredrik
Cant Move Dhtml Layer From Swf Button
i cant seem to figure out how to move my layer containing my swf menu. its a menu for navigation. i would like to get it to move from a small part showing on screen to full showing for use and then back. but i dont know how layer movement is done for dhtml layers. anybody?
[F8] Button Layer Which Only Functions When Visible
Hi,
I found a flash book component which I am implementing here: http://dev.funnyoldworld.net/portfolio/wedding-books
My flash file is one frame long and is split up into layers.
1st (top) layer - book component actions
2nd layer - book component
3rd layer - image file (instructions text)
4th layer - button with link behavior to make "prices & services" link work
(on release, gotourl)
My problem is that the button on the 4th layer still functions even when the Flash component (i.e. the book pages) are open on top. How can I make a button which only works when the layer it's on is visible?
Maybe this isn't the approach I should take, but from what I've said you can see the effect I'm trying to create. Any advice would be greatly appreciated.
I'm sorry I've just signed up to ask this question and honestly don't intend to become a regular member of the forum. I wont lie and promise to return, but instead in the spirit of Christmas I'll donate 10 to a registered charity chosen by whoever resolves this for me. T.I.A.
Targetting A Button Underneath Another Layer
Okay, so normally I'm pretty rocking at flash, but the other day I found myself stumped by the simplest little thing and I couldn't find an answer no matter where I looked - hopefully someone here can clear it up...
I have a button on a layer beneath a texture overlay layer. Because the overlay layer is above the button, the button isn't detecting rollovers/clicks/anything. How do I tell flash to ignore the overlay so that the button can be accessed?
I know it's bloody simple... but I can't find an answer anywhere and it's doing my head in! Any help would be much appreciated.
Cheers guys,
Hadyn
Flash 9 Thinks A Layer That Is A Button Isn't
HELP!
After completing the relatively simple CBT cafe flash tutorial for animated menus, I tested the movie.
I had a simple rollOver action on frame one of my MainMenu layer, basically saying when the mouse rolls over the Main Menu graphic, start the animation. The menu was created by making a movie out of a button (the MainMenu button). Flash 9 won't recognize it as a button. I'm sure it's a simple fix, but I'm new to flash.
code is:
on (rollOver){
gotoAndPlay ("over");
}
where "over" is a label that begins the submenus fading in and moving.
Thanks guys
Multiple Button Scripts In One Layer, Is It Possible?
Is there anyway you can have multiple scripts in once action script layer. The reason I ask is that I have multiple buttons, and rather than creating five different action layers, I would rather reduce the layer count and place this in a single action script layer, for example - I am using the following for my buttons :
ActionScript Code:
buttonOne.onRollOver = function(){ OK1 = true;}buttonOne.onRollOut = function(){ OK1 = false;}effectOne.onEnterFrame = function() { if (OK1) { effectOne.nextFrame(); } else { effectOne.prevFrame(); }};
I would then need to create a second layer for the second button, adjusting the code slightly to suit the buttons etc, is there a method of doing this?, and you cannot simply copy the code after, as this causes problems
please
if you know let me know
thanks
Multiple Button Scripts In One Layer, Is It Possible?
Is there anyway you can have multiple scripts in once action script layer. The reason I ask is that I have multiple buttons, and rather than creating five different action layers, I would rather reduce the layer count and place this in a single action script layer, for example - I am using the following for my buttons :
ActionScript Code:
buttonOne.onRollOver = function(){ OK1 = true;}buttonOne.onRollOut = function(){ OK1 = false;}effectOne.onEnterFrame = function() { if (OK1) { effectOne.nextFrame(); } else { effectOne.prevFrame(); }};
I would then need to create a second layer for the second button, adjusting the code slightly to suit the buttons etc, is there a method of doing this?, and you cannot simply copy the code after, as this causes problems
please
if you know let me know
thanks
Button For Changing The Colour Of A Layer
Hi,
I am trying to create a button that will change the colour (or hue/saturation) of a particular layer. Its for a colour scheme program that will allow users to select different parts of a room and colour them from a set of available shades.
Any help would be most appreciated.
Hugo
AS3 Button Blocked By Higher Layer
Hello,
I have an AS3 issue -- while converting a file from AS2 to AS3, I noticed that buttons won't work if they're behind something else... which is understandable, and usually desirable, except in a case that there is a PNG over that button, and you can see your button through the transparent part of the picture, but can't click it because it's considered to be obscured by that PNG...
I would really appreciate if someone can help on this!
thanks in advance.
Email AS Button > Layer Problem
hi I'm using this script to send variables to a php script to and email to my address.
I'm having problem with moving this button to another layer.
ActionScript Code:
on (release) {
if ((email.indexOf("@") != -1) && (email.indexOf(".") != -1) && (length(email)>5)) {
action = "Send";
loadVariablesNum("sunday.php", 0, "POST");
nextFrame();
} else {
email = "PLEASE ENTER EMAIL";
action = "";
stop();
}
}
Ive tried this with no result. Anyone know what I'm missing out?
ActionScript Code:
on (release) {
if ((page.email.indexOf("@") != -1) && (page.email.indexOf(".") != -1) && (length(page.email)>5)) {
action = "Send";
page.loadVariablesNum("sunday.php", 0, "POST");
page.nextFrame();
} else {
page.email = "PLEASE ENTER EMAIL";
page.action = "";
stop();
}
}
http://www.feneo.com/files/metpartie...ish/sunday.fla
Pleeeeeeassseeeee heeelllppp.
Thanks peeps
Flash Button To Hideshow Layer In Dreamweaver?
ok, i know you can call on a pop up window with flash, by calling the js, so how would i be able to show and hide layers as i would with dreamweaver?
the code is like this
+-<a href="javascript:;" onClick="MM_showHideLayers('Layer1','','hide','Lay er2','','show')">-+
how would that go into a flash button to call on the layers that are in the same page, if you dont understand, lemme know, thanks!
Hiding Text Layer With Button Containing Actionscript
does anyone know if you can let the user hide a layer in a movie by then clicking a button? I have a movie with closed-captioning and I want to have a button that allows the user to not have the text show up. Right now I have the text in a seperate layer, so I was wondering if I could have a button with actionscript added to it to show/hide the text layer.
Best Ways To Disable A Button When New Layer Goes Overtop
I have a group of buttons on one layer in my flashmovie. On rollover they fade up to a different color and then fade out on rollOut. Then I also have a menu button in the corner that, when selected, pops up overtop this group of buttons. But it only covers them partially. So when the menu buttons are being selected, the buttons underneath are also operating. I don't mind if the part of the underneath buttons that are showing work, I just don't want them to work when you hover over top of the main menu. What is the best way to fix this?
Give Button Instance Name And Actions Layer: Doing It Right?
Hi all,
Two quick questions:
I have 10 buttons called 1, 2, 3, 4, 5, 6, 7, 8, 9, 10.
They are in a movie clip called scroll.
Each one is on a different layer.
1. I want to give all the buttons instance names: button1, button2 etc- how do I do this?
2. I have been told to put the following on the first frame of the actions layer.
Does this mean that I click the button on each layer and add the actionscript in the actions frame? Or do I have to make a new layer called actions?
Thanks a lot in advance
//for button1
scroll.button1.onRelease = function():Void{
getURL("javascript:MM_swapImage('image1','','P01.j pg',1)");
}
//for button2
scroll.button2.onRelease = function():Void{
getURL("javascript:MM_swapImage('image1','','P02.j pg',1)");
}
//for button3
scroll.button3.onRelease = function():Void{
getURL("javascript:MM_swapImage('image1','','P03.j pg',1)");
}
Button Action = Show/ Hide Layer
Hey everyone,
It has been a time that I used Flash and I am only 22.. I am studying in Barcelona now and made a map of the city with the cultural stuff on it. I also want to incorporate the Metro, good restaurants and **** like that.
How do I show a layer (i.e. the metro layer) when someone on the site hits the Metro button...
The .fla and so are on http://www.bclk.nl/jeepee/Flashkit/
Thanks for the help...
Targeting Mc In Layer Of Button State With Actionscript
hi, I've got a button on the stage with an up state with two layers, one is just the regular up state and the other in an animation_mc that is supposed to attract attention to the button. after the button has been pressed I don't need that animation anymore -- how do I target an mc in a button state with action script to unload it or stop it? leaving the regular up state intact of course.
any good ideas would be very welcome
[F8] Button That Hides/unhides A Layer/object In .swf
I would like to make a set of buttons for a movie that will hide or unhide layers/objects to viewers.
Here's what I am trying to do in a nutshell... I have a map that will be zooming in and out, and I would like the viewer to have the option to view certain things (like schools, or major highways).
I will attach the map I have started on, it has zero movement or action script attached yet... But some of the elements that I would want to hide in their own seperate layers.
(flash file can be downloaded here ---> http://web.kitsapsun.com/realestate/flashmap/map.fla)
Any help would be greatly, greatly appreciated.
Thanks
!
-Chris
How Can A Flash Button Hide A Dreamweaver Layer?
I'm doing this page http://amedeldesign.com/interiores if you click where it says: "VER GALERIA DE PORTADAS" a flash animation will open with a slideshow, on right top it says "CERRAR GALERIA DE PORTADAS" which is to close the layer containing the animation. BUT, right now the close button is a layer on top of the animation.
I'd like to be able to close the layer containing the animation from the button in flash.
How can I do that?
How Can A Flash Button Hide A Dreamweaver Layer?
Member since: May 09, 2007
Total points: 85 (Level 1)
Points earned this week:
--% Best answer
Ariel M
S How to send commands from flash to dreamweaver...?
I'm using ajax to load a flash movie when a button is pressed. the movie loads ok and all, but I need to have a button within the flash movie to be able to close both the animation and the layer.
http://amedeldesign.com/interiores2/...
I took the idea from those animations that sometimes appear in yahoo, where you click on a corner for example, and a flash animation that cover part of the page appears on top of the other content.
I don't know if what I'm doing is as practical code-wise either.
So also, if anyones has suggestions to do it in a better way, please let me. The least I ask is how to send a command fromt he flash movie that affects the html document.
Thanks!!! Here's what I have so far, Please note thtat the layer witht he aniomation closes with another html on top of the flash movie, that's not how I want it...
http://amedeldesign.com/interiores2/...
|