ActionScript 3.0 :: Stop Button Only Works When Hit Twice?

Feb 2, 2009

I have a presentation I created in Flash CS4 for work. Everything is working fine except for the stop button. The presentation has music that plays along with the movie and needs to be synced to it. When you click the stop button the first time, the movie stops and the music starts over. When you click it again, the music stops. I need it to work so that the stop button only has to be clicked once and both stop together. I should also mention that my boss is set on having the music and movie play automatically when you click the link to the presentation. Here is the code in ActionScript 3:

var music:Sound = new Sound(new URLRequest("sound.mp3"));
var sc:SoundChannel = music.play();
var isPlaying:Boolean = true;
var pos:Number = 0;

[Code].....

View 0 Replies


Similar Posts:


ActionScript 2.0 :: SetInterval In Movieclip Works But Breaks Stop(); Throughout Scenes

Mar 18, 2009

I have a series of 6 images. In a single movie clip symbol (with the pictures embedded/attached in the swf), I want the images to fade in, stop for 4 seconds, fade out as the next image fades in, and repeats from there. I know how to do this with timeline tweens - but I wanted to learn how to make it in actionscript.

I've finally been able to make the images do this, but when I pull the movieclip into my main animation, it breaks all my stop(); commands for navigation. it seems to stop for 4 seconds and then continues on. I'm still very much an actionscript beginner, so I don't know how to troubleshoot it.

[Code]...

View 4 Replies

ActionScript 3.0 :: Use StartDrag In The Code And It Works. But When I Try StopDrag It Doesn't Stop To Drag?

Jan 30, 2009

I use startDrag in the code and it works. But when I try stopDrag it doesn't stop to drag.

View 1 Replies

ActionScript 3.0 :: Container Mc Works As Button Instead Of Button Inside

Sep 23, 2009

I have flip_mc which contains listSide_mc and videoInfoSide_mc both of the above mc's contain a button name spin_btn.My flip_mc should rotate around the y axis and swapping whichever of the 2 (listSide_mc and videoInfoSide_mc) should be visible.All the rotating and adding a child stuff works fine.BUT the whole flip_mc seems to be a button, the spinIt function runs when I click anywhere on the mc, it should only happen when I click the spin_btn buttons.[code]

View 1 Replies

ActionScript 3.0 :: Get Main Timeline To Stop In The Beginning On Button Press To Play And At The End Stop Again?

Feb 1, 2008

I just got Flash CS3. I'm trying to get my main timeline to stop in the begining, on button press to play and at the end stop again. In AS2, you would just put stop(); on the first keyframe and stop(); on the last key frame and program your buttons accordingly.

The stop(); does not work!!!! It's driving me crazy. What am I missing? I've gone through the tutorials in Flash and they don't work either.Also, if you have MovieClip that contains an animation and you don't want the movie clip to be on a continuous loop how do you stop it from playing. In AS2, I would put a stop(); on the last keyframe of the movieclip's animation. This also does not work in AS3.

View 9 Replies

ActionScript 2.0 :: Sound - Stop Button To Allow The User To Stop Mid Song

Mar 13, 2007

i have programed a play button using:

[Code]...

now i am trying to program the stop button to allow the user to stop mid song....

View 4 Replies

ActionScript 1/2 :: One Button To URL Works, Second Button Will Not?

Sep 26, 2011

I am relatively new to Flash CS5, using AS2. I have made two buttons on the same frame linking to two separate urls.  I made them the exact same way, however only one of them works when tested in the swf file.  I put the buttons on two separate layers thinking that could have been a problem, but it still won't work.  There is no error, and when the house hovers over both buttons the finger shows, recognizing that it is a button.  Only the second button will actually open up the webpage.

[Code]...

View 1 Replies

Roll Over Hit Button Works Only Sometimes

Feb 13, 2010

OKay, I have a drop down menu. Around the menu I have a button surrounding the outside, so when I roll away from the drop down menu and roll over the outline button, it is coded with action script to make the drop down menu fade away.

View 6 Replies

Professional :: Button Only Works Once?

Nov 25, 2010

Play animation and after clicking the button once it no longer works. The button takes you to the frame labeled "shake". I want it to continue to take you to "shake" each time it is pressed but its not.I've got a button inside of a movie clip - actually its inside of 2. The first MC runs through and stops on the stop(); frame and than you click the button that sends the play head to the frame labeled "shake" which plays the next MC with the same button inside of it. I have put the button's action on its own layer on the first frame. The length of that buttons timeline starting from the first action keyframe is the length of the time of the other 2 MC's.

The Code
mcButton.shakeButton.addEventListener(MouseEvent.CLICK, onClick);
function onClick(event:MouseEvent):void{

[code]....

View 5 Replies

IDE :: Button - Hit State Works Sometimes?

Feb 13, 2009

I created a button in flash. I gave it a different state for 'over' and 'down' - changing the color and scale respectively, so it looks depressed when you hit it.I then assigned an action to the button so that when it is 'hit' you are taken to another scene. However when you hit the button it goes to the scene but you lose out on the 'hit/depressed' part of the buttons state!? Why?

How do you keep the hit state intact with the button whilst simultaneously assign an action?I understant 'the action' is to go to another scene first, but can it not also show the 'hit state too?[URL]

View 2 Replies

ActionScript 3.0 :: Button Works At First And Then Stops?

Mar 19, 2009

I'm attempting to make a website, using flash with AS3. All of it's going pretty great, I'm somewhat tech savvy with the 3D rendering so alot of the concepts in flash are easy to pick up.

others.. not so much.Okay I don't know the proper setup in flash but I have one layer that has my background. one layer for my buttons. and another for my action script.

In my buttons layer I have a link to a pictures gallery, graphic design, a contact page and then back home button . The problem is, when I click the "contact" button, then click the home button, I can't click the contact button again. It won't work.

Frame 1:

Code:
contact.addEventListener(
MouseEvent.MOUSE_UP,
function(evt:MouseEvent):void {

[Code]......

View 3 Replies

ActionScript 3.0 :: Button Action Works Only Once?

May 27, 2009

Still working on my slideshow. On the stage I have 4 buttons: Bio, Info, Contact and Back to Slideshow buttons. The first 3 buttons has the follow actions on a separate layer, both starting on frame 250, extends out to 370; 40 motion tween frames for each button.

stop();
bio_btn.addEventListener(MouseEvent.CLICK,bio);  function bio(event:MouseEvent):void{ gotoAndPlay(251);}

[code].....

View 2 Replies

ActionScript 3.0 :: Button To Open MC Only Works Once

Jun 27, 2010

I have a group of buttons that open a MC similar to opening a new window. Each "new window" has a close button that closes that window and goes back to the main window (the main timeline). The trouble is, the buttons to open the new window only work once. For example, if you click on "The Founders" the window opens then you click "close window" and "The Founders" button no longer works unless you refresh the page. I think it has something to do with the way I've coded the close button, but I'm not sure what exactly.[code]

View 5 Replies

ActionScript 3.0 :: Button Works On First Click Only?

Mar 1, 2011

When you click on it, the garage door opens and a tool chest emerges. The tool chest has the word close on top.When you click the close button it returns to the garage and the door closes. If you click on the garage door again nothing happens. This issue came about when I created a button out of the arrow on the road as a secondary button to open the garage door  It has a broad hit area but doesn't overlap the garage door.The garage door plays the first part of an animation

garage.door.addEventListener(MouseEvent.CLICK, openHandler);function openHandler(event:MouseEvent):void{ garage.play();}
The close button on top of the tool chest plays the second half of the animation labeled

[code].....

View 2 Replies

ActionScript 3.0 :: Button Works On First Click Only

May 19, 2011

The garage is a button. When you click on it, the garage door opens and a tool chest emerges. The tool chest has the word close on top. When you click the close button it returns to the garage and the door closes. If you click on the garage door again nothing happens. This issue came about when I created a button out of the arrow on the road as a secondary button to open the garage door. It has a broad hit area but doesn't overlap the garage door.
 
[Code]....

View 5 Replies

ActionScript 3.0 :: Replay Button Only Works Once?

Aug 13, 2010

I have an FLVPlayer which plays a video and after the video is done playing, the REPLAY button shows up. Upon clicking the REPLAY button the movie starts over.. Everything works well, except, the REPLAY button only works once.. meaning, once the movie played once and REPLAY button is cilcked to play it again, after the movie is done playing for the 2nd time - the button doesn't appear..

import fl.video.*;
import flash.display.MovieClip;
var myVideo:FLVPlayback = new FLVPlayback();

[Code]....

View 1 Replies

Sound Stop All Sounds Works / Then Sound Starts Again?

Jan 5, 2010

I am using FLASH CS3.I have gone through many posts, seems to be an issue with many people.Still haven't come across a fix.Website made in FLASH. Flash movie loads and sound works great!I have a button with 'StopAllSounds' action script.[code]When I go back to main page... sound starts up again.Is there a way I can stop all sound regardless of where the visitor goes on the website?

View 2 Replies

Moving Mouse Over Button Works On Mac Not PC & Streaming

Jul 8, 2009

I recently made a simple Flash file with video with an alpha channel and three simple buttons. It's a site tour video, and there's a button in the lower right to exit the tour that takes you back to home page. When you move over the "Exit Tour" button, it transforms in size slightly to highlight it. However, PC users are telling me that they can't see the word "Tour" on the button, only "Exit" until you move over the button, then they can see both words. The button functions perfectly on a Mac. Also I've been told that the video often appears choppy and sluggish on PCs, and not Macs. I'm encoding and streaming on flash media server - 400kps, CBR with alpha channel encoded, size 880x512. This is put on a stage size of 980x667 in Flash - is this is just too big of a window for streaming to handle? I have attached some files for reference.

View 1 Replies

ActionScript 3.0 :: FLV Playback Replay Button Only Works Once?

Aug 13, 2010

I have an FLVPlayer which plays a video and after the video is done playing, the REPLAY button shows up. Upon clicking the REPLAY button the movie starts over.. Everything works well, except, the REPLAY button only works once.. meaning, once the movie played once and REPLAY  button is cilcked to play it again, after the movie is done playing for the 2nd time - the button doesn't appear... here's the code:

import fl.video.*;import flash.display.MovieClip;var myVideo:FLVPlayback = new FLVPlayback();var mybtn:myBtn = new myBtn();var staticpic:staticPic = new staticPic();var logo:Logo = new Logo();myVideo.source = "BatterypoweredFCM.f4v";myVideo.skin =

[code]........

View 3 Replies

ActionScript 2.0 :: Set Interval Clear Button That Normally Works?

Apr 8, 2011

I am doing an animation of a system schematic I have had a weird thing come up with set interval.I have broken the animation down to three buttons a movie clip and a text field.When I call and clear the set interval from individual buttons the setInterval behaves correctly,but when i try and call and clear from one button with an if statement for a text field the setInterval will not clear.It also will not clear from the other button that is a set interval clear button that normally works.I have set the setInterval variable set to a number.Code Below and fla attached

[CODE]
boxmove=function(){
myBox_mc._x+=10[code]..........

View 1 Replies

ActionScript 2.0 :: Target Is Correct, But Button No Works?

Apr 13, 2005

this.menu_buttons_mc.menu_01_mc.menu_01_btn.onRele ase = function ()
{
trace ("this.menu_buttons_mc.menu_01_mc.menu_01_btn.onRe lease CALLED");

[code].....

View 3 Replies

ActionScript 2.0 :: Button Works Once, Won't Work If Clicked Again?

Dec 22, 2005

i have an issue with a button that, when clicked should make a loader component with a flashpaper object unload its movie and then set that loader's visibility to false.the button works fine if clicked once, however if you click it again it doesn't seem to be doing anything.. i have a feeling it has something to do with the flashpaper object (which is still buggy as hell... try editing _xscale on one of those things in a function call and watch it dance) cannot figure out why the on (release) event can't be called twice.. do i need to do something like reset the button state or something?

View 4 Replies

ActionScript 2.0 :: Target Is Correct But Button No Works

Apr 13, 2005

I used as usual: this.menu_buttons_mc.menu_01_mc.menu_01_btn.onRele ase = function ()
{ trace ("this.menu_buttons_mc.menu_01_mc.menu_01_btn.onRe lease CALLED");}; But problem ist : it works only for one btn. Why? Try click the second flake from above and see AS layer please. I think it would be easy for you but diffic. for me.

View 3 Replies

ActionScript 2.0 :: Bar - Play And Stop Button To Play And Stop Frames In A Flash Movie

Dec 1, 2004

give me the actionscript for a bar that has a play and stop button to play and stop frames in a flash movie. i would be gratefull if you could as i am really stuck

View 2 Replies

ActionScript 3.0 :: Multiple Button Functions - When Click The Button, The Mc Does Not Stop Playing And The Text Does Not Show Up?

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

ActionScript 2.0 :: KeyPress Not Working But Code Works On Button

Jan 28, 2009

[code]It works fine when I press the button but not when I press the enter key.Just to set the context I want users to be able to use enter to enter an answer into a grid before moving on to the next cell. My cells are all labelled A1, A2 etc so that I didn't get confused. As I am and will always be a newbie I couldn't figure out a function to do what I wanted so came up with what is probably a long winded way around: store the textfield instance name in an array and then call the item in the array in conjunction with setFocus - like I say it works when I click the button (which I intend to hide off screen).

View 10 Replies

ActionScript 3.0 :: Error 1009: One Button Works And The Other Doesn't?

Jun 26, 2009

In my document class I have the following snippet of code...

Code:
package
{
import flash.display.MovieClip;
import flash.events.MouseEvent;

[Code]....

I also applied a trace statement of "Working?" within the MenuScreen class file and it shows up before the error does! (Even though I don't click on anything...)

View 7 Replies

Button :: Setting Childindex For Depth Works Only Briefly ?

Jun 9, 2010

I am placing several AS3 buttons (actual buttons not event-laden MCs)on a Flash stage and want my enlarged rollover images to always come to the front of all other dormant buttons.My script-fu is weak,but piecing together the advice from several helpful posts I have generally learned how to set the childindex on a rollover event to be high enough to go to the fore.I plugged in the appropriate language in my action frame and was psyched to see that the coding worked...but only briefly.After just a few clicks (it seems that whenever a button is hit for the second time), not only did the childindex trick stop working, but the buttons (which  act to send the user to labeled frames later in the time-line) stopped working altogether.It seems that the issue is definitely related to the setting of the childindex, because when I remove those event listeners/commands,the buttons all work fine for an infinite number of clicks (but the enlarged  rollover images are stacked in one static sequence, blocking each other out).Is there something inherently incorrect about this approach?Something simple that I am overlooking? Some way to reset the process on  each click so it does not get gummed up (I tried re-setting childindex #s to 0 on rollout or on click, but it did not help)?

I have had it suggested that rearranging the order is destroying ability to recognize mouse events...but not sure if this is correct, what it would mean.The code that I am using for each button (for setting the depth and  for redirecting on click) is below,

View 3 Replies

ActionScript 1/2 :: Button To File Url Works In Preview But Not When Published

Feb 8, 2012

I have a strange issue with flash.
 
I have created a dynamic user interface which pulls urls from an xml file.
 
Heres the structure
 
Main movie
care_btn movie   
 
action script for main movie is as follows
links_xml = new XML();
links_xml.ignoreWhite = true;

[Code]....

View 7 Replies

ActionScript 3.0 :: Error 1009: One Button Works And The Other Doesnt?

Jun 26, 2009

I am experiencing an issue in AS3 that doesn't seem like it should be one at all...In my document class I have the following snippet of code...

Code:
package
{

[code].....

View 5 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved