ActionScript 2.0 :: Four MovieClips - Interactive Two Or More Buttons
Jan 14, 2009
I have four movie clips on stage, I change those to buttons with onRelease script. Each movie clips have 2 frames ON and OFF when I click one of them, active other movie clip normally but my buttons don't work well. I want when I click one of them this button go to frame 2 and stop and other buttons go to frame 1 and stop.
View 3 Replies
Similar Posts:
Mar 3, 2010
I am currently working on a map of the US that is interactive. My goal is to be able to mouse over the states and have them turn red and then a window with contact information will open at your mouse when clicked. I am running into a few problems. I dont know the process for creating a color tween for my movieclips. my solution was to make a copy of the states, color them red and place them behind the gray ones and attatch an event listener to all the states that lowers their alpha when moused over. thats not really the problem though. for my code that i have used to call in the window is as follows. I will use texas as an example.
[Code]...
View 5 Replies
May 21, 2007
I have a minor problem implementing an interactive photomontage section to my site. By that I mean lots of images which can be dragged about by the user to create one larger whole image. Like this (but much simpler, only 12 or so images on the stage): [URL]. So I'm putting the images inside a movieclip as I can use the startDrag and stopDrag actionscript commands so the user can drag the images around.
Here's the code I'm using on each movieclip image:
on (press) {
startDrag(this);
} on (release) {
stopDrag();
}
The problem I have is that I have two photomontages (2 set of images). The user clicks on a thumbnail in the lower right corner to select which one. Each button fades in the appropriate images, and fades out the other set - this is fine. The problem is that obviously the set of images on the highest layer (the Abbey set) are still on the stage but are just faded out (by movieclip tween alpha), so they conflict with the Statue set. Ie. when you try and click and drag an image in the Statue set, you can't get hold of them as you are really dragging the invisible Abbey set around still. I've attached a FLA file which demonstrates this problem. Click on 'BTN1' or 'BTN2' to change the set of images. The Abbey one works fine, but when trying to drag the statue one, the Abbey one if hidden on top will cause problems.
Here's what the section looks like in my project (thumbnails to select which):
Abbey images:
Statue images:
I've tried wrapping the startDrag commands inside an if statement that held a true or false, then put true or false in the appropriate places inside each image movieclip to represent when it is visible or not. I thought this would work, but it doesn't. I also tried putting the set of images at slightly different points in the main timeline, so they were never on top of each other, and then jumping to that point in the timeline when selecting the thumbnails. This kind of worked, but weirdly I had to click twice on the Statue set for them to show (fade in).
View 4 Replies
Mar 13, 2010
i'm Currently creating an interactive video game. There are 66 movies. I'm new to AS3, and have little experience in AS2.
The game in short:
You choose from 5 ingredients, each has this product provides a number of calories:Rice R = <- for all standard!
[code].....
View 6 Replies
Mar 13, 2010
I'm Currently creating an interactive video game. There are 66 movies. I'm new to AS3 and have a little experience with AS2. I will try to explain the game! You choose from 5 ingredients, each has this product provides a number of calories:
Rice R = <- standard value!
Mais =-C
Roots =-W
Tofu =-T
Onions =-U
Champions =-M
Each ingredient can be added only 1 once.
Good combinations:
R-U-T-CR-U-C-TR-T-U-CR-T-U-CR-C-U-TR-C-T-U
Each movie is in a movie clip. And the frame where the movieclip is on, is labeled with the combination. For this I wrote the following script:
ActionScript 3 Code:
stop ();
var caloriesVar: Number = 10, / / default Rice
var inpanVar: String = "R", / / R = Rice
iLabel.info_txt.text = (caloriesVar);
iLabel.info_txt2.text = (inpanVar) / / idem
[Code] .....
But this does not work. When you click a button, the script doesn't do anything. Do not know where it goes wrong because he does not update the text fields.
View 2 Replies
Jul 22, 2009
I have an animation that I want to keep buttons active at the end.
I don't want it to loop, because there's an intro and I don't want the intro to keep playing, so I unclicked Loop in Publish Settings. The intro plays for several frames...then it stops on the last frame. The movies continue to loop, but my button becomes inactive. It's active during the intro, but then stops on the last frame when the animation stops.
I've tried nexting the button inside a movie, but that didn't work either.
I'm figgerin that I need to not let the animation end, but somehow loop on the last frame instead. I'm sure there's an ActionScript for it, but I've been searching and trying different ones, and I have no idea which one to use or how to make it do what I need it to.
View 1 Replies
Aug 14, 2011
i'm making a few buttons to be interactive with each other, for example my question is based on this: I'm making a game where you can extract oil and sell it, but what i want to know is how can i show a text message when i hit a button? for example: Once i play the scene, i will have a few buttons (Buy, sell, check reserves) also i will have a few text fields which will be "linked" with these other ones for example if i click two times in BUY i want to have in the text field of OIL BOUGHT: 2 (this are the times i clicked before) Well,hope anyone can answer my question or at least recommend me an excellent book of AS3, i'm quite lost in this
View 1 Replies
Oct 6, 2005
can walk me through something like what this site has for its interactive menu? I don't even know what that kind of interaction is called, so I don't know what to search for.
View 3 Replies
Jul 26, 2010
I've created a sphere, and used a texture of Earth to create a rotating planet (using movie material). Is it possible to add buttons or other interactive objects to the material itself that will be clickable?Is there any other method for doing this (for example if I want something to happen when the user clicks on Australia...)
View 5 Replies
Oct 10, 2009
I am trying to make an interactive flash application that works by detecting mouse overs and clicks on various buttons/movie clips and then moves to the appropriate part of the time line. But I am having an issue when I use more than one addEventListener in any one frame. I have attached the code for one such frame below. When I comment out the addEventListner and the other code relating to the followBall function this works fine and directs the user to frame Inlet_Valve_Open_Frame but now only the followBall function is working and when i try to click on the Inlet_Valve_Button movie clip nothing happens.
I have never read all the help files on the adobe flash CS3 as i don't have time and i have built this code up based on examples i have found online. I wanted to include my fla file but it's to big 6Mb. But i have attached the swf so you have an idea what i am doing.
Code: Select allstop();
//1.
stage.addEventListener(MouseEvent.MOUSE_MOVE,followBall);
[code]....
View 1 Replies
Jan 21, 2010
I have been using Flash since it was Flash 3 and AS2 for about 3 years now. I have never ever ever been a fan of buttons. I find them limiting and icky. I just moved to AS3 and OOP this week (it's about freakin time, I know). I am just wondering who here likes to use buttons and why? Is there a point to them? I mean, apparently with AS3, you just have to add "mc.buttonMode = true" and you are well on your way to having all the functionality you need without all the hassle or up states and all that.I am open to adopting new techniques and strategies if they are worthwhile so I am just curious as to what the community thinks. What are the pros and cons to using MovieClips as buttons instead of using an actual SimpleButton.
View 6 Replies
Sep 25, 2009
ActionScript Code:
#initclip 1
//Constructor
FSimpleButton = function(){
[code]....
when to play the script. but then it should act as a button, but then it just stay and can't click on it.
View 0 Replies
Jan 20, 2010
I created a movie clip (let's call it "mysymbol") that contains several buttons, as well as functions for MOUSE_OVER and MOUSE_OUT events ("mover" and "mout"). Everything works when the mouse enters "mysymbol" for the first time (mover is being called), but if I move the mouse inside mysymbol to another button, the MOUSE_OUT function (mout) is being called first and then immediately mover. Obviously, I don't want there to be any function calling at all! I have found a way to circumvent this, but since I'm new at this I struggle to get it to work properly:
If mysymbol is a button instead of a movie clip, then I can move my mouse freely within mysymbol without triggering any MOUSE_OVER or MOUSE_OUT events. However, there is another problem: I somehow can't get movie clips to work inside a button(I assume this is by design), so how do I get my animations etc. to work inside this button? is there an alternative to using a button as a container?
View 5 Replies
May 8, 2010
I'm trying to create a portfolio site and I'm running into some problems. I've built my main site on the timeline and all my buttons work fine the AS is very simple:
function goForward(event:MouseEvent):void {
if(currentFrame == totalFrames) {
gotoAndStop(1);
} else {
nextFrame();
}} next_btn.addEventListener(MouseEvent.CLICK, goForward);
But when I make Movie clips of a scenes with buttons in them (children?) to try and simplify the site, AS doesn't seem to recognize the instance name for the button in the Movie Clip. I get an error message:
1120: Access of undefined property next_btn.
I've put an invisible button over the mc and given it the next_btn instance name and it works although I would like to fix the buttons in the MC properly. Is it better to condense a site into movie clips and single frames or should I just have a long linear timeline that spans many frames?
View 3 Replies
Feb 28, 2012
I want to temporarily deactivate some movieclips that are used as buttons. Currently I don't keep track of the EventListeners that got added to these buttons. I want to be able to deactivate and reactivate them later.
myMc.mouseEnabled=false;
works, but then they are still select- and clickable using the TAB key on the keyboard.
View 3 Replies
Jan 11, 2009
how to link moviclip to rotating buttons. the experiment button is working but do not know how to link the others.
View 1 Replies
Nov 3, 2010
I am trying to teach myself Flash with AS3, I am using Flash Pro CS5. I am making a website and I want to be able to press a button thats inside a movieclip to navigate to a given frame. Example, Two frames, frame 1 has a movieclip with a button inside a scrollpane. I want to click the button and go to frame 2. need a complete and detailed script for this if thats ok. Also, I dont know if this helps any but the code that I use for buttons on the main timeline is this:
ActionScript Code:
function button_clicked(e:MouseEvent):void{
gotoAndStop("frame2");
}
button.addEventListener(MouseEvent.CLICK, button_clicked);
View 4 Replies
Nov 22, 2010
How can I make an array that accepts only a single kind of element?For example, this:var arr:Array of MovieClip = [ mc1 , mc2 ];Basically, I want to do something like this:for ( var i:Number = 0; i<arr.lenght; i++ ) arr[i].alpha = 0.5;Of course, I could to it manually, but that's ugly, and I'll have to add a bunch of "if"s if I want to access the next element (as "if ( element == mc1 ) mc2.alpha = 0.5;")
View 4 Replies
Mar 19, 2011
basically I had a situation arranged where when a button was clicked and flash would then display a certain image by jumping to a label on the timeline, and by clicking a different button a different image would be shown. this was working pretty well but for layout reasons I had to split these buttons and the timeline that they relate to up into separate movie clips. obviously the buttons dont do anything now, but what i'm hoping to find out is how I can link these items back up despite them being in separate movie clips. is this possible?
View 0 Replies
Jun 7, 2011
I have 30 buttons on the stage each with a different instance name.
ActionScript Code:
private function init(e:Event):void {
removeEventListener(Event.ADDED_TO_STAGE, init);
btnArray = [h1_btn, h2_btn, h3_btn, h4_btn, h5_btn, h6_btn, h7_btn, h8_btn, h9_btn];
for each (var btn:*in btnArray) {
btn.addEventListener(MouseEvent.CLICK, checkClick);
btn.buttonMode = true;
[Code] .....
Not all of them only a snippet. Is there a short way of doing this. The only prob is each function will have a completely different piece of code in it eventually doing different things. I have 20 mc with 30 btns in each.
View 9 Replies
Mar 27, 2012
1. I have very little flash experience, but have been tasked with creating a presentation.
2. I have decided that if each slide was a movie clip, it would keep my timeline tidy.
3. In the attached fla, you will see there are 2 slides, with (green squares) for buttons. The purpose of the button in the first slide is to advance to the second movieclip in the timeline and the purpose of the button in the slide2 movie clip is to go to and play the label "start" from the first movie.
However, nothing I do seemed to work. I'm hoping someone can talk me through it so I can replicate the button functions throughout the file for multiple movieclips / 'slides'
I've attached a txt file with the URL to where the .fla can be downloaded
View 9 Replies
May 25, 2009
I have 9 movieclips, and 9 buttons. (mc1, mc2, mc3.... & btn1, btn2, btn3...)
I'd like it so that when you rollover the button, the corresponding movieclip begins an animation.
I thought I was on the right tracks here:
Code:
for (var i:int = 0; i < 8; i++) {
this["btn"+i].addEventListener(MouseEvent.MOUSE_OVER, onButtonOver);
this["btn"+i].addEventListener(MouseEvent.MOUSE_OUT, onButtonOut);
this["btn"+i].addEventListener(MouseEvent.CLICK, onButtonClicked);
[Code].....
I just can't seem to direct a tween to a corresponding movieclip dynamically.
View 2 Replies
Jul 30, 2004
I have a movie that has a movieclip containing some buttons in it. The buttons when pressed call up another movieclip within the movie the buttons reside. When viewed though the movieclip the button activate doesn't play? although when the scene is viewed within the movieclip the buttons reside the movieclip does play?
View 1 Replies
Mar 30, 2009
I have my main stage upon which I have 4 movieclips with buttons over the top of them. The movieclips are essentially boxes and are all on the left hand side of the stage. I am making a presentation of various projects I have been working on and the idea is that when I click on a button, the movieclip below moves slightly to the right (clear of the other buttons) and gets larger to fill the rest of the space on the stage. My project is then displayed in that box.
When I click on the button the movieclip underneath it is told to goto frame 2 and play. For this example lets call it MC1. Once the button is clicked it goes to frame 2 of MC1 and plays a shape tween (basically the box moves and gets larger). I disable all other buttons on the page. Once it has finished I have added a button in the top right to basically do the reverse (i.e move the box back to its orginal size and location. I then enable all of the buttons.
This works fine in principal because I can view all of the movieclips individually but just have to close them before I can look at the next one. The only reason I disable all of the buttons is because if I don't do that and happen to click on one of the other buttons they do the same thing as the first MC1, but MC1 stays in place and doesn't return to its original size. Is there actionscript to basically do the following:
1) I click on MC1 - it opens and shows my project.
2) I then happen to click on MC3 and it will close MC1 and then open MC3.
However, the order in which I press the buttons could be completely random so I could go from MC2 to MC4, MC 2 to MC1 etc. I know that I cant just add code that says on(release) of a button gotoAndPlay the frame that makes the Movieclip back to its original size, for all of the movieclips simply because not all of the movieclips are open it is just one of them. Is there some sort of script that remembers the last button or movieclip that was used? I am sure there must be some 'If' ''Then' statements involved but again I am stabbing in the dark.
View 2 Replies
Apr 9, 2009
I need to be able to click and drag multiple objects at the same time I can make it drag 2 objects but when I add another one it doesn't work?
View 2 Replies
Nov 19, 2008
I want to check if the stage is loaded with stuff. If it is, remove it and load my new stuff. If it isn't load my stuff.
View 1 Replies
Nov 26, 2008
I'm using AS3 with Flash CS4. I have three movieclips, all using buttonMode, which animates when the mouse is over the MC (MOUSE_OVER) and when the mouse leaves the MC (MOUSE_OUT), using listeners. Or in fact, when the cursor is over one MC the other two animates. My problem is that when i move the mouse cursor from one MC directly to another one, the MC's aren't done animating the MOUSE_OUT-animation before it starts to do the MOUSE_OVER-animation. Probably a recurring issue with an easy solution.
Is there a way to check what frame the MC's are currently at and then use an IF-statement to check what should happen next? Or how am i suppose to approach this problem you think? I'm sort of a Flash newbie, i've just taken some [URL] courses.
View 3 Replies
Aug 3, 2009
I have a flash with animations playing one after another. Say animation 1 finishes and i have a button which says Play Next named as playNext when i add the below code playNext.addEventListener(MouseEvent.CLICK,functio n(){gotoAndPlay("indexFade");}); on the last frame or the first frame ater stop it says ReferenceError: Error #1065: Variable btnChallange is not defined. at FB_index_fla::MainTimeline/FB_index_fla::frame1()
View 5 Replies
Dec 7, 2009
My main scene in only on 2 frames. On the second layers I have some buttons that activate my movie clips (on the third layer)... These buttons can be pressed 'randomly' and after the muvie clips are played my buttons (one by one) disappear to reveal what on the first layer. Here there's another button, but I want it to be active only after all my movie clips have been played. What kind of ActionScript should I use to tell flash to go to the second frame of my time line (where my button on the first layer is active) only after all the mcs have been played.
My file at the moment is in AS2... This should be a second part of a game. People who arrive at this stage should now which are the right buttons to press. If they press the right one a pop up opens and some buttons disappear to reveal the massage that's behind. When all the right buttons have been pressed I need to play the frame 'end' on my timeline... The attached fla is an example of mine animation the right buttons are the red ones.
Attachments:
example.swf (14.1 K)
example.fla.zip (269.8 K)
View 1 Replies
Dec 8, 2009
I have a movieclip that has several buttons inside it. When I use this code:
mc.onRollOver = function()
{
// do stuff
[code].....
View 3 Replies