Buttons Within A Button
I'm having a problem here. I want to make some sort of dropdown menu, and have animated the menushape. I put a big invisible button on top of it so it triggers back on rollout. But when I put 2 buttons within this button, it triggers the rollout, because the 2 buttons are situated on a layer on top of the other! I can't put it below, because then the 2 sub buttons wont work! Eeek! Irritating...
Can anyone help?
Striker
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX
Posted on: 01-21-2004, 02:26 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Buttons Within A Button?
I am using Flash MX and the my question is the following:
I have a button. When you place your mouse over it, it will then show 5 other buttons placed horizontally underneath it.
I want to be able to click on any one of the 5 buttons, but once you move your mouse off the original button, the other 5, of course, disapear.
What is the proper way to go about making this work, so when you take your mouse off the original button, you'll still see the 5 other buttons underneath it and be able to click on those as well?
Make them into movie clips instead?
Buttons Within A Button
I am working on an animation where I have a movie clip I turned into a button. I am trying to make it so that when I roll over the button movie clip another image appears with 3 buttons each linking to its own url. I have tryed it so far and it works fine until I roll over the three buttons, then the whole thing flickers. Please let me know if you can help.
Thank You
TechBoneII
Buttons On Top Of A Button.
Please see www.jollybutcher.com.
After the intro page, you get to the main page, which has a black bar at the bottom. The black bar is a button because I want it to change on roll-over. But there will also be navugation buttons on top of this (currently just text) and this causes a conflict.
Does anyone have any good advice on how to make the black bar work without making it a button?
Any help would be great.
Thanks!
Buttons Within A Button
I'm having a problem here. I want to make some sort of dropdown menu, and have animated the menushape.
I put a big invisible button on top of it so it triggers back on rollout.
But when I put 2 buttons within this button, it triggers the rollout, because the 2 buttons are situated on a layer on top of the other!
I can't put it below, because then the 2 sub buttons wont work!
Eeek! Irritating...
Can anyone help?
Striker
SmartClip Buttons.....way To Act Like A Button?
I've got a button movieclip that is inside an actual MovieClip. Then I've defined some parameters for the Movieclip to make it a SmartClip (if we still call it that). When I place it on the stage I want to be able to check to see if the user clicked on it like you would a button.
The hard part is that it needs to stay working as a MovieClip (because I understand that you can use onPress type commands but it converts the movieclip to a button which I can't do). Any ideas on how to detect if the mouse has clicked on the movieclip?
How To Have Buttons Inside A Button ?
hello there !!
this is the fact .
i have 3 horizontal buttons
(we) (services) (contact)
example when i go over (we) then i need to show a background containing the rest of the buttons , that at the same time it has its over .
i tryied but when i go over it bigins blinking , flashing and does not work .
please help . or offer me a better way to do a menu links like this.
waiting .....
Buttons Within Button Within MC Question
I have a MC "A" (dropdown menu) which is loaded using attachMovie. This MC contains button "B" which has 3 menu item buttons nested within. I want to have a "rollout" of button B removeMovieClip A. However, when I do this, any rollover of the 3 nested buttons within button A are treated as a rollout and the MC is removed.
When I use "release" as action to removeMovieClip, this works fine and I can rollover the nested 3 buttons fine without unintentionally removing the MC.
Why is rolling over of any of 3 menu item buttons being treated as rollout of Button B in which they are nested?
I have tried setting 3 menu item buttons to "track as Menu Item", but doesn't seem to help.
Dennis
How Would I Achieve This? Button With Buttons?
Ok i want to make a music button, and when u rollover it, it will open up or roll over, and will show 1, 2, 3, 4 and a stop button.
The 1,2,3, and 4 will be different tracks. After u rollout, the music button will close up again.
SO:
______
|MUSIC |
|______|
open up...
______
|1234 D|
|______|
Rolloff...
______
|MUSIC |
|______|
i need help with sound buttons and the cover button
If you have any ideas please help, or tutorials or anything.
IM stumped. THx for all posts
-nanascalala
How To Change 3 Buttons Into 1 Button
Using Flash 5:-
I have 3 layers in a 1 frame movie.
1st layer(buttons) has 4 buttons (stop/play loop1/play loop2/play loop3)
2nd layer(containerMC) has an MC called myLoopMC
3rd layer(actions) has some code
3RD LAYER CODE:-
playing=false;
MYLOOPMC code:-
myLoop=new Sound(myLoopMC);
myLoop.attachSound("loop1");
myLoop2=new Sound(myLoopMC);
myLoop2.attachSound("loop2");
myLoop3=new Sound(myLoopMC);
myLoop3.attachSound("loop3");
STOP BUTTON code:-
on(release){
stopAllSounds();
playing=false;
}
PLAY LOOP 1 BUTTON code:-
on(release){
if (playing !=true){
myLoopMC.myLoop1.start(0,999);
playing=true;
}
}
PLAY LOOP 2 BUTTON code:-
on(release){
if (playing !=true){
myLoopMC.myLoop2.start(0,999);
playing=true;
}
}
PLAY LOOP 3 BUTTON code:-
on(release){
if (playing !=true){
myLoopMC.myLoop3.start(0,999);
playing=true;
}
}
Okay so as you can see my movie has 4 buttons to control 3 loops. One to stop any loop playing and 3 buttons to play it's loop.
However, I don't want 3 play buttons. I want a next/prev button that either skips to the next loop or goes back to the previous loop. I have tried many ways to achieve this but have had no luck. I have searched the movies and tutorials which do go someway to cover this but not totally. Can anyone help me or provide a link that actually explains how to do this.
I have already been to Kenny Bellew and Sonify.org(Remixology) but neither explain how to do prev/next button actionscript.
Looking for any help whatsoever.
Tks
[F8] Array Button And Other Buttons
senerio:
var activebtn:MovieClip;
function releaseAction(){
if(!=activebtn){
//myaction (eg. change button color, change all others to opposite color);
this = activebtn;
}
}
array=[button1, button2, button3, button3]
for(var mc in array){
this[array[mc].onRelease = releaseAction;
}
the above part works fine. currently my whole site is created with button arrays with each page being loaded into a master page. So the master page has the main navigation and then the child pages eachh contain their own navigation such as item1, item2, etc. One of the pages needs to communicate with the other page in the sense that when I click on a button it needs to go to the other section and go to a specific item. So when you go to the other page the nav highlight needs to highlight the correct page and highlight the correct item.
this is the link:
http://jae-que.com/DROP/NIKE_COMM/T0...C_site_01.html
so when I am in "our clients" I can click on "see case study" and go to the case study page and highlight the case study menu item and highlight the correct item within that page. I can do it the hard way by specifying everything manually, but somehow it seems that with an array I could target the button with another button and trigger the appropriate events. I need to do this more than once so the more streamlined the better.
here is some sample code that works with a button manually placed on the stage triggering one of the buttons that is created dynamically:
//Create movieclip array
var CircArray:Array = new Array();
//Create and push movieclips into array
for (i=0; i<5; i+1) {
this.attachMovie("CircTest", "CircTest"+i, i++);
this["CircTest"+i]._y = (Stage.height/2)-(this["CircTest"+i]._height/2);
this["CircTest"+i]._x = (this["CircTest"+i]._width+30)*i;
var pushed:Number = CircArray.push("CircTest"+i);
}
//Change all clips to 10% alpha
for (i=0; i<CircArray.length; i++) {
this[CircArray[i]]._alpha = 10;
}
//set old selection variable
var activebtn:MovieClip;
//on click function
function doClick() {
if (this != activebtn) {
//change old selection back
activebtn._alpha = 10;
activebtn._alpha = 10;
colorA = new Color(activebtn);
colorA.setRGB(0x000000);
//change new selection
this.useHandCursor = false;
this._alpha = 100;
colorB = new Color(this);
colorB.setRGB(0xFF0000);
activebtn = this;
}
}
//
function thisColor() {
for (var mc in CircArray) {
this[CircArray[mc]].onRelease = doClick;
}
}
thisColor();
//
//this is the part that does not work (this button is manually place and not part of the arrray
MainChange.onRelease = CircTest1=function () {
trace(this);
CircTest1 = doClick;
};
Control Buttons From Within Another Button
I'm going round in circles with this one, thing is, I'm sure I've done it before!
It's probably easier to see what I mean by looking at the attached file.
Clicking on one of the buttons opens up a dialog box, you can then close it by clicking the orange exit button.
What I want to do is, everytime I click on another button, if there is one already open, it needs to close, so that only one dialog box is ever open.
You will see some actionscript commented out where I have tried but failed.
The example attached only has 2 buttons, the final project will have 30 buttons.
Buttons Over Another Button & RollOver
I want to make banner, with menu and rollOver function.
When I use one big button with "rollOver", that have to turn on menu , other buttons in menu does not work. (see example in my attachment)
Any solution ?
Buttons Inside A Button
I have a button that expands onRollOver. When expanded it has two buttons inside. the second level buttons do not respond since they are inside the first button, the Over button states don't show. Any Suggestions
Array Button And Other Buttons
senerio:
var activebtn:MovieClip;
function releaseAction(){
if(!=activebtn){
//myaction (eg. change button color, change all others to opposite color);
this = activebtn;
}
}
array=[button1, button2, button3, button3]
for(var mc in array){
this[array[mc].onRelease = releaseAction;
}
the above part works fine. currently my whole site is created with button arrays with each page being loaded into a master page. So the master page has the main navigation and then the child pages eachh contain their own navigation such as item1, item2, etc. One of the pages needs to communicate with the other page in the sense that when I click on a button it needs to go to the other section and go to a specific item. So when you go to the other page the nav highlight needs to highlight the correct page and highlight the correct item.
this is the link:
http://jae-que.com/DROP/NIKE_COMM/T0...C_site_01.html
so when I am in "our clients" I can click on "see case study" and go to the case study page and highlight the case study menu item and highlight the correct item within that page. I can do it the hard way by specifying everything manually, but somehow it seems that with an array I could target the button with another button and trigger the appropriate events. I need to do this more than once so the more streamlined the better.
here is some sample code that works with a button manually placed on the stage triggering one of the buttons that is created dynamically:
//Create movieclip array
var CircArray:Array = new Array();
//Create and push movieclips into array
for (i=0; i<5; i+1) {
this.attachMovie("CircTest", "CircTest"+i, i++);
this["CircTest"+i]._y = (Stage.height/2)-(this["CircTest"+i]._height/2);
this["CircTest"+i]._x = (this["CircTest"+i]._width+30)*i;
var pushed:Number = CircArray.push("CircTest"+i);
}
//Change all clips to 10% alpha
for (i=0; i<CircArray.length; i++) {
this[CircArray[i]]._alpha = 10;
}
//set old selection variable
var activebtn:MovieClip;
//on click function
function doClick() {
if (this != activebtn) {
//change old selection back
activebtn._alpha = 10;
activebtn._alpha = 10;
colorA = new Color(activebtn);
colorA.setRGB(0x000000);
//change new selection
this.useHandCursor = false;
this._alpha = 100;
colorB = new Color(this);
colorB.setRGB(0xFF0000);
activebtn = this;
}
}
//
function thisColor() {
for (var mc in CircArray) {
this[CircArray[mc]].onRelease = doClick;
}
}
thisColor();
//
//this is the part that does not work (this button is manually place and not part of the arrray
MainChange.onRelease = CircTest1=function () {
trace(this);
CircTest1 = doClick;
};
One Button Works - Two Buttons Do Not
Hi
Why does this single button work....:
ActionScript Code:
btnMENU.addEventListener(MouseEvent.CLICK, clickHandler1);
function clickHandler1(event:MouseEvent):void {
gotoAndPlay("menu");
}
...and this one, neither of the buttons work?
(Yes, one should"Play" and the other should "Stop"
ActionScript Code:
btnMENU.addEventListener(MouseEvent.CLICK, clickHandler1);
btnOBJECTIVE.addEventListener(MouseEvent.CLICK, clickHandler2);
function clickHandler1(event:MouseEvent):void {
gotoAndPlay("menu");
}
function clickHandler2(event:MouseEvent):void {
gotoAndStop("obj");
}
I only have only one instance of btnOBJECT on the stage. I copy/pasted the name from the Properties "<instance name>" field to the actionScript before ".addEventListener....." for the name, reducing misspelling. The symbol Properties are Buttons. btnOBJECT flies in from the left before it's static, but that's a timeline function, not AS3. It's too early to 'drink'. Help.
N.
A Button That Fades In More Buttons=)
Hey
http://www.workinprog.com/#
take a look at this flash site.
When you move your mouse over the heading(button) three buttons fade in.
Is it hard to make this effect. I tried but failed
on (release) {
_root.contents.loadMovie("locations.swf");
}
Something tells me that "on (release)" has to be changed to "roll over" or something?
Please help me!
simon sebergsen
http://sebergsen.com
Buttons Inside A Button
Hey people - I need to create a series of buttons which only become visible (collectively) when the mouse moves over the area where they are placed. SO basically, a bunch of baby buttons inside a big momma button....
Any ideas on how to creative this?
Cheers, Anrick
Menu Buttons Think They Are A Different Button Then They Really Are.
Hi everybody!
I’m new at flash-programming, and I love it - “A happy amateur”. So please bear over with my messy coding.
I’m trying to make a members archive, with all the info you need on a certain band-member.
I have all the info in a xml-file, which I have dragged into flash.
- There’s two problems making the menu work:
1. I have made a “onRollOver”-statement on the buttons in the menu, that changes the content of a text-field. It seems as if it only detects the last member-entry in the xml-file – this is weird…
2. I have made a “onRelease”-statement on the buttons in the menu, that should change the member that’s active – but nothing happens when you click the buttons.
Path to xml: www.cosycorners.dk/members.xml
Path to flash: www.cosycorners.dk/members.html
The code (members_as.as):
system.useCodepage = true;
_global.whichmember = 0;
// XML PARSING
function xmlLoaded(whichmember) {
//parameters
param = this.members_xml.firstChild;
imagex_param = int(param.attributes.imagex);
imagey_param = int(param.attributes.imagey);
thumbx_param = int(param.attributes.thumbx);
thumby_param = int(param.attributes.thumby);
//////////////////////////////////////////////////////////////
var membersCountXML = this.members_xml.firstChild.childNodes;
membersCount = membersCountXML.length;
member_number_var = whichmember+1;
//The menu is made
for (i=0; i<membersCount; i++) {
//"var" in the menu
var thumb_image = this.members_xml.firstChild.childNodes[i].attributes.imagename;
var originalthumbx = this.members_xml.firstChild.childNodes[i].attributes.x;
var originalthumby = this.members_xml.firstChild.childNodes[i].attributes.y;
var percent_thumbx:Number = thumbx_param / originalthumbx * 100;
var percent_thumby:Number = thumby_param / originalthumby * 100;
var menu_name_over = this.members_xml.firstChild.childNodes[i].attributes.membername;
this.createEmptyMovieClip("thumb"+i, i);
thumb = this["thumb"+i];
this.thumb.createEmptyMovieClip("image"+i, this.thumb.getNextHighestDepth());
image = this.thumb["image"+i];
image.loadMovie(thumb_image, image.getNextHighestDepth());
image._x = 20+i*(thumbx_param+5);
image._y = 400;
image._xscale = percent_thumbx;
image._yscale = percent_thumby;
thumb.onRelease = function():Void {
test.play();
_global.whichmember = Number(this.thumb.image._name.substr(5));
};
thumb.onRollOver = function():Void {
menu_name.text = menu_name_over;
};
thumb.onRollOut = function():Void {
menu_name.text = "";
};
//A text-field with the pictures names, is generated
this.createTextField("member_number_txt"+i,1000+i,0,0,10,20);
member = this["member_number_txt"+i];
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0xFFFFFF;
my_fmt.font = "Verdana"
my_fmt.size = 10;
this["member_number_txt"+i].text = Number(image._name.substr(5));
this["member_number_txt"+i].setTextFormat(my_fmt);
member._x = 8;
member._y = 400 + i * 20;
//"var" for the chosen member
var headline_var = this.members_xml.firstChild.childNodes[whichmember].attributes.membername;
var info_var = this.members_xml.firstChild.childNodes[whichmember].attributes.infotext;
var image_var = this.members_xml.firstChild.childNodes[whichmember].attributes.imagename;
var originalimagex = this.members_xml.firstChild.childNodes[whichmember].attributes.x;
var originalimagey = this.members_xml.firstChild.childNodes[whichmember].attributes.y;
var percentx:Number = imagex_param / originalimagex * 100;
var percenty:Number = imagey_param / originalimagey * 100;
//All things a given values
memberheadline.text = headline_var;
info.text = info_var;
image.text = "Where to find the image: "+image_var;
imagex.text = "Scaling image x: "+percentx+" %";
imagey.text = "Scaling image y: "+percenty+" %";
image_holder.image_mc.loadMovie(image_var, "image"+whichmember+1);
image_holder._xscale = percentx;
image_holder._yscale = percenty;
//text over constant image
image_holder.onRollOver = function():Void {
menu_name.text = headline_var;
};
image_holder.onRollOut = function():Void {
menu_name.text = "";
};
member_number.text = "Member number: "+member_number_var;
members_count.text = "Members: "+membersCount+" stk.";
//Shadow
import flash.filters.DropShadowFilter;
var shadowEffect:DropShadowFilter = new DropShadowFilter(3, 45, 0x000000, 100, 3, 3, 1, 3);
var shadow:Array = [shadowEffect];
image_holder.filters = shadow;
}
}
/////////////////////////////////////////
members_xml = new XML ();
members_xml.ignoreWhite = true;
members_xml.onLoad = function (success) {
if (success) {
xmlLoaded(whichmember);
}
};
//////////////////////////////////////////
//HERE IS WHERE YOU DECLARE YOUR XML FILE
members_xml.load ("members.xml");
//////////////////////////////////////////
stop();
Thanks! - Jóhannes
A Button That Fades In More Buttons=)
Hey
http://www.workinprog.com/#
take a look at this flash site.
When you move your mouse over the heading(button) three buttons fade in.
Is it hard to make this effect. I tried but failed
on (release) {
_root.contents.loadMovie("locations.swf");
}
Something tells me that "on (release)" has to be changed to "roll over" or something?
Please help me!
simon sebergsen
http://sebergsen.com
Buttons Inside A Button
I have made a button which is a box, when you rollover it it opens and the menu items come out. This part all work fine, but when you try roll onto the menu items, which are also buttons, the box button goes back to its roll-off state, and the menu items dissappear. Does anyone know a way round this?
Thanks
Masked Button That Shows Other Buttons
I have a button that on rollover I want a list of names to appear. Each of those names will be a button. I think I need to use a mask.
Example: view Agents(button) on roll over I want a list to appear inside a shape. The names John, Bob , Jack. Each of these names will be button so when they are clicked you are taken to that person's page.
the problem is I don't know how to make the names appear on view agents rollover.
Any suggestions? I looked in the tutorials but I did not find what I was looking for.
Tazmania
Advanced Button Question Two Buttons Three MC's
If I have 2 buttons that control 3 movie clips
Buttons 1 controls targets MC1
Buttons 2 controls targets MC2
Button 1&2 on second click will target MC3
If I click on Button 1, it will play MC1, if I click again it will play MC3
If I click on Button 2, it will play MC2, if I click again it will play MC3
If I click Buttons 1, then click Button 2, it will play MC3 then MC2
If I click Buttons 2, then click Button 1, it will play MC3 then MC1
This is what i am trying to achieve I think? is, if button 1 or 2 is not visible play the MC associated to the button clicked, if button 1or 2 is visible play MC3 then play the MC associated to the button clicked and hide other button
I hope someone out there can help me through this?
The Battle Of Button Vs Movie Buttons
I like my smooth fading effect so I have chosen to use the movie effect with the on rollover = direction -1. Now, in doing so, I can no longer [to my knoledge] use these smooth animated "buttons" to scroll my text >.<. Can anyone suggest an idea for me to do? I either have the animation playing, or the button working, it won't allow me to do both for some reason.
Suggestions? Solutions?
Trigger Buttons From Another Button Or Timeline
I have been using Flash for some years now as a training tool, creating annimated content for very technical subjects. Works great, but only I know where all the hidden buttons are to make things happen. I have been requested to put some of these training sessions in a friendlier environment, much like Power Point where one click is all you need to jump to the next subject, or make things happen, etc. I have also been asked to insert a voice over for those who just want to listen. To accomplish the voice over, I thought I could just produce the mp3, import and trigger the hidden buttons from the sound timeline. Can this be done? What scripts are to be used to trigger a button from another button or frame, or do I have to copy the appropriate button script into frame actions? If this is possible I think I can handle the first request to set up a Power Point type presentation.
Thanks
Cladman
How To Make Button Actions Without Buttons...?
i made an mc (an mc object, not a button object), and put a on(rollOver) action on it, and it works. But I've put selectable text in that object, so I would like to be able to still select it after the on(rollOver) script runs. But the cursor changes to the darn hand after the rollOver even, even though it's not a button object but a mc object...
is there any way of making buttons(mcs, rather) that doesn't change the cursor to the hand, so i can make the text inside the mc selectable??
and how do you make flash send email? something simple like the mailto: button in html will do.
Mouse Buttons Only For Button Instances - Help
I am getting the error message "Mouse events are permitted only for button instances" when testing my movie. I am using a button that, when clicked, will display a box with some writing. I am using:
on (release) {
gotoAndPlay (2);
}
When the user clicks the button, I am trying to have the movie go and fade in the box (irrelevant to my question actually, just helpful to understand what's going on).
The button I am using IS an instance of a button so I don't know what is causing the message. Thanks for your help!
Layers Above Buttons Not Blocking Button
i have a button on a bottom layer, above it i have an mc that is tweened to come in over the button..
however the button's action and cursor still happeen when i mouse over the button even when it's obscured by the mc symbol above it?
how do i 'block' the button underneath the mc?
Sticky Buttons / Button Has Been Clicked
I have a button that is used in about 50 places on my site. Is there a script that I can put in the button itself (fI'm assuming on the down state) so that the button will display differently after it has been clicked. Like when you click on an html link it changes color to denote that it has already been clicked.
Thanks,
B
Mouse Over 1 Button To Fade All Buttons?
I am trying to make buttons similar to http://www.ianschragerhotels.com/home.html, where as one mouses over a button, the OTHER buttons white out. I am using Flash 5. Please, if anyone has any idea how the tell target/roll over function could effct all other buttons - let me know. Thank you very much.
Radio Buttons And A Continue Button
Hi,
I have several radio buttons on a slide. I do not have a default so that none of the radio buttons are initially selected.
I want to hide a continue button until one of the radio buttons is selected. Is there a way to know when any of the radio buttons are selected?
Roll Over One Button To Show Possible Buttons
I am using flash MX to make a website.
I need help on making a button that when roll-over, some possible buttons (roughly 3 to 5) will appear next to it.
Can anyone help me to use the simplest way to get the effect done.
Problem With Button That Expands Over Other Buttons
I have a series of buttons which have dropdown menus on rollovers. The Dropdowns actually drop on top or in front of the other buttons, and when I rollover a button in the new dropdown it selects that button as well as the button underneath. And I have no idea how to stop this...
Any ideas would be greatly appreciated...
MC As Button With Buttons Inside (Not Working)
As part of a drop-down menu I'm using a movieclip as a button using _up, _over, _down labels and a separate movieclip as a hitArea.
Also inside this movieclip are additional, traditional buttons.
The traditional buttons do not work.
What are the workarounds or what is the best practice in this situation?
I made a dummy fla to try to narrow down the problem - if anyone wants to see it I will attach it.
Thanks for your time
Jim
Selecting 2 Buttons Turns On 3rd Button. Possible?
I am trying to set up a flash file that when 2 buttons are selected a third button becomes active for use. I can create the 2 buttons to turn on the third one when each one is selected independently but i need the 3rd button to become active only when buttons 1 and 2 are selected at the same time.
i think it would fall under an if statement but not sure how to get the 3rd button to listen to both buttona at same time. Please help
[F8] Buttons On Top Of Big Button, Focus Issue?
Hi,
I have a large mc which contains about a dozen buttons.
when you mouse over the large mc it fades in using code in a control mc.
I put this on the large mc to trigger the control mc
Code:
on(rollOver){
_root.MenuControl_mc.gotoAndPlay("FadeIn");
}
on(rollOut){
_root.MenuControl_mc.gotoAndPlay("FadeOut");
}
that much works fine, it fades in and out on mouseover.
BUT the buttons inside do not work as the large mc has focus. I expected this.
What is the right way to go about doing this???
thanks mark
Nesting Buttons? Button Within An Mc Fuction
I have a scrolling thumbnail panel. So i have a bunch of thumbnails that are also buttons. They are all contained within one mc. Where should i put the script for these buttons if i wanted them to open an image in a holder i created? I know i had to write extra script in the main timeline to enable the buttons rollovers to work within this mc. I tried all different stuff, and i'm going crazy. Maybe someone that is smarter than me has some insight? please! The link to the fla is below. Thanks in advance flash geniuses.
www.rb-assoc.com/download/Matt/panel.fla
This is how my loader and holder are scripted
var mcl:MovieClipLoader = new MovieClipLoader
var mclL:Object= new Object();
imgLoader._visible = false;
mclL.onLoadProgress = function(target,loaded,total) {
imgLoader._visible = true;
imgLoader.percent.text = Math.round((loaded/total) *100) + "%";
}
mclL.onLoadComplete = function() {
imgLoader._visible = false;
imgLoader.percent.text = "";
}
mcl.addListener(mclL);
girl1.onRelease= function(){
imgLoader._visable = true;
mcl.loadClip("girl1.png",holder);
}
ashleyPhilApe.onRelease = function() {
loader._visable = true;
mcl.loadClip("ashleyPhilApe.png",holder);
}
Dynamic Buttons And Button Events.
I can create any number of buttons dynamically, I assumed that following code created a function exclusively to each dynamic button.
Code:
target.onRelease=function() {
}
However it seems that only the last created button has the functions.
Because if I created 5 buttons and placed them on my scene, and then click on , say, the 2nd created button, my drag is applied to the 5th button.
How can I set it up so that each button has a function ?
PHP Code:
var i = 1; //copy index and depth
//create buttons
Btn_Insert.onPress = function() {
target = attachMovie("Btn_Player", "Player"+i++, i);
target._x = Btn_Insert._x;
target._y = Btn_Insert._y;
target.nr = i;
startDrag(target, true);
//target.onPress = function(){
//trace("Hi, I'm "+this._name+" and my number is "+this.nr);
//}
//define functions for button events
target.onRelease=function() {
target.me = "my name is me" +i
stopDrag();
}
target.onPress=function() {
startDrag(target,true);
}
}
The reason I am choosing this method over having my code in my button action script, is because each button will hold some data
Code:
target.me = "my name is me" +i
And I am told that I cannot have access to a variable that is inside of a button.
Mc Buttons Inside A Mc Button Problem?
Hi there, I am really, really new to flash and not very confident with actionscript. My problem is that I have Square MovieClip Button, and then nested inside the Square button I have another MovieClip Button. I cant get the button that is inside to perform its rollovers once the large Square button has been rolled over. The effect that I eventually want to get is that the large Square button will be a image and once you rollover the image, the image will change and a couple of rollover buttons will appear on top of that image. I have supplied an attached file. I would really be grateful if some one could have a look at this file and see what I am doing wrong. Thanks.
Buttons On Movie Clip Button
I have the actionscript for my movie clip button:
portfolio.onRelease = over;
portfolio.onRelease = out;
function over() {
this.gotoAndPlay (2);
}
function out() {
this.gotoAndPlay (1);
}
But the thing is that I have buttons in that movie clip that want to go certain frames in the main timeline. How can I make them to work instead of having the submenu disappear on me?
(Please do not mention of the usage of rollovers because there are GAPS between the menu and the submenus themselves and I just had to go to fix it by making the out function a release.)
Button Class - Reposition Buttons
Hey, having some troubles wrapping my head around how to do this. basically i use my button class to create some links, and what I want to accomplish is when you click a button, it swaps places with the currently selected button (which is always in the same place). I create a new class for each button:
Code:
var yPos:Number = 20;
var lineHeight:Number = 20;
var photos:ButtonMC = new ButtonMC(yPos+=lineHeight);
photos.buttonText.text = "PHOTOS";
addChild(photos);
var store:ButtonMC = new ButtonMC(yPos+=lineHeight);
store.buttonText.text = "STORE";
addChild(store);
var resources:ButtonMC = new ButtonMC(yPos+=lineHeight);
resources.buttonText.text = "RESOURCES";
addChild(resources);
var home:ButtonMC = new ButtonMC(yPos+=lineHeight);
home.buttonText.text = "HOME";
home.buttonText.textColor = 0xFF0000;
addChild(home);
As you can see the home button is red (for selected), so if you were to click on resources, resources would go in the home button position and become red, while home would go in the resources position. I can figure this out if it was not using a class, but I have no clue how to do it as is. Thanks for the help!
Click 2 Buttons By Clicking On 1 Button
I have button A and button B. When the user clicks on button A, I want button B to be clicked at the same time. Is there a way to tell button B to click if button A is clicked?
Multiple Buttons - Button On Hover Always On Top
Hi all,
As an example of what I'm doing, picture a map of Europe, divided into countries. Each country (which is a button) is obviously touching one beside it (if they share a border), and the countries are all on their own layer. The problem is, some countries that touch other countries have their 'glow' effect appear behind a country beside them (if they are on a layer below the other layer), and I want whatever country the mouse is hovering over to be always on top.
My question is, what code can I attach to each button to ensure that when I hover over it, it will be on top of the other buttons, regardless of what layer it is on? Also where do I put the code?
Thanks!
How To Disable Other Buttons When A Button Clicked
I built an app that has 5 buttons that each can play a movieclip. How do I prevent someone playing a second or third... movieclip after one has begun to play?
I have played with the enable property but I don't seem to be able to get it right. The buttons are on the parent stage, not in the movieclip. Their instance names are mycase1_btn, mycase2_btn, mycase3_btn, mycase4_btn, mycase5_btn.
Removing Buttons On Release Of Another Button
Hi all,
I'm pretty new at actionscript so I need some help here. I have three buttons on the same layer. Their instance names are HELP1, HELP2 and HELP3. When a user clicks HELP1, I need the HELP2 and HELP3 buttons to disappear. Furthermore, I need to swap the HELP1 button to another plain graphic object in my library that says "Help Requested" and loses it's button functionality.
Help!?
Thanks,
Dominic
Link On Button Also Affects The Other Buttons
I've got a 1 button which is used to create 5 buttons in total in an MC.
But obviously putting the get url code on 1 button will do the same for the other 4.
How can I get round this.....
Shallroc *_^
Custom Buttons/MX Button Component
I'm sure custom buttons act differently than the mx button component, and that is why I'm having this problem...
I'm working on a project where the actionscript is all inclusive in its own file (I'm trying to be a good OOP programmer in flash here)
For this project I had a regular mx button within the fla, I gave it an instance name and properly linked it so within the .as, I was able to say:
[actionscript]
my_btn.addEventListener("click", myObject_eh);
[/actionscript]
you would click on the button and it would work.
However I do not want to use the regular mx button so I created my own button, same instance name and everything what is the proper syntax to get this to work in similar fashion
thanks in advance for your help.
-noble
Dynamic Button AS 3 And Complex Buttons
Hello, I've got an issue with buttons in my flash navigation buttons being both dynamic and connecting with html via swfobject and staying in the down state once clicked. Everything thing I've tried only lets me do one of the above at the time, not both. Could someone please help me combine the AS or give me some tips on how to resolve my problem another way? Oh, by the way, I'm a total noob to AS, but I really want to resolve this issue!
AS for the button, "DynamicButton" mc will only work with this:
HTML Code:
left_btn.addEventListener(MouseEvent.CLICK, btn_math);
function btn_math(event: MouseEvent) {
import flash.external.*;
var attriURL:String = "math.html"; //The URL of the page that you want loaded
var attriID:String = "rightcolumn"; //The ID of the div that you want it loaded in to
var jsFunc:String = "ajaxpage"; //The name of the function
ExternalInterface.call(jsFunc,attriURL,attriID) //I bet you can understand this part :)
//import flash.external.*;
// The name of a JavaScript function to call
//var callJasFunction:String = "callJavascript";
}
For the down state: edited version of "ButtonTypeOne" mc from onebyonedesign's Complex Button design.
Any help is much appreciated! Thank you!
|