ActionScript 2.0 :: MovieClip Used As A Button - Stop All The Other Functions From Playing Once The .onRelease Function Has Started?
May 12, 2005
My problem is pretty simple, but I'm still finding my way around even the simplest things in Actionscript. I have a movieclip named 'leaf9' in which I'm using as a button (which happens to be within another movieclip). I have the following actionscript on the frame which contains 'leaf9':
[Code]...
What I want is for all the other functions to go away once "shrink" has started to play, so that if the mouse goes over the button again, the clip doesn't start playing "rollover" etc etc. So how do I stop all the other functions from playing once the .onRelease function has started?
View 8 Replies
Similar Posts:
May 12, 2005
I'm still finding my way around even the simplest things in Actionscript. I have a movieclip named 'leaf9' in which I'm using as a button (which happens to be within another movieclip). I have the following actionscript on the frame which contains 'leaf9':
[AS]
leaf9.onRollOver = function(){
this.gotoAndPlay("rollover");[code].....
What I want is for all the other functions to go away once "shrink" has started to play, so that if the mouse goes over the button again, the clip doesn't start playing "rollover" etc etc. So how do I stop all the other functions from playing once the .onRelease function has started?
View 8 Replies
Jun 22, 2006
I have a MovieClip with 3 functions to act as a button - onRollover, onRollout, onRelease. I want the onRelease function to cancel out the other functions once the user presses the button.
How would I script that?
Code:
navMenu1.onRollOver = function() {
_parent.jumpTobg1X(2);
this.gotoAndPlay("over");
[Code]...
Basically, I have the function sliding another movieclip along the x axis. onRelease it slide to position 3 - which I want it to stay there, but my onRollout function keeps sliding it back to position 2 (which i need for users just browsing the navigation before a selection is made)
View 3 Replies
Mar 30, 2010
i cannot get the sound that has started playing to stop.
Code:
var EdgenSound= new Edgen();
play_btn.addEventListener(MouseEvent.MOUSE_DOWN, playClick);
stop_btn.addEventListener(MouseEvent.MOUSE_DOWN, stopClick);
[code].....
View 4 Replies
Nov 8, 2009
I'm designing an interface for a class, and the buttons that I am using all have multiple functions.For example, when the story button is clicked, I need the mc to stop playing and change to text (in the same window/screen, just no mc playing). The mc is 31 frames long, but if there's a way to just make it loop continuously until told not to, Currently, my code looks like this:
stop();
story_btn.addEventListener(MouseEvent.CLICK,story);
function story(event:MouseEvent):void { gotoAndStop(32);}credits_btn.addEventListener(MouseEvent.CLICK,credits);[code]...
When I click the button, the mc does not stop playing and the text does not show up.
View 6 Replies
Jun 17, 2004
I have one function that puts text in a text field and makes a button goto a url onRelease.The code is like this:
Code:
item.onRelease = function() {
myButton.onRelease = function() {
getURL("http://google.com", "_blank");
}
talk = this.txt;
}
the only problem is that the button doesn't work onRelease. i think that it is because there are too many functions there, but at the same time,
View 5 Replies
May 31, 2008
Is it possible to assign several onRelease Functions for multiple movieClips on a single function?
Here is my scenario... I have 10 movieClips on stage... i have a function on script which needs to be called every time any of the movieclips are clicked.. do i have to write a separate movieclip.onRelease function for each and every movieclip.
View 4 Replies
Dec 16, 2011
I need to stop a function, the function is started with a play button and I want it to stop by a stop button, then play then stop, etc. The changeColours function has a timer.start() at the end that triggers another function, which then restarts the changeColours function. These 2 functions keep doing this repeatedly after the play button and MouseEvent trigger the first function. I just want to be able to stop the changeColours function and then be able to start it again at any time.
ActionScript Code:
play_btn.addEventListener(MouseEvent.CLICK, playColours);
function playColours(e:MouseEvent):void {
if(!PLAYSTOP) {
changeColours();
PLAYSTOP = true;
}}
stop_btn.addEventListener(MouseEvent.CLICK, stopColours);
function stopColours(e:MouseEvent) {
//changeColours() needs to stop!!
}
View 6 Replies
Jan 12, 2010
I'm loading an item to the stage and trying to apply a function to it but it doesn't seem to work.
Code:
_root.attachMovie("FullScreenBTN","FullScreenBTN",_root.getNextHighestDepth());
_root.FullScreenBTN.onRelease = function(){
trace("test")
}
When I press the button nothing happens, but when I remove the attach code and just put the button on the stage with the appropriate instance name it does work.
View 5 Replies
Jun 21, 2009
I've tried a couple dozen things to try and stop this movie clip, even down to the bare bones basics and its not working.I have an imported TIFF sequence that i imported onto the stage of a movie clip. Its 73 frames long, i want it to stop on frame 73.So i add the usual stop(); command but it doesn't stop, it keeps looping.On the main layer i put this movieclip in i have an AS layer that also has stop(); and moviclip.stop();But it doesn't stop at all. it just keeps repeating.I put it down to this bare basic setup just to see if i could even stop it. But its not stopping.Layers -> and stuffScene 1Content - movieclipMCActionScript - stop(); movieclipMC.stop();Movieclip - keyframes consisting of image sequence 1-73. frame 73 has stop();
View 1 Replies
Oct 3, 2009
So I made a few buttons with sounds within them and when I publish it they work just fine. But what I want them to do is;
Say I click a Button.The sound starts playing.Then I click it again, before the sounds done playing.I want it to stop the playing sound and start playing the button I just clicked on, whether it be the same button, or a different one.Right now it just ends up sounds like an echo because it'll play it as many times as you click it.
View 2 Replies
Nov 20, 2006
I have a set of 5 text buttons that I want to alter slightly with actionscript. An OnClip event moves the 5 text buttons onto the screen, then each button has a stop action as well as an OnPress/OnRelease that rotates it from black text to blue text and rolls back to black text again. I just need it to be black text to blue and stop when the viewer clicks the link to go to an HTML page.
How would you code it so that the text button rolls from black to blue and stays BLUE for the selected HTML page as long as the user is on it, letting them know where they are in the site's navigation. The sample code from button 1 is below:
[Code].....
View 2 Replies
Aug 29, 2007
mc.onRelease = function(){
//Do something
}
I have this function on "mc".And I would like to call the function on ''mc" without clicking on "mc". How can I create the state where this "mc" is being pressed by script on a frame or another button?
View 2 Replies
Jun 29, 2009
I have a movie clip which has onRelease, onRollOver and on onRollOut functions associated with it. Within that movieclip I also have a checkbox, but the checkbox does not check when I click on it. When i disable the "on" functions, the checkbox is then working as normal.
Is there a way I could have the "on" functions and the checkbox working simultaniously?
View 1 Replies
Aug 9, 2010
I have a series of movieclips and when each one is clicked it calls a function e.g
movieclip1.onrelease = function(){
// function here
}
Is it possible to deactivate each one for 5 seconds when it is clicked, then reactivate it after 5 seconds using a timer or something?
View 4 Replies
Oct 9, 2007
the seven dots u see on the stage are 7 emptymovieclips. i've coded the action script to load the thumbnails in 6 emptymovieclips on left side arranged in grid.script is working fine till 6 thumbnails are loaded in the grid.(from externel xml file as i've coded)as logically u can guess that, when we click on a thumbnail, it's bigger copy should be loaded in the black square on he stage. but it is not happening ; i;ve coded for it also ;in the following script u can see that the last command is:
_root.thumb0.onRelease = function() {
trace ("clicked");
}
it should dispaly "clicked" on output window when thumb0 is clicked but it isn't showing anything. not any error even. the above line is in firstframe's action script; and it must should work from here only, not under the AS of thumb0 movieclip.
//////////////////////////////////////////////////////actionscript for the first frame of layer1///////////////////////////////////
xmlData = new XML();
xmlData.ignoreWhite = true;
[code]...
View 1 Replies
Mar 26, 2010
I am trying to add a simple navigation to an instance of a button on my stage through AS3. my code is below... I have used the same code in AS2, but i must be leaving something out in AS3..
btn_arrow_TL.onRelease = function() { gotoAndPlay("flyout_default"); }
Compiler Errors: 1120: Access of undefined property click.
View 6 Replies
Dec 6, 2007
I am using the mctween activated bttn.My bttns are looped and have been defined in a variable.I am trying to get specific onrelease functions such as loadMovie from each button in the loop depending on what bttn is clicked,but instead the onrelease functions is loading movies for all when any bttn in the loop is clicked.Heres my code.
Code:
// Includes the tweening extensions.
#include "mc_tween2.as"[code]....
I'm trying to make sure that if the user clicks, this.button_2 then this.button_2 will load movie2.swf alone not every movie for every bttn in the loop.
View 1 Replies
Nov 2, 2006
I'm trying to assign a custom property to an attached MC. In this case it's an ID number, but it's always undefined inside the onRelease function... What am I missing?
ActionScript Code:
function blablaMethod(){_root.attachMovie("bla", "bla"+someIncrementingId, _root.getNextHighestDepth());var mcReference = _root["bla"+someIncrementingId];// I've also tried the following:var mcReference = _root.attachMovie("bla", "bla"+number, _root.getNextHighestDepth());
[code]....
View 2 Replies
Apr 21, 2008
How can I direct a button placed in one mc to play a marked keyframe in another mc. Here's what I'm trying to do?
on (press) {
gotoAndPlay(_root.animMc, "go");
}
View 2 Replies
Nov 20, 2007
i'm trying to get a movieclip within a movieclip to stop playing when it reaches its last frame. let me describe my problem: it should start playing when the user rolls over the movieclip that is containing it(i'll call this mc1, and the movieclip within it mc2). i've put a stop action in mc2's last frame but it won't stop and plays again and again. one thing i should point out is that there is a variable in mc1 that tells the movie whether it's ok to play the movie in reverse when the user rolls over mc1, if this is false, that means that it plays normally(not in reverse). i'm using "play()" to play mc1 when the user rolls over it and this is where i think the problem is; even though the last frame of mc2 has a stop action, it is somehow told to play again? anyways, this is just a guess, i haven't figured out why or how to fix it. i'm not sure if my explanation was too hard to understand so i'll try to clarify it if anyone wants me to.
View 1 Replies
Feb 10, 2010
Is there a way to ADD onRelease method on movieclip that already has a onRelease method? Without replacing the first one.
ActionScript Code:
mc.onRelease = function(){
trace('1');
}
I was thinking this, but it doesn't work
[Code]...
View 1 Replies
Jul 5, 2004
I made a movieclip with 5 frames inside. Well, outside, when i push a button stop, runs the code: this.movieclip_name.stop(); , but, doesn't stop.Inside these frames there is a enterframe function that call drawing api functions.
View 1 Replies
Jul 30, 2011
Some time streaming is working fine and even in Admin console i see the bandwidth Grapgh is growing up due to no. of connected usersbut automatically it happen streaming is stop and bandwidth graph is going down till zero then i restart to FMS then streaming goes smoothly and working fine.before restart i check FMS services it is started and also encoder is connected when i restart it goes smoothly.What happen to FMS i don't know and i don't find any error in FMS log how to stop streaming even FMS is connected and started
View 14 Replies
Dec 10, 2010
I`d like to say that i`m total newbie regarding to as3. Ok, lets look at my problem.. I have 2 scenes (first is main menu with New Game button; second scene is intro for game). I`m having difficulties to make two functions within one button. Why do I need that? First function is to go to next scene (in my case, IntroScene). Second is for turning off sounds, so I can`t hear them in next scene. Here is the code:
[Code]...
View 9 Replies
Feb 25, 2012
I'm making an animation of a line drawing itself. I'm using a vector line that I drew in Illustrator, which I imported to the stage. I have been erasing a bit, inserting a new keyframe, erasing it a bit more, new keyframe etc. When i have finished this I intend to reverse the sequence so the line appears to be drawing itself. This process has been going really well, but at 1820 frames in a section of the line has started to shake/jitter (by which I mean from side to side very quickly). I deleted the frames and did them again, using the same process that I have for the rest of the line which is not jittering, but this small section is still jittering. It doesn't jitter or move when I move between frames, it only jitters when I play the movie by pressing Command + Enter or I export it as a Quicktime .mov file.
PS here is a YouTube video of the problem. The jitter starts around the bottom of South America. You may need to make it quite big on your screen to see it. You'll notice that that part of the line doesn't jitter most of the way along, but starts to jitter when it gets to that part.
View 2 Replies
Feb 7, 2005
How can it be done?
This is what I"m looking at and trying to modify:
Code:
stop();
this.navRollOver.onRollOver = function() {
[Code]....
View 1 Replies
Jul 11, 2011
I'm looking for some help regarding stopping sounds in Actionscript 3. Basically I'm making an interactive story game, basically a quiz game. On the main menu I have a narrator talking. What I basically want to do is have the track stop playing when you press the play button. I have the soundtrack playing already and the play button too. I just can't figure out how to get the sound to stop when I press the play button and it goes to the next scene.
[Code]...
View 2 Replies
Jul 22, 2009
I have a portfolio_mc that is inside of a content_mc (stage->content_mc->portfolio_mc). There are 3 buttons that take the user to an appropriate frame designated by a frame label and this loads up an FLV. The problem is that when I click on any of the navigation buttons on the main timeline, the FLV that is currently playing, is still playing (I can hear the audio). How to stop this.
Here is the code used for controlling the buttons in the motion_mc timeline:
stop();
var naviArr:Array = new Array(btn01, btn02, btn03);
btn01.addEventListener(MouseEvent.CLICK, navigate);
btn02.addEventListener(MouseEvent.CLICK, navigate);
btn03.addEventListener(MouseEvent.CLICK, navigate);
[Code] .....
View 18 Replies
Dec 11, 2009
I'm trying to make a stop button to make it stop playing the sound. But I get an error saying:
TypeError: Error #1006: stop is not a function.
at sound/SoundStop()
Here is the function for my stop button:
function SoundStop(event:MouseEvent):void {
cs.stop();
isPlaying:false
}
View 5 Replies