Movieclip Be A Button?
Is there away you can code a movieclip so when your mouse moves over the 'button' you can get actions like a drop down menu appears? Is that possible or do I have to work it as a button?
FlashKit > Flash Help > Flash General Help
Posted on: 08-19-2003, 05:01 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Button Inherits Movieclip And Movieclip Button Properties
Hi,
I am working on a component to blur pictures and use it as buttons. I got it all working but found something I do not completely understand. May be somebody knows the answer. Since movieclips can also be used as buttons I started to define a new class (I show only fractions of the script):
PHP Code:
MovieClip.prototype.createBase=function(eqClip,eqClip_1,eqClip_2,tPress,tRover,tLoad){
and so on...
}
if(tPress){
tRover=false;
tLoad=false;
this.onPress=function(){
//count will advance here.
count++;
//first we fade out the pic
fadeOut();
}
}
if(tRover){
tPress=false;
tLoad=false;
this.onRollOver=function(){
count++;
fadeOut();
}
}
if(tLoad){
tRover=false;
tLoad=false;
this.onLoad=function(){
count++;
fadeOut();
}
and so on..
Button.createBase(eqClip,eqClip_1,eqClip_2,tPress,tRover,tLoad);
Actually "button" is the name of a movieclip, which inherits the new properties. I can now put instances on stage and write something like:
button1.onRollOver=function(){
this.Button.onRollOver();
}
button1.onRelease=function(){
textField.text="This is button 1 in action.";
}
This will do all what is supposed to do.
But when I change the name of the Movieclip to "myBut", it only performs the blurring but I cannot use it as a button any more and onRelease does not work. In other words if we name a movieclip "Button" or "button" it will automatically inherit button properties. Is that the case? Anybody heard of that?
Control A Nested MovieClip From A Button Component Inside A Seperate MovieClip.
I am a beginner in using Flash and Action Scripting.
This is the Scenerio:
I want to control a movieclip that is inside of another movie clip.
I control it from a button component that is inside of a seperate movie clip.
test = button component instance name
test1 = function
test2 = Movieclip instance name
test3 = Movieclip instance name
testbutton = movieclip name where button component is located
I am able to control a movieclip on the main timeline with the following AS 3.0:
test.addEventListener (MouseEvent.CLICK, test1);
function test1(event:MouseEvent):void
{
event.target.root.test2.gotoAndPlay(2);
}
I want to control a movieclip inside MovieClip1.
I tried this:
test.addEventListener (MouseEvent.CLICK, test1);
function test1(event:MouseEvent):void
{
event.target.root.test2.test3.gotoAndPlay(2);
}
The movie loaded fine when I tested but got this error when I pressed the button:
TypeError: Error #1010: A term is undefined and has no properties.
at Untitled_fla::testbutton_26/test1().
Please help!!!!!!!!!
Loading A Movieclip On The Main Stage From A Button Within A Movieclip - Big Headache
Hi there,
i am trying to put together a portfolio site, which uses a 'floating' panel with buttons on it. In order for it to move around it has to be a movieclip. So all the buttons are stored within a single movieclip, which is giving me a headache because i want those buttons to load other movieclips from my library onto the main stage (as like a popup window within the flash)
Its all slightly confusing. i have tried using this code based within the movieclip where my button is based:
button_play.buttonMode = true;
button_play.addEventListener(MouseEvent.CLICK, OpenBox);
function OpenBox (e:MouseEvent):void{
this.addChild(new mc_box());
}
button play is within a movieclip called mcTweenMe2 (which is on the main timeline) and i want the movieclip to be loaded on the main timeline (not within in the movieclip where the button 'button_play' is based) mc_box is the movieclip i wish to load on the main timeline (in the centre) with the ability to close it also!
Bit of a headache, please help me someone i have run out of sites to look for answers!
PS: does anyone know why stop (); wont stop my timeline playing like it used to in AS2? beacause another option for making my site work is making this button target labeled frames in the main timeline, however stop (); don't seem to work now!
Thanks!
[F8] Control Movieclip From Button Inside Another Movieclip
ok. I have the Main Timeline..on the stage i have "side_menu_mc" inside that i have "menu_menu_mc"."slider" is menu_menu_mc's Instance name.
Inside "menu_menu_mc" i have a button (services_btn)."button_1" is its instance name. Upon clickin on this button, i want a frame labelled "services" (frame 18) in "side_menu_mc"'s timeline to display.
i attempted this.after some googling.but it does sweet nothing.
Quote:
Originally Posted by my shizer code
menu_menu_mc.services_btn.onRelease = function() {
trace("button pressed");
_root.gotoAndStop("services");
}
How To Make A Movieclip Button Open Another Movieclip?
What is the code to make a movie clip button....when pressed...open or plays another movieclip...example...
i have a button..and its a movie clip with roll over and rollout effect..once pressed...how do i make it link to an outside movieclip...(outside the buttons layer)
Playing A Movieclip From A Button In Another Movieclip?
i have a mc with a button in it. when i click the button, i want another mc to play 'over the top of it'
i think this is to do with levels (is the second mc at level1 or 2? and how to i target it from my button (with actionscript?)
thanks in advance
Align A Movieclip To A Button/another Movieclip?
Hey guys
I have a movieclip that contains a MC which my user has created a dynamic polygon and a button. I can scale the button to the same size as the polygon MC but cannot figure out a way of aligning the button - anyone got and suggestions?!?
Thanks in advance
Ol
Control Movieclip From Button In Another Movieclip
I've been searching and searching for the answer to this newbie problem, but I can't find it, so I hope someone won't mind pointing me in the right direction.
I have 5 buttons within movieclip (1); movieclip (1) is located on the main timeline. I'm trying to get the buttons to jump to a certain frame of movieclip (2) which is also located on the main timeline.
The code I've been using for, say, the first button is:
Code:
Code:
on (release) { _root.mainwindow_rooms.gotoAndPlay("lounge"); }
"mainwindow_rooms" is both the library name and the linkage identifier of movieclip (2). It doesn't have an instance name on the stage (is that relevant?)
I can't get this to work. Can someone please help me with this? I have no idea what I'm doing wrong, I'm not very good with Flash.
[F8] AS2.0 Problem With Movieclip Used As Button Within Another Movieclip.
Hi Guys
Ive been battling with a problem in my flash script.
I have a button on the _root that is setup for the onrelease event. when the on release event happens another movie clip also on _root that contains 3 movieclips inside plays a tween motion moving the movieclips into place(its a fly out menu).
the problem im having is that none of the on events are working, Im not even getting a hand over the movieclips, I have given everything the correct instance names but no luck. I do get the onRelease to work if i remove the tweens and have only the movieclip on the first frame.
I have attached my file for further investigations.
All help would be appretiated.
Regards
Pixel
Playing A Movieclip With A Movieclip Button
I am using AS 2.0 I have an animated movieclip (holder_mc) that contains 4 buttons (one is profile_btn). I also have a seperate movieclip named profileTitle_mc. I guess my question is how do I go to different frames of the main timeline from a button inside a movieclip? Right now, holder_mc is on frame 2 of the main timeline and profileTitle_mc is on frame 3 of the main timeline. I've switched the code around a lot, but I can't get the button to switch to the 3rd frame.
this.buttonHolder_mc.profile_btn.onRelease = function() {
this.gotoAndPlay(3);
};
If there's a better/easier/foolproof way of doing this please inform me
Thanks!
Movieclip Within A Movieclip Button Issue
The 2nd box is the one with the movieclip in it. When you rollover the box (keep in mind that your cursor has to remain on the box in order for the entire movie to play), it animates. When the box animation is complete the second movieclip plays. it plays the first logo, but the next and previous buttons don't work. How do i get the next and previous buttons to work? The fla is below
www.geocities.com/demetriusmcclain/services.fla
How To Use A Button In A MovieClip To Load A Swf Into A MovieClip
Hi,
I'm trying to use a button contained in a movie clip on the stage to load a SWF into another movie clip on the main stage. I have gotten it to work when attaching the action script directly to the button, however I would like to have all my action script contained in one frame. Any ideas on how to accomplish this?
I'm using ActionScript 2.0
Thanks,
Adam
Help With Movieclip/button Containing Sub Movieclip/buttons
Hi Im trying to create a certain type of button.
An example of this type of button can be seen on the navigation on the following website:
www.minipixel.com
The rollover button contains a movieclip and inside this movieclip ther are several other rollover buttons which lead to other sub-movie clips.
Does anybody have a similar working example so as I could look at the actionscript I cant seem to find anything online?
All help would be much appreciated...
Directing Movieclip With Button Outside The Movieclip..
Hello I've got a very simple question where I cant really find an answer to. I've checked my old files to see if I did it before, but I couldn't find anything. Here it goes:
On the mainstage I have a button and a movieclip. If I press this button I want the movieclip to gotoAndPlay a frame which I labeled "one". The thing is however that I forgot the code for the button to do this.
Code:
on(Press){
gotoAndPlay("one");
}
I know something has to go in front of gotoAndPlay but I forgot what. The movieclip's name is symbol 1, and its labeled movie. I also posted the simple flash file.
http://www.xs4all.nl/~karhen/Flash/
This problem should not be very difficult to solve, and it would really help me in developing future websites. Who has the answer??
Button [ ] On Click Goto Frame 2 [X] Movieclip X Mark Button
Ok I have a movie clip first frame looks like this [ ] second frame looks like this [X] I want to apply action script to it that says on press goto frame 2. Then another that says if on frame 2 go back to frame 1! But I'm kind of lost here I don't how to make this happen!
Movieclip.button Methods Versus Button Symbol
I was attempting to include a MC animation (which has a MC using the button methods, i.e. MC.onRollOver) within my button symbol...
I placed it into the "over" frame in my button symbol, and nothing....however
When I just used the MC (that uses the button methods) alone, no problems, as long as my path was correct.
This triggered a thought, why use the button symbol when the Button methods could be placed upon a MC?
[F8] Replacing Button With Movieclip On Button Press
Hello.
I am kind of new to flash and very new to ActionScript so please help me with this script which probably seems easy for many of you.
I am attempting to create a simple game on flash.
I have a button on stage. The buttons name is "diff1".
I need it so that when the button is pressed, it replaces itself with a movieclip or graphic called "diff1_2".
"diff1_2" needs to be in the exact place where "diff1" was.
If this is any help, these are the X and Y coordinates for the button, "diff1":
X: 466.0
Y: 344.4
I need the button to be replaced with actionscript and not with frames.
Please help me and reply back with a code and tell me where to place the code.
Early thanks for those who reply!
Movieclip Covering A Button... How To Click The Button?
I'm using vCam in a project right now, and I'd like to be able to have clickable hotspots on the screen... but the problem is that the vcam movieclip sits on top of the buttons and therefore makes them unclickable.
How do you deal with this in as3? Is there a way to make sure you only get the hand cursor when you're over the button even though the vCam clip is in the way? I've attached a small file demonstrating the issue.
How To Edit Button Actionscript So It It Can Be Put On To A Movieclip Button
I was using a tutorial from Kirupa (I'm a real beginner by the way) - Complex Button Rollover/Rollout effects http://www.kirupa.com/developer/mx2004/button_effect.htm
and I would like to change the last part of the action script
Code:
this.onRelease = function(){ getURL("http://www.kirupa.com","_blank");}
with this button action
Code:
on (release) {
if(_root.currMovie != "collectionsb"){
_root.currMovie = "collectionsb";
containerone_mc.loadMovie("collectionsb.swf");
}else{
if (containerone_mc._currentframe >= containerone_mc.midframe) {
containerone_mc.play();
}
}
}
so that on release of the movieclip button an external file
Quote:
collectionsb.swf
will open into a container
Quote:
containerone_mc
I realise this is probably a very simple problem but I don't know how to change the code Thanks in advance
I have attached an example if it helps
How To Edit Button Actionscript So It It Can Be Put On To A Movieclip Button
I was using a tutorial from Kirupa (I'm a real beginner by the way) - Complex Button Rollover/Rollout effects http://www.kirupa.com/developer/mx2004/button_effect.htm
and I would like to change the last part of the action script
Code:
this.onRelease = function(){ getURL("http://www.kirupa.com","_blank");}
with this button action
Code:
on (release) {
if(_root.currMovie != "collectionsb"){
_root.currMovie = "collectionsb";
containerone_mc.loadMovie("collectionsb.swf");
}else{
if (containerone_mc._currentframe >= containerone_mc.midframe) {
containerone_mc.play();
}
}
}
so that on release of the movieclip button an external file
Quote:
collectionsb.swf
will open into a container
Quote:
containerone_mc
I realise this is probably a very simple problem but I don't know how to change the code Thanks in advance
I have attached an example if it helps
Movieclip Over Button -> How To Disable Button?
hi,
maybe the solution is very simple:
How can i disable a button if a movie clip is in a level over the button? is it possible to catch the clip event by a movie clip so that the button is disabled?
thanks
tobias
Controlling A Movieclip Within A Button From That Button...
Searched and couldn't find an answer, so i have to ask..
I've got a button (menu_item_home) that has a little movieclip instance (homebottom) within it that plays upto a point when the button is rolled over. When you rollout of the button i want the movieclip to play the rest of it's animation, but i can't get it to work. I'm sure it's a problem with the levels and referencing the clip, but i can't work out what's wrong. Anyone?
On the button:
Code:
on (rollOut) {
_root.top_menu_movie.menu_item_home.homebottom.gotoAndPlay(8);
}
Button In Movieclip In Movieclip Can This Be Done?
i have created a movie clip containing a sroller using actionscript, in this movie clip in this there is a another movie clip containing the pictures and buttons on separate lavers (the bits that scroll)
i have set up one instance of the button which has a onrelease gotoandplay action to scene1, (frame label) project 1
this should move the main timeline to the label and trigger another movie clip, but dosent can anyone shed any light on this
regards jason
i would be more than happy to email the flash document if someone is prepared to take a look
Button In Movieclip Of Movieclip
Ok, I could really use some help here. I've looked through the Board but didn't find anything that could explain it to me.
I have a button(button1) in a movieclip(Thumbs), which is in a movieclip that gets preloaded into level2 of my main movie.
I want to execute the photochange function (which is in the main movie timeline), from that button, which is where I think it has to be done. I also tried putting the photochange code on the button itself, but I don't think thats right.
This is the code on the timeline of the main movie. But its not working. Anything obvious that I am doing wrong.?
_root.level2.Thumbs.button1.onPress = function(){
trace ("test");
photochange(counter="0001");
};
Thanks in advance for your help.
Movieclip Button Within Movieclip
Hi,
I'm having some problems. I can't get a movie clip to act as a button once it is within a movieclip..... is there a way to do this.
E.g..
1mc (is the first movie clip)
2mc (is the second movieclip)
I enter the 1mc and it starts to play 2mc (from within 1mc), i can not now get 2mc to become a btn, i have tried using the target path finder in the actionscript page, both in relative and absolute, but no joy. Is there a way to call this mc up as a btn?
Cheers.
Movieclip Button In Movieclip?
i have put the attached code in a frame, that's in a movieclip. gotei13_thumbnail is a movieclip, that's in the same movieclip as the script.
why does this not work?
if i copy the script to a frame on the main timeline, and copy gotei13_thumbnail to the main timeline, it works just fine.
i'm guessing there's some more script i have to add?
please help me, asap. thank you.
Attach Code
gotei13_thumbnail.onRollOver = function(){
gotei13_thumbnail.gotoAndPlay("over");
}
gotei13_thumbnail.onRollOut = function(){
gotei13_thumbnail.gotoAndPlay("out");
}
Edited: 05/23/2007 at 01:20:19 AM by setiawankla
On (press) {... Button Starts Movieclip Starts Movieclip...
i'm no flashcrack, but you all are, thats why i ask you!
i have the following prob: a movieclip starts after loading. if a button is clicked to proceed to the next theme the visible movieclip has to (e.g.) fade out (framebased). after the fade out, a second clip has to start (background change, not framebased). during the last frames of that clip a third one starts with the content for the actual theme (framebased). the original clips are built in diff. layers, so that "tellTarget" is used.
right know it works in a basic way, which means: every clip start after the button-click. is is not synchronized.
any idea?
thanx 2 all gurus.
giz
Button In Movieclip
Hi! Need some help here!
I made a movieclip with a button to go to another scene (scene3). On release gotoandplay scene3 doesn't work.
Please help.
thanx al lot
Button In A Movieclip
Hi
I have a button in a movieclip that needs to take me to another scene, once clicked on. I kow there is an expression that uses frame labels, but I can not remeber it.
Thanks
Button Under Movieclip
hello,
i have several movies and buttons. buttons make associated movie visible, and when "closing the movie" the movie becomes invisibe.
while the movie is being played, the buttons underneath are still active. is there any way i can stop this?
does anyone know actionScript equivalent of Lingo's MIAW ".modal = TRUE"?
please have a look at url;
http://www.gomi.btinternet.co.uk/script_01.htm
thank you.
Button Over, Out Movieclip
How do you do a button that play a movie clip on over and play the movie clip backward to start when mouse out???
/Fredrik
Button In A Movieclip
Who can help me with this problem??
I'm making some sort of menu with scrolling. The scrolling part is no problem but instead of text I want to use buttons in the scrolling part. But when I place them in there the buttons don't work anymore? I think it is because the buttons are inside a movieclip and that's the reason they don't work anymore.....
They myst link to the same scene but to a different frame label.
Please help me with this...
thanx in advance.
Bart
MovieClip / Button Help
I have been trying to have a movieclip play on the release of a button and have come to the last resort of asking you guys. Could you please tell me what actionscript I have to use to get it to work? Any help will be appreciated since I've been stuck on it for a day trying to figure it out. I really want to continue on with my movie. Thanks.
Button In MovieClip
I know this question has probably been asked a million times but I am forgetful. I have a button in a movieclip and I want the button to head on to the next scene first frame. This is what I have in the button.
on (release) {
_root.gotoAndPlay("Scene 5", 1);
}
What should I do??
Button Within A MovieClip
Ok, I have a problem.
I have three scenes. The first scene contains a movie clip with two buttons in it.
The other scenes are just there for space fillers.
The buttons within the movieclip in the first scene point to the other scenes.
My problem is that the buttons do not work within the movie clip, only outside the movieclip.
What do I have to do to make them work within?
Button And Movieclip
hi,
I made a movieclip with buttons in it.After that i inserted a scrollpane and i linked the movieclip to the scrollpane ,but the buttons don't work anymore.Can someone help me please.Thanks
pietervdb2@pandora.be
Button > Movieclip
Gotta button nested in a MC. Lost my animation for the button. Can't for the life of me figure out how to get my "down" animate to work. Quick answer? Thanks.
Movieclip As Button
I'm trying to make an animated button (on rollover and rollout), I use Flash MX and this is the code I'm using;
on the main timeline;
clipname.on (rollover) = function {
this.gotoandplay (frame label)
}
clipname.on (rollout) = function {
this.gotoandplay (frame label)
on testing I recieve an error message "expected a field name after '.' operator" for both lines of code.
Please, what did I do wrong?
MovieClip In A Button
Here's what I'm trying to do:
You click a black button and sound starts playing. While the sound is playing the button is green. When you click the button again, the sound stops and the button turns black again. I can get the sound to work but not the black-green-black part.
I've built the button and have tried putting a movieclip containing a green box in the up state. Attached to that clip is an on load command setting _visible to false. It never goes false, you can always see the movieclip.
The movie clip doesn't seem to be following the rules when it's in a button. Could the button's characteristics be superceding the movieclips characteristics? If so, how do you get around that?
Thanks.
Layne Smith
Button Within Movieclip
I have some buttons inside a movieclip. I have on(rollout) function attached to the movieclip. All the buttons within the movieclip don't work anymore. If I remove th on(rollout) function from the movieclip, the buttons within the movieclip work again. It seems that you can only attachment mouse event functions to on or the other but not both. Doesn't anybody know if there is anyway around it?
Button In A Movieclip?
Greetings all,
I have run into another problem. This time with an animated menu movieclip.
I've searched a few times, but didn't get the answer I was looking for.
I am using Frame Labels.
I have a menu of five buttons.
One of the buttons I've turned into a movieclip of a submenu sliding out from under the main menu when you rollover it.
Inside the submenu movieclip, I have five more buttons.
When one of these buttons is pressed it should send the user to a new frame in the main movie, not the movieclip.
The movieclip is just for sliding the submenu in and out.
I am using the following actionscript for the buttons in the submenu:
on (press) {gotoAndPlay("FrameLabel");}
The submenu disappears when I press the button, so I know SOMETHING is happening, but I am not being sent to the new frame.
Whatever frame was playing on the stage before I pressed the button is still playing on the stage after I press it.
I am thinking that it is looking for the FrameLabel in the movieclip instead of in the main timeline...?
Can anyone point out my mistake here?
Thanks in advance.
Movieclip Button AS
I've fogotten how to scipt a 'click' on a movieclip, you just use the hittest for the rollover and rollout, but how do you detect a click on an movieclip?
I know Dan Nansi does it all the time, but i don't think he's talking to me anymore.
thanks everybody, peace ~
MovieClip Act Like A Button?
Hi, I have a movie clip that when the mouse goes over it, I want it to go to a certain frame.
I would prefer not making blank buttons all over my movie, so is there a way to make the MC have functions like a button? I tried changing the properties of it, but the code:
code:
on(rollOver){
this.gotoAndStop("over");
}
didn't work. Anyone?
Button In MovieClip
I have a button inside a movieclip.
In this flash i have 3 scenes Intro,Home and Register.
When i click on the register button after i got into the "Home" scene by another button in the "Intro" scene, it won't work.
The Register button in the home movie clip just won't work.
I supect it is that, my Intro scene is the 1st scene that the project loads and after that comes the home and then the register scene
This is the code i typed in:
on (press) {
_root.checkRegister=true;
_root.gotoAndStop(200);
}
Can anyone please help.
Thanks
Movieclip Vs Button
why with button object, we can use:
button.onrelease
goto(10)
to make flash go to timeline 10 when user click on the button while for a movieclip:
movieclip.onmousedown
goto(10)
this doesnt work and have to use a function
movieclip.onmousedown = function() {
goto(10);
}
why is this heppen? anyone?help please.
Movieclip Act As Button?
I have a movieclip that is a square. I don't want it to be a button because I am going to have buttons over it and when that happens only the button on the top works. I want the movieclip to act as a button. I want it so that when you rollover the movieclip it starts to play. What is the best way of doing this. How would I do this (what would the code be on the movieclip)?
NOTE: I tried just to make it a button with the hand cursor not showing, but when I put another button over it then that button underneath doesn't work... so I need to keep it a movieclip.
Thanks for any help you can give me.
Button In Movieclip
I have created a simple MC, which is a door opening then stops at the end, i place a button at the end inside the door with an
unloadmovie(target) as I want to load another movie once the open door has been clicked.
It just wont work! I tried the same button on the main timeline scene and its fine, but it wont work inside the MC?
Anyone help?
Thanks
|