Stop movie clip
I found some code on the web for confetti. The actual Movie
clip is just one small dot. in the Scene you place action script to
create the confetti effect. But you don't move the movie clip (dot)
itself into the Scene.
I can't figure out how to stop it at a certain point when I
no longer want it. I've tried various combinations of stop();
gotoAndStop(target or frame #). I've tried putting it in the
actionscript that creates the confetti effect, in the moviie clip
timeline and alone in the main tiimeline.
nothing is working.
any help would be appreciated. thank you.
Thank you but that didn't work either. Below is the code. On
the sample I found, it included only this code in the Timeline on a
layer called actions, and the moveclip in the library; the movie
clip is not in the timeline. and it works. it just doesn't stop.
screen_width=800
screen_height=200
frecuency=0//<< INCREASE NUMBER TO REDUCE PAPERS
QUANTITY
MovieClip.prototype.serConfeti=function () {
this._x=Math.ceil(Math.random()*screen_width)
this._xscale=Math.ceil(Math.random()*screen_height)
this._yscale=this._xscale
this.mover()
this.coloreame()
function getPorcentaje() {
var numero=Math.ceil(Math.random()*100)
return numero
function getOffset() {
var numero=Math.ceil(Math.random()*255)
var buleano=Math.round(Math.random()*1)
if (buleano==1) {
numero=numero*1
return numero
MovieClip.prototype.coloreame=function () {
var my_color=new Color(this)
var nuevo_color= new Object()
nuevo_color.ra=getPorcentaje()
nuevo_color.rb=getOffset()
nuevo_color.ga=getPorcentaje()
nuevo_color.gb=getOffset()
nuevo_color.ba=getPorcentaje()
nuevo_color.bb=getOffset()
my_color.setTransform(nuevo_color)
MovieClip.prototype.mover=function () {
this.onEnterFrame=function () {
if (this._y<600) {
this._y+=10
this._xscale=Math.random()*200
this._rotation=Math.random()*360
} else {
this.removeMovieClip()
MovieClip.prototype.caidaConfeti=function () {
this.createEmptyMovieClip("caida_mc",1)
var count=0
var confCount=1
this.caida_mc.onEnterFrame=function () {
if(count<frecuency){
count++
} else {
this.attachMovie("conf","conf"+confCount,confCount)
eval("this.caida_mc.conf"+confCount).serConfeti()
count=1
confCount++
_root.caidaConfeti();
// in this case this represents _root.
// so, if You want to use the caidaConfeti() prototype into a
MovieClip
// yo can do this for example:
MyMovieClip.caidaConfeti()
Similar Messages
-
Cursor stops movie clip buttons
I have animated movie clips as buttons. When the animation
reaches the point where the cursor sits on the button it vanishes.
Here is the script I have on the main time line:
//news_mc is the instance name of my movie clip button
news_mc.addEventListener(MouseEvent.CLICK, newsPage);
news_mc.addEventListener(MouseEvent.MOUSE_OVER, newsRollOn);
news_mc.addEventListener(MouseEvent.MOUSE_OUT, newsRollOff);
news_mc.buttonMode = true;
function newsRollOn(event:MouseEvent):void {
news_mc.gotoAndPlay("in");
function newsRollOff(event:MouseEvent):void {
news_mc.gotoAndPlay("out");
function newsPage(event:MouseEvent):void {
gotoAndStop("news");
I know there is something about
news_mc.mask = ??? I'm not sure if I sure what part of the
mask I use. I have a layer that has the button background (instance
name - background) and then the 2 layers that form the animated
mask - the mask layer contains a copy of the button background
(instance name - background2) and then the animated later of the
mask contains a gradient that slides over the button (instance name
- masker).
What is happening?ROLL_OVER and ROLL_OUT rather than mouse_over and _out did
the trick! -
Movie clip stops playing for no reason
I am making a banner that has multiple movie clips sharing the same area, creating different rainbow effects when different areas (invisible buttons) are moused over.
First of all I couldn't figure out if there was a way to have one invisible button over the whole area that changed to a different colored effect with each mouse over (first mouse over the black and whites would change to reds, second would change it to blues, third would change it to browns, etc.). Since I couldn't figure this out I settled on creating three buttons covering a third of the banner each, so when the mouse passes over one button it changes to reds, over another button it changes to blues, over the third it changes to browns.
The effects are movie clips where each frame has another stripe changing color so it goes in a wave effect from one to the next, and then goes back to white and black in the same manner. The first frame of each movie clip I had to turn into a nested movie clip so I could turn the alpha to 0, since I was going to have these color effect movie clips on top of one another in the main timeline on different layers, and so you could see the effect even if that color layer wasn't on top. I used the same nested movie clip with zero alpha for the first frame of each color effect clip (reds movie clip, blues movie clip, etc), so I dont' know if that's an issue.
Anyway, it seemed to work fine for a while, but after working on it for a while longer (and not getting any further since I removed most of the changes I made), now when I test the movie the mouse over does not seem to work correctly. It works fine, seemingly, for the first time I mouse over each button, but in order to have it work again I have to mouse over the button twice, and then it will pause randomly during a part of the clip and I have to move my mouse back over for the movie clip to continue.
I can't tell if this is because of the overlapping movie clips, or because my buttons are messed up, or if my actionscript is messed up, or if the timeline has to be longer, or what. Currently the timeline is 55 frames, the same as each movie clip.
I put a movieclip_instance.stop(); command in the first frame of the main timeline, is there a better way to do this? Should I put the stop command in the movie clip itself?
Here is a section of my AS in the main timeline, this is my first time programming ever, in any language, and trying to learn from the internet is more difficult than I thought it would be.
redmovie.stop();
red_btn.addEventListener(MouseEvent.ROLL_OVER, playRed);
function playRed(event:MouseEvent):void
redmovie.play();I am not sure of what the problem is, so I don't know if this will help or not. One thing I might suggest is that you use gotoAndPlay(1) instead of play(). That way, if your movieclip is in the middle of playing it won't continue but will start from the beginning.
You could use one button to have the different movieclips play in sequence if you prefer that. You would just need to have some form of counter that keeps track of which is the next to play. Somethin like...
var mcCounter:uint = 0; // start at 0 since an array is being used to identify which movieclip to play
var mcs:Array = new Array(redmovie, bluemovie, brownmovie);
only_btn.addEventListener(MouseEvent.ROLL_OVER, playMC);
function playMC(event:MouseEvent):void
mcs[mcCounter].play(); // tell the current mc to play
mcCounter += 1; // increment for the next mc
if(mcCounter == 3) mcCounter = 0; // reset the counter if it exceeds the array -
I am creating an automotive braking system using flash and have a wheel turning. I want the wheel to slow down and stop after the brake pedal is pushed at a certain frame. I know I could do this with frame by frame animation but was hoping there was a short cut - javascript?? If not the slowing down portion then is there code for just making the internal movie clip (wheel turning) to stop when it gets to a frame.? Thanks
you can use the ticker class to create a loop that you use to control the wheel's rotation or frame, TweenJS v0.6.0 API Documentation : Ticker
-
How to stop a movie clip moving
I'm not newbie to flash but I am newbie to coding using
actionscript!!!
I am trying to create a button that moves a movie clip
("content1") diagonally across the screen but once the movie clip
reaches a certain x co-ordinate I want it to stop and then when I
click another button I would like it to return to it's starting
position. At the moment the movie clip moves if I click one of the
buttons but as soon as I click another one it stops which it
shouldn't it should go back in the other direction. The other
problem is that once I've clicked a button I cant seem to get it to
stop moving once it reaches a certain _x position it just keeps on
moving off the stage.
Below is the script I have so far not including any
conditions to check if "content1" has reached it _x position
Could anyone help please!!!!
//on Right movie clip containing the button
onClipEvent (enterFrame) {
_root.content1._x += speedX;
_root.content1._y -= speedY;
//on Right button inside movie clip
on (press) {
speedX = 5.5;
speedY = 1.33;
//on Left movie clip containing the button
onClipEvent (enterFrame) {
_root.content1._x += speedX;
_root.content1._y -= speedY;
//on Left button inside movie clip
on (press) {
speedX = 5.5;
speedY = 1.33;Many thanks ClBeech!!!
I've tried the code you suggested but it doesn't seem to work
:0(
I'm working on a Mac using Flash Pro 8 which only has the
option to publish as 'actionscript 1.0 or 2.0' is the script you
supplied an actionscript 3.0?
Below is the script with the amendments, I've changed my
button instance names to match the script you supplied (left_btn /
right_btn)
stop();
import mx.transitions.Tween;
import mx.transitions.easing.Strong;
var rposX = 369;
//the ending x of the right position
var rposY = 84;
//the ending y of the right position
var lposX = 116;
//the ending x of the left position
var lposY = 154;
//the ending y of the left position
right_btn.onPress = function() {
new Tween(content1, '_x', Strong.easeOut, content1._x,
rposX, time, false);
new Tween(content1, '_y', Strong.easeOut, content1._y,
rposY, time, false);
left_btn.onPress = function() {
new Tween(content1, '_x', Strong.easeOut, content1._x,
lposX, time, false);
new Tween(content1, '_y', Strong.easeOut, content1._y,
lposY, time, false); -
How to stop a movie clip that is loaded dynamically
Hello Flash Forum,
I am using the loadmovie method to load a swf file into a
movie clip "container"
Code snippet:
var mc:MovieClip = this.createEmptyMovieClip("mc",1);
mc.loadMovie('bbc_module1.1.swf','bbc_audio',container.getNextHighestDepth(),
{_x:300.8, _y:240});
mc._lockroot = true;
The movie clip I load does not have a stop action in frame 1,
but comes up playing (audio and images). I am not using video. It
is a series of still images synced to the audio.
I would like to be able to load the movie clip, stop it from
playing, and by clicking buttons, get it to play, pause, etc like
the buttons and skin on the FLVPlayer.
Any tips on how to do this?
Thanks,
eholz1Many thanks ClBeech!!!
I've tried the code you suggested but it doesn't seem to work
:0(
I'm working on a Mac using Flash Pro 8 which only has the
option to publish as 'actionscript 1.0 or 2.0' is the script you
supplied an actionscript 3.0?
Below is the script with the amendments, I've changed my
button instance names to match the script you supplied (left_btn /
right_btn)
stop();
import mx.transitions.Tween;
import mx.transitions.easing.Strong;
var rposX = 369;
//the ending x of the right position
var rposY = 84;
//the ending y of the right position
var lposX = 116;
//the ending x of the left position
var lposY = 154;
//the ending y of the left position
right_btn.onPress = function() {
new Tween(content1, '_x', Strong.easeOut, content1._x,
rposX, time, false);
new Tween(content1, '_y', Strong.easeOut, content1._y,
rposY, time, false);
left_btn.onPress = function() {
new Tween(content1, '_x', Strong.easeOut, content1._x,
lposX, time, false);
new Tween(content1, '_y', Strong.easeOut, content1._y,
lposY, time, false); -
How to stop a slideshow and show another movie clip at the end?
Currently my slideshow is in a loop. At the end of last slideshow, I want to show another movie clip (End_mv) that's on another layer. How do I do that? My current scripts are below:
import fl.transitions.Tween;
import fl.transitions.easing.*;
//change scale on an image
var fadeTween:Tween;
//To slide in on X axis
var slideXTween:Tween;
//To slide in on Y axis
var slideYTween:Tween;
//To fade IN
var alphaTween:Tween;
//To get bigger on its X axis
var scaleXTween:Tween;
//To get bigger on its Y axis
var scaleYTween:Tween;
//var fadeTween:Tween;
//description place holder
var strDescrp:String;
//source place holder
var strSource:String;
//x poistion
var posX:Number;
//y position
var posY:Number;
//degree rotation
var degreeRot:Number;
// delay between slides
//const TIMER_DELAY:int = 5000;
var TIMER_DELAY:int = 5000;
// fade time between slides
const FADE_TIME:int = 3;
// reference to the current slider container
var currentContainer:Sprite;
// index of the current slide
var intCurrentSlide:int = -1;
// total slides
var intSlideCount:int;
// timer for switching slides
var slideTimer:Timer;
// slides holder
var sprContainer1:Sprite;
var sprContainer2:Sprite;
// slides loader
var slideLoader:Loader;
// url to slideshow xml
var strXMLPath:String = "lstHouse.xml";
// slideshow xml loader
var xmlLoader:URLLoader;
// slideshow xml
var xmlSlideshow:XML;
var txtField:TextField = new TextField();
var formatText:TextFormat = new TextFormat();
//start of sound section is for sound
var soundReq:URLRequest = new URLRequest("PaukenBrumfiel_AngelsOnHigh.mp3");
var sound:Sound = new Sound();
sound.load(soundReq);
sound.addEventListener(Event.COMPLETE, onComplete);
//end of sound section
function onComplete(event:Event):void
sound.play();
function init():void
// create new urlloader for xml file
xmlLoader = new URLLoader();
// add listener for complete event
xmlLoader.addEventListener(Event.COMPLETE, onXMLLoadComplete);
// load xml file
xmlLoader.load(new URLRequest(strXMLPath));
// create new timer with delay from constant
slideTimer = new Timer(TIMER_DELAY);
// add event listener for timer event
slideTimer.addEventListener(TimerEvent.TIMER, switchSlide);
// create 2 container sprite which will hold the slides and
// add them to the masked movieclip
sprContainer1 = new Sprite();
sprContainer2 = new Sprite();
mcSlideHolder.addChild(sprContainer1);
mcSlideHolder.addChild(sprContainer2);
// keep a reference of the container which is currently
// in the front
currentContainer = sprContainer2;
function onXMLLoadComplete(event:Event):void
// create new xml with the received data
xmlSlideshow = new XML(event.target.data);
// get total slide count
intSlideCount = xmlSlideshow..image.length();
// switch the first slide without a delay
switchSlide(null);
function fadeSlideIn(e:Event):void {
// add loaded slide from slide loader to the
// current container
currentContainer.addChild(slideLoader.content);
// clear preloader text
//mcInfo.lbl_loading.text = "";
// fade the current container in and start the slide timer
// when the tween is finished
//Tweener.addTween(currentContainer, {alpha:1, time:FADE_TIME, onComplete:function() { slideTimer.start(); }});
//strSource = xmlSlideshow.image[intCurrentSlide].@src;
fadeTween = new Tween(currentContainer, "alpha", Regular.easeInOut, 0, 1, 2, true)
//scale = new Tween(currentContainer, "alpha", Regular.easeInOut, 0, 1, 2, true)
slideTimer.start()
onComplete:function();
function switchSlide(e:Event):void
// check, if the timer is running (needed for the
// very first switch of the slide)
if(slideTimer.running)
slideTimer.stop();
// check if we have any slides left and increment
// current slide index
if(intCurrentSlide + 1 < intSlideCount)
intCurrentSlide++;
// if not, start slideshow from beginning
else
intCurrentSlide = 0;
// check which container is currently in the front and
// assign currentContainer to the one that's in the back with
// the old slide
if(currentContainer == sprContainer2)
currentContainer = sprContainer1;
else
currentContainer = sprContainer2;
// hide the old slide
currentContainer.alpha = 0;
// bring the old slide to the front
mcSlideHolder.swapChildren(sprContainer2, sprContainer1);
strDescrp = xmlSlideshow.image[intCurrentSlide].@desc;
//strSource = xmlSlideshow.image[intCurrentSlide].@src;
//txtField.border = true;
//txtField.x = 0;
//txtField.y = 600;
txtField.width = 855;
txtField.height = 200;
//txtField.background = true;
//txtField.backgroundColor = 0xEE9A00;
txtField.alpha = 20;
txtField.text = strDescrp;
formatText.align = TextFormatAlign.CENTER;
//txtField.autoSize = TextFieldAutoSize.LEFT;
formatText.color = 0x000;
formatText.size = 30;
txtField.x = 0;
txtField.y = 550;
posX = 0;
posY = 0;
degreeRot = 0;
// create a new loader for the slide
slideLoader = new Loader();
// add event listener when slide is loaded
slideLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, fadeSlideIn);
// load the next slide
slideLoader.load(new URLRequest(xmlSlideshow.image[intCurrentSlide].@src));
addChild(txtField);
txtField.setTextFormat(formatText)
// init slideshow
init();I got this error:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.display::DisplayObjectContainer/swapChildren()
at University_Advancement_Holiday_Greeting2012_fla::MainTimeline/switchSlide()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
And here's the code:
// import tweener
//import caurina.transitions.Tweener;
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.display.MovieClip;
//change scale on an image
var fadeTween:Tween;
//To slide in on X axis
var slideXTween:Tween;
//To slide in on Y axis
var slideYTween:Tween;
//To fade IN
var alphaTween:Tween;
//To get bigger on its X axis
var scaleXTween:Tween;
//To get bigger on its Y axis
var scaleYTween:Tween;
//var fadeTween:Tween;
//description place holder
var strDescrp:String;
//source place holder
var strSource:String;
//x poistion
var posX:Number;
//y position
var posY:Number;
//degree rotation
var degreeRot:Number;
// delay between slides
//const TIMER_DELAY:int = 5000;
var TIMER_DELAY:int = 5000;
// fade time between slides
const FADE_TIME:int = 3;
// reference to the current slider container
var currentContainer:Sprite;
// index of the current slide
var intCurrentSlide:int = -1;
// total slides
var intSlideCount:int;
// timer for switching slides
var slideTimer:Timer;
// slides holder
var sprContainer1:Sprite;
var sprContainer2:Sprite;
// slides loader
var slideLoader:Loader;
// url to slideshow xml
var strXMLPath:String = "lstHouse.xml";
// slideshow xml loader
var xmlLoader:URLLoader;
// slideshow xml
var xmlSlideshow:XML;
var txtField:TextField = new TextField();
var formatText:TextFormat = new TextFormat();
//var myEnding:MovieClip = stage.getChildByName('End_mc') as MovieClip;
//start of sound section is for sound
var soundReq:URLRequest = new URLRequest("PaukenBrumfiel_AngelsOnHigh.mp3");
var sound:Sound = new Sound();
sound.load(soundReq);
sound.addEventListener(Event.COMPLETE, onComplete);
//end of sound section
function onComplete(event:Event):void
sound.play();
function init():void
//reference my movie clip "End_mc" oon the stage and turn its visibility off
MovieClip(getChildByName('End_mc')).visible = false;
// create new urlloader for xml file
xmlLoader = new URLLoader();
// add listener for complete event
xmlLoader.addEventListener(Event.COMPLETE, onXMLLoadComplete);
// load xml file
xmlLoader.load(new URLRequest(strXMLPath));
// create new timer with delay from constant
slideTimer = new Timer(TIMER_DELAY);
// add event listener for timer event
slideTimer.addEventListener(TimerEvent.TIMER, switchSlide);
// create 2 container sprite which will hold the slides and
// add them to the masked movieclip
sprContainer1 = new Sprite();
sprContainer2 = new Sprite();
mcSlideHolder.addChild(sprContainer1);
mcSlideHolder.addChild(sprContainer2);
// keep a reference of the container which is currently
// in the front
currentContainer = sprContainer2;
//function onXMLLoadComplete(e:Event):void
function onXMLLoadComplete(event:Event):void
// create new xml with the received data
xmlSlideshow = new XML(event.target.data);
// get total slide count
intSlideCount = xmlSlideshow..image.length();
// switch the first slide without a delay
switchSlide(null);
function fadeSlideIn(e:Event):void {
// add loaded slide from slide loader to the
// current container
currentContainer.addChild(slideLoader.content);
// clear preloader text
//mcInfo.lbl_loading.text = "";
// fade the current container in and start the slide timer
// when the tween is finished
//Tweener.addTween(currentContainer, {alpha:1, time:FADE_TIME, onComplete:function() { slideTimer.start(); }});
//strSource = xmlSlideshow.image[intCurrentSlide].@src;
fadeTween = new Tween(currentContainer, "alpha", Regular.easeInOut, 0, 1, 2, true)
//scale = new Tween(currentContainer, "alpha", Regular.easeInOut, 0, 1, 2, true)
slideTimer.start()
onComplete:function();
function switchSlide(e:Event):void
// check, if the timer is running (needed for the
// very first switch of the slide)
if(slideTimer.running)
slideTimer.stop();
// ADDED: Check if using sprContainer2 and at the last slide
//if ((currentContainer == sprContainer2) && (intCurrentSlide == intSlideCount))
trace("Current Slide: " + intCurrentSlide);
trace("SlideCount: " + intSlideCount);
if ((currentContainer == sprContainer2) && ((intCurrentSlide + 1) == intSlideCount))
// hide the slideshow (and other related elements, or remove them if desired)
//mcSlideHolder.visible = false;
// remove any clips directly inside slideshow (any timers/etc need to be stopped too)
while (mcSlideHolder.numChildren > 0)
mcSlideHolder.removeChildAt(0);
// I do see a var named 'sound' playing so you might want to:
//sound.stop();
//sound = null;
// etc any other slideshow-only elements to hide/remove..
// play your movie
MovieClip(getChildByName('End_mc')).visible = true;
MovieClip(getChildByName('End_mc')).play();
// check if we have any slides left and increment
// current slide index
if(intCurrentSlide + 1 < intSlideCount)
intCurrentSlide++;
// if not, start slideshow from beginning
else
intCurrentSlide = 0;
// check which container is currently in the front and
// assign currentContainer to the one that's in the back with
// the old slide
if(currentContainer == sprContainer2)
currentContainer = sprContainer1;
else
currentContainer = sprContainer2;
// hide the old slide
currentContainer.alpha = 0;
// bring the old slide to the front
mcSlideHolder.swapChildren(sprContainer2, sprContainer1);
strDescrp = xmlSlideshow.image[intCurrentSlide].@desc;
//strSource = xmlSlideshow.image[intCurrentSlide].@src;
//txtField.border = true;
//txtField.x = 0;
//txtField.y = 600;
txtField.width = 855;
txtField.height = 200;
//txtField.background = true;
//txtField.backgroundColor = 0xEE9A00;
txtField.alpha = 20;
txtField.text = strDescrp;
formatText.align = TextFormatAlign.CENTER;
//txtField.autoSize = TextFieldAutoSize.LEFT;
formatText.color = 0x000;
formatText.size = 30;
txtField.x = 0;
txtField.y = 550;
posX = 0;
posY = 0;
degreeRot = 0;
// create a new loader for the slide
slideLoader = new Loader();
// add event listener when slide is loaded
slideLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, fadeSlideIn);
// add event listener for the progress
//slideLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);
// load the next slide
slideLoader.load(new URLRequest(xmlSlideshow.image[intCurrentSlide].@src));
addChild(txtField);
txtField.setTextFormat(formatText)
// init slideshow
init(); -
Stopping a Movie Clip from continuing to Play
Hi
Apologies if this has already been asked. I have two movie
clips in my FLA. The main timeline consists of 250 frames with a
stop action to end the movie on the last frame. I've noticed that
my two MCs continue playing after the main movie has stopped and am
looking for help in stopping these when the main movie stops.
I am using Flash CS3. Any help much appreciated.
GeorgeHi Cbeech
That worked a treat - I was getting bogged down with more
complex AS - it should have been obvious it was a simple stop
action.
Once again, many thanks for that.
George -
How do I stop a Movie Clip (Button) from working once clicked?
Ok,
I'm using a movie clip as a button to show content on a page, effectively its like a new page of the website. Problem is, with the script im using for it, once the content is show, the button is still active and if clicked again, will re-load the content. I want a way to effectively disable the button whist the content is shown.
Thanks.
this.services_inner.buttonMode = true;
this.services_inner.addEventListener(MouseEvent.MOUSE_OVER, rollOver_services);
this.services_inner.addEventListener(MouseEvent.CLICK, onClick_services);
function rollOver_services(evt:MouseEvent):void {
this.services_inner.play();
function onClick_services(event:MouseEvent):void {
MovieClip(root).mov.backgrounds.colour.gotoAndPlay(2);Thanks, that does stop it, however, i now need it to work again if a different button is clicked... there are 4 buttons (movie clips) in total, so I assume I'd just need to add the event listener back again on click of the others?
This is the "Services" Button, with the event listener removal.....
this.services_inner.buttonMode = true;
this.services_inner.addEventListener(MouseEvent.MOUSE_OVER, rollOver_services);
this.services_inner.addEventListener(MouseEvent.CLICK, onClick_services);
function rollOver_services(evt:MouseEvent):void {
this.services_inner.play();
function onClick_services(event:MouseEvent):void {
MovieClip(root).mov.backgrounds.colour.gotoAndPlay(2);
this.services_inner.removeEventListener(MouseEvent.CLICK, onClick_services);
This is the "Contact" Button, which when clicked would need to "re-activate" the Services button.
this.contact_inner.buttonMode = true;
this.contact_inner.addEventListener(MouseEvent.MOUSE_OVER, rollOver_contact);
this.contact_inner.addEventListener(MouseEvent.CLICK, onClick_contact);
function rollOver_contact(evt:MouseEvent):void {
this.contact_inner.play();
function onClick_contact(event:MouseEvent):void {
MovieClip(root).mov.backgrounds.art.gotoAndPlay(2);
this.services_inner.removeEventListener(MouseEvent.CLICK, onClick_contact); -
How to stop , play nested movie clips....
Hi all,
I'm calling a swf file in a container_mc, which is in
another swf file(Interface), by loadMovie() method. The Major
problem I've stucked with is that in the interface I'm having a
Play/Pause Button, which is not stopping the nested movieclips of
the external swf file which is loaded in the container_mc
movieclip.
The other major issue is that I'm not able to add a
progressbar(sliderbar) which runs according to the animation, to
this interface. Please help ASAPI have a similiar situation however the container_mc has me
puzzled, I'm not sure what that is - perhaps you can answer my
question:
I have a master swf called index.swf. The index.swf has a
main tool bar of buttons which load frames; each frame is named to
coincide with the main bar button (i.e. genInfo, setup,
mainentance, etc). This works perfectly. My problem is with Movie
Clips.
Each frame has a sidebar which loads external swfs (i.e.
genInfo.swf) - each external swf is made up of a series of Movie
Clips which run in succession along the timeline; each Movie Clip
belongs within its own frame (i.e. MCseg1 is in frame seg1; MCseg2
is in frame seg2, etc).
I need to pause and play each individual Movie Clip at will;
I have built two buttons (pauseBtn and playBtn) into a Movie Clip
called MCpausePlay. The first frame of MCpausePlay contains the
pauseBtn; this frame is coded with the global "stop();" In order to
move to frame(2) which contains the playBtn, the pauseBtn is coded
with -
on(release) {
gotoAndPlay(2);
The playBtn is coded:
on(release) {
gotoAndPlay(1);
When clicked, the MCpausePlay moves from pause to play.
That's all I have been able to get this to do.
How do I code MCpausePlay to pause and then play each
individual Movie Clip? (How do I get a Movie Clip to control other
Movie Clips?). Should I code the Movie Clip, the frames within the
Movie Clip, or each individual button within the Movie Clip? And,
does this MCpausePlay belong on the Index.swf file, or should it be
on each external swf? Or perhaps built in to every Movie Clip? I
have tried all and have not had any success. -
Stop(); not working. Movie clip is looping.(AS2)
I have made a movie clip that needs to play till the last frame and then stop there, but not dissapear. Right now, as I am putting the command stop(); on the first frame of the movie clip and on the last frame too, nothing is changing, the movie clip is still looping and does not stop at all.
What could be the problem?
p.s. I am really a beginner in Adobe Flash.Can you show a screenshot of the timeline and where the stop() command are placed? If stop(); is the only code you are using then it sounds like you are putting the code in the wrong place.
-
Stopping and Playing some movie clips?
I have a problem with some AS3 code and i don't understand why.. my code looks like this:
stop();
halt.addEventListener(MouseEvent.CLICK, stopplaying);
function stopplaying(event:MouseEvent):void {
MovieClip(root).stop();
MovieClip(root).gun.stop();
MovieClip(root).gun.gt1.stop();
MovieClip(root).gun.gt2.stop();
MovieClip(root).gun.gt3.stop();
MovieClip(root).gun.gt4.stop();
MovieClip(root).gun.gt5.stop();
MovieClip(root).gun.gt6.stop();
gotoAndStop(1);
That code is set to listen to a pause button to pause all movieclips when pressed but the last 2 rows "MovieClip(root).gun.gt5.stop();
MovieClip(root).gun.gt6.stop();" doesn't work and gives me this output:
TypeError: Error # 1010: A term is undefined and has no properties. third_fla at::ppBtn_20/startplaying ()
But there shouldn't be a problem with this, cause the movieclips are the same as the others and has an instance name of gt5 and gt6 just like the other movie clips, and the code is obviously the same?Try tracing the different objects on those lines and see if they are recognized. It may point to a misnaming or object absence.
function startplaying(event:MouseEvent):void {
MovieClip(root).play();
MovieClip(root).gun.play();
MovieClip(root).gun.gt1.play();
MovieClip(root).gun.gt2.play();
MovieClip(root).gun.gt3.play();
MovieClip(root).gun.gt4.play();
trace(MovieClip(root).gun.gt5, MovieClip(root).gun.gt6);
MovieClip(root).gun.gt5.play();
MovieClip(root).gun.gt6.play();
gotoAndStop(2); -
Is it possible to stop a tween in a movie clip
Hello Kglad and other forum expert!
I have a movie clip (really just an image converted to a
movie clip).
I a "zoom" effect set on two layers - on for the zoom mask,
and the other for the base image.
I just use the modify/transform in some keyframes to have the
image motion tween from normal size to a larger size.
The tween (aka zoom) is shown through the mask layer.
I did not create the motion tween using actionscript, but in
the timeline between 2 keyframes.
Is there a way I can stop the tween when the movie plays ( by
clicking a "pause" button).
Thanks for a great info resource,
eholz1you can use the stop() method of movieclips to stop the
timeline of the tweening movieclip. you can use the play() method
to continue to tweening. -
Stopping audio of netstream from outside a movie clip
I have a netstream from media server defined within a movie
clip symbol which is playing an audio. I need to stop this audio
from outside the movie clip symbol when a button is pressed.
I have tried to close the movie clip, but the audio keeps on
playing.
Any idea on how this can be done?
Thanks in advanceFound to be an issue with 2 buttons with same name.
-
Looping movie clip stops in middle
I am using a movie clip as part of a game. It's a clip of a
spaceman walking.
When the game is being played, the movie seems to loop one
time (the spaceman walks one cycle), and on the second time around
the animation seems to stop right in the middle of the cycle. it
always stops on the same frame.
What is happening here?
Thank youOkay, great, and what about the last line? What is that for?
Do i put my keylistener info after that line?
I'm still a little puzzled about where to put the script that
you just offered me.
But before I get to that, let me ask you a question about my
current code. Below I've pasted the beginning of the code that I
have for Key Down. My question is: Is this code going to execute
over and over again? Is this code a "key listener"?
_root.onKeyDown = function() {
///keyDOWN!!!
whichKey = Key.getAscii();
if ((whichkey == _root.jumpkey) or (whichkey ==
_root.jumpkeycaps)) {
if (_root.mov == "walkleft") {
_root.mov = "jumpleft";
_root.vertspeed = 24;
if (_root.mov == "walkright") {
_root.mov = "jumpright";
_root.vertspeed = 24;
if (mov.toLowerCase().indexOf("stop") != -1) {
_root.mov = "jumpup";
_root.vertspeed = 24;
}
Maybe you are looking for
-
How can i transfer my old files from 3d phone to my new phone 5s
I got an old phone 3g now I want to transfer my pictures and others to my new cellphone just newly bought apple 15s 16GB gold lte. I tried following the steps written in by the sales representative but I cannot find the find the things she instructed
-
How would I set up an FTP server in Mountain Lion Server?
I need to make a server, which would serve the same function that the FTP file-sharing option did before Lion. Plus whatever goodies of superior access control etc there may be; but mainly providing files for downloading and uploading. (I don't want
-
my iphone has been lost in my house and i need to find a way to track it and its offline. it wont connect to the internet so there isnt a way to use find my iphone. i just want to play a sound on it. is there any way i can get a app that connects my
-
Query to find out the free disk space on C: drive
Hi Guys, I am trying to create a query in Queries section under Monitoring, To find out the free disk space of C: drive. Am using the below query, but it shows lot many fields, I need only Machine names of the collection and their Free Disk Space on
-
Hi all, I've recently had a line of dead/stuck pixels (I realise they're two different issues, but I cannot decipher for sure which one my Z1 is suffering from). The line of pixels runs down the very middle of the display and is most visible agains