ActionScript 2.0 :: Button Script Makes The MC Script Stop Working?
Jan 23, 2004
on the attached fla I have an "invisible" button (button with 0 alpha). I copied a script from the tutes section that will allow me to open a new window when the button is clicked.This works OK, but I also have a MC below the button layer and this MC has some AS attached to it which basically makes it fade out to the image on the bottom layer.
It seems to me that the button script makes the MC script stop working because it's above the MC layer (I've switched the button layer below the MC layer and the fade out then works, but the button doesn't.How can I get both scripts working together? I know that MC's can't work like buttons, but is there a work around this?
View 6 Replies
Similar Posts:
Mar 22, 2006
I am having problems with this function, which is called when a button is pressed. I am loading a JPG with a movieClipLoader into a newly created movieclip, and while this is loading the other is still viewable and is faded and deleted when the new JPG has fully loaded, using the code below:
ActionScript Code:
function loadBigPicture(iValue:Number, firstTime:String):Void {
this.createEmptyMovieClip("myBigPicture"+iValue, this.getNextHighestDepth());
trace(_level0["myBigPicture"+iValue]);
[Code].....
If the button is pressed extremely quickly again and again, the intervals begin to stop working
View 3 Replies
Feb 28, 2008
I have a project where I'm removing code for bandwidth detection, but after I remove it, my code in the }else{ won't execute anymore like it did before. Not sure what I'm missing? Maybe a pair of curly braces somewhere? Here is before, and after bandwidth code removal:
stop();
images_xml = new XML();
images_xml.onLoad = startImageViewer;[code].....
View 2 Replies
Apr 12, 2011
I have a button that I only want it to work when certain conditions are met, and if not, then this button will not work.
homeMC.gotoSleep_butt.addEventListener(MouseEvent.CLICK, toSleep);
function toSleep(evt:MouseEvent):void{ dayChange_MC.gotoAndStop("1"); day += 1;//add 1 to var day stat_day.text = String(day);}
[code].....
View 6 Replies
Feb 20, 2011
Ok so I have this simple animation I created of a circle that moves from one side of the stage to the other. I have added a new layer and called it buttons. On this layer I have added 2 buttons. One for start and another one for stop. The purpose is to get my circle to move from one side of the stage to the other but be able to use my buttons so that I can start and stop the animations at random times during playback. I fixed all my compiler errors now the problem lies in that everytime I click the start or the stop button I get an output error. I have a 3rd layer in which is titled actions and this is where all my code is posted. I removed that layer and placed my code in the first frame of the buttons layer to see if this would change anything but I still get the same output errors. So I just added back my actions layer. What could I be doing wrong? I have made sure to name all my movie clips and buttons correctly and I even added an instance name to them.[code]Here is my code and the errors I am getting when I press the play and stop button on test.Error #1009: Cannot access a property or method of a null object reference.
View 10 Replies
Jan 7, 2010
I had a button in scene and it worked perfectly.Then I put it in the movie clip, so it appeared only when mouse was over other button and then it stopped working.This is the code:
on(release){
mx.behaviors.DepthControl.bringToFront(_root.poloz enie_movie);
_root.polozenie_movie.gotoAndPlay(2);
}
Button should start a movie clip different than it is itself.
View 6 Replies
Jul 8, 2009
I use eventListeners to jump between frames.One of my frames displays a video. I imported the video as a component using the 'import video' function.It plays fine.When navigating away from the video I use the myVideo.stop(); command in AS3 to stop the video from continuing to play.or some reason, when I do this the buttons on my main page stop working.The code I use on the movie frame is:
cr_back_btn.addEventListener(MouseEvent.CLICK, onCRBackClick);
function onCRBackClick(e:MouseEvent):void
{
[code].....
View 5 Replies
Apr 10, 2009
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.
this.services_inner.buttonMode = true;
this.services_inner.addEventListener(MouseEvent.MOUSE_OVER, rollOver_services);
this.services_inner.addEventListener(MouseEvent.CLICK, onClick_services);
[code]........
View 11 Replies
Mar 12, 2006
It's been a while since I've last posted, but I read a lot of others' posts, and try to keep up to date.My question is this:I have a group of images that are loaded up using xml into a movieclip. The movieclip is masked. I have 2 buttons, that scrolls the grouping either up or down. I would like to make these buttons inactive when the grouping of images is on it's last row, meaning when there is only one row of images shown on the screen/mask.
I have tried using hitArea, but I wasn't successful. This would be easy for me to achieve if I wasn't trying to make it a bit dynamic. Basically, someone would be updating the xml file with more nodes/images and the swf would update the list of images, thus making it difficult to hardcode when the list should stop scrolling.
View 10 Replies
Feb 13, 2006
I have 3 buttons and 3 MC's .each button tells it's MC to play and then stop at frame 15 and then tells the other two MC's to play if they are already at frame 15 and if not do nothing.i have it working to a point but after pressing each button a few times the script see's to stop working.
View 7 Replies
Aug 27, 2009
The main AS timeline creates the enemy instance and calls them via the timer class. Inside the instance enemy movie clip there is some script to do a basic tween and there are functions to remove the enemy and to declare you've hit the enemy. The problem I'm having is when I try to call my KillEnemy function with a MouseEvent.CLICK (or MOUSE_DOWN, MOUSE_UP) event, it isn't registering, I realised this after testing the same function to listen for a MOUSE_OVER, MOUSE_OUT, it worked perfectly.
Can anyone explain why this is happening? Not just that the mouse seems to be a little delicate, even with the roll over listener called it isn't registering the event unless it hits a specific part of the movie clip enemy, which leads me to believe the movieclip is somehow built incorrectly? But even when testing the game with extreme settings (i.e. leaving the enemies on screen for a long time) the mouse clicks aren't registering still. Something is broken! Here is some of code inside the enemy movie clip, the problem lies on line 11:
[Code]...
View 6 Replies
Mar 8, 2011
I would like to create a button that makes my flash fullscreen.But this line:
stage.displayState = StageDisplayState.FULL_SCREEN;
does not work. Why?(I'm opening my swf directly in Chrome.)
Edit: There seem to be consensus that I should embed in HTML.
View 3 Replies
Mar 30, 2011
when the video reaches 1 minute, a button appears. is there a way to hide the button again if the user uses the seek bar to go back to the 30 second (or any time before 1 minute) point?
View 2 Replies
Aug 28, 2009
If I add the button component to my movieclip it makes it bigger, as if there's some sort of invisible padding or margin around it. Making a new fla, dragging the button component, and setting the below code as the document class produces a trace of w: 320, h:250 when run.Removing the mc.addChild(btn) line gives me a trace of w: 320 h: 240.The button isn't even close to the edge of the movieclip, so why is it expanding the movieclip's height by 10 pixels? I've been reading the documentation for the last few hours, but I can't find some hidden margin style or anything of the like I've been missing. The FLA & .as file are available here http[url].....
ActionScript Code:
package
{
import flash.display.*;[code].....
View 1 Replies
Jul 1, 2009
I'm making a website using flash,And on my movie it says Welcome to Blah Blah Blah,And then a button appears, To make sure my button works,The writing turns to bold and goes bigger,When the button appears it works and goes bigger, Until it reaches the point in the timeline where it has stop();It stops my movie from looping or restarting which is what i want, But it stops my buttons from working aswell, How to keep my button working but movie stops,If you want me to explain more just ask
View 1 Replies
Aug 10, 2005
how can make a button that makes the current page my homepage? im 99% sure there's Javascript involved and I've tried writing it my self P.S if its, I got one button to work (adding to favorites),
View 5 Replies
Sep 7, 2004
On this site [URL], the 'ENTER' button makes the next page view FULLSCREEN. The HTML coding they used for this was:
[Code]...
Is there anyway to do this by way of actionscripting a frame in a movieclip button.
View 1 Replies
Jan 31, 2004
I'm making a movie that makes a baseball cap rotate as long as a button is pressed. How can I do this?
View 2 Replies
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
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
Aug 17, 2009
I want to make a button that makes you got to a random frame within a certain range (eg frame 41-50) when you press it. I have tried various codes but so far no luck. Im using AS 2
and the button is within a couple of movie clips, but you can still click it when you test
View 1 Replies
Mar 7, 2010
I want to take a static text field, convert it into a button, and use it as a button. I need it static, because I changed orientation, and I do not know how to do that otherwise. The problem is, even though I converted it to a Button symbol, it does not work when I test the movie. It works fine with "Enable simple buttons", but when I test it, the button is not there, no change in mouse cursor, no reaction at all.So this is what I did:
Made text. // static, not selectable, Orientation: vertical left to right, / //rotated; Two filters: Drop Shadow and Glow;
Converted text field to Button - Symbol (scrollBT)
Editing the Button,I put the same content (the static text field) in all four frames: No luck, not working. without the Hit frame filled (which I think doesn't really make a difference): No luck, not working.Tried again, converting the static text field in the button into a Graphic Symbol: No luck, not working.Tried again, and put some differences in the frames for "ON" and "OVER" etc.: No luck, not working.Tried again, duplicating a similar, working button, edited it, and: No luck, not working.
To the button itself and the AS: The button will be a scroll-button for a text field, with different scroll speeds on rollover and press, but nothing else. The code for that I have (I think). It's something like (and please excuse my incorrect syntax here, but I'm typing from memory; still, I use the Script-Assistant and my syntax is apparently correct; it's also working with other buttons):
on {rollOver} {
function (scroll) {
textfieldtxt.scroll - = 1;}[code]....
I'm at the end of my wits. The only difference I can tell from other (working) buttons I did the same way, is that the scrollBt does not do anything except scrolling, while all of the others have frame actions (gotoAndplay etc.) associated with them.
View 1 Replies
Apr 18, 2011
[URL]
The ad on the bottom right of the screen (the one with lightning flashing) has an invisible button in its Flash file (CS5) linking to [URL]. This file is imported as SWF in Dreamweaver CS5.
The hyperlink works in Firefox, but not in Safari. Maybe it is just my computer.
View 1 Replies
Jun 5, 2009
I need someone to look at my clip for me and tell me why it's not working. I have the stop(); in frame one and the last frame, I just don't understand.I can't attach the file here because i only have winrar and winzip 12 (which creates a .zipx - which won't upload...i tried)
View 1 Replies
Jun 15, 2010
So, I'm working on a presentation/site that houses multiple sections being loaded in as individual swfs. I have each section shoot to a preloader frame first that is set (with PreloadAssetManager) to preload multiple FLVs and the SWF itself.If I select a new section while the current one is loading, it does the correct process of switching sections and shooting back to the preloader, but then the preloader itself just stops working completely. If I try to access any section, it just sits at a blank preloader. of thing.
View 1 Replies
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
May 11, 2006
I created a movie with several nested movie clips. within these movies are stop actions to prevent the clips from playing at the wrong time. I created the gotoAndPlay/stop functions to play these clips at certain points of the animation. Now at first these actions worked smoothly and exactly as i wanted, however after several test movies, some of the gotoandplay/stop functions stoped working. Has ne 1 ever ecounterd this problem is there a way repair these actions without recreating the whole movie? i tried rewritting the scripts and still does not work.
View 5 Replies
Aug 19, 2009
I have some code here that works except for when the item in bold is included:[code]If you take the bold part out, it works fine and stops dragging on release.
View 2 Replies
Apr 17, 2009
I'm making a very simple menu in Flash CS4 using AS3. I have a stop() action on the first frame of my scene, but it keeps getting ignored and looping the whole thing. The only other code is that telling the buttons to gotoAndStop on certain frames.[URL]...
View 5 Replies
Oct 29, 2009
I have 2 main movie clips, one for the menu bar and one for the content, there is then a movie clip within each one of those, one to hold the set of buttons, and one to hold the content movie clips. The menu bar has a control to flip between 2 sets of buttons. the viva content button works fine to begin with, but after the menu bar control is clicked, the content buttons stops working. Code is as Follows: All of the code (bar a few stop() flags on cirtain frames) is located on frame 1 of the root, which is the only frame on the root.
barControl.barContent.barUp.addEventListener(Mouse Event.CLICK, menuSwitchHandle); barControl.barContent.barDown.addEventListener(Mou seEvent.CLICK, menuSwitchHandle); barControl.barContent.barMenu.vivaBtn.addEventList ener(MouseEvent.CLICK, vivaHandle);
[code]........
View 3 Replies