ActionScript 3.0 :: Button With Switching Functions?

Jan 19, 2011

I'm working on a gallery. In the "Picture.as" class I load the picture and there is also a function with an animation to make the picture disappear. In the main class the pictures are put to stage by putting instances of the Picture class.All I need to do now is to adress the function in the according Picture instance. It works fine as long as I use the direct link, but when I use a variable it does not work anymore.Here's my code:

Code:
public class.... // just for the example
{

[code]....

View 3 Replies


Similar Posts:


ActionScript 2.0 :: Functions And Sub-functions - Button Doesn't Work OnRelease?

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

ActionScript 3.0 :: Switching Multiple Scenes With One Button?

May 30, 2011

I'm having issues with switching scenes for this 6 scene short story, between scene 1 and 2, the text (thats in a text box from my character) in my project, slides in and out just fine... At the end of the code in the 1st frame, I added a code snippet (click to go to next frame and stop), and it goes to the next frame, code then tells to click button, then the text switches/slides in and out fine, the horse(another character) comes into the scene fine... Then again at the bottom of frame 2 now, I add the same code snippet to the click button, its suppose to go to scene/frame 3, where the text slides in and then out, but it's giving me output errors, AND I noticed when I press the (click to go to next frame and stop)snippet again, it inputs a totally different snippet(click and play next frame), which I manually change back to the other snippet, and even make sure that its suppose to go to frame 3, and then it still gives me output errors: Error:
 
Cannot tween a null object. at com.greensock::TweenLite() at com.greensock::TweenLite$/to() at CortesWP1_fla::MainTimeline/fredRun2() at Function/http://adobe.com/AS3/2006/builtin::apply() at com.greensock.core::TweenCore/complete() at com.greensock::TweenLite/renderTime()

[Code].....

For some reason the code in scene 1(frame 1) to scene 2(frame 2) is fine. Its the code from scene 2(frame 2) to scene 3(frame 3) thats giving me issues. I'm trying to keep the button I created on the bottom right corner of the scene, to be the one button that clicks from scene 1 through 6(dones not need a previous button).

View 3 Replies

Flash :: Switching Child MovieClip Play Now/Now Playing Button

Nov 7, 2011

Is there an easy way to switch out a movieClip for another dynamically loaded movieClip?

I have and eventListener onCLICK that when selected it starts an FLVPlayback but I would also like to swap out with another movieClip Play Now / Now Playing button.

Just some background. I am looping and loading a play button jpg's into one movie clip and assigning an incremental number as a name to the play button movie clip. On Click that play button plays a movie but now I would also like to switch the play button graphic to a playing now graphic.

//ADD EVENT LISTENER TO ALL MY THUMBS_BUTTON
thumbs_button.addEventListener (MouseEvent.CLICK, playVideoThumb);
for (var i:Number = 0; i < my_total; i++) {

[Code].....

View 1 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

IDE :: "this" Inside Functions - Change Button State When Mouse Is Over A Button

Sep 3, 2009

Let's say I have 3 buttons (movieclips) and, using AS2, I want that when mouse is over a button, that button changes its state, something like

[Code]...

so that the same thing happens for each button when the mouse is rolled over it, by simply calling for each button a function inside which I refer to the button by using "this". And the problem is I cannot (don't know) how to do this in AS3. I mean if I use "this" inside a function, this refers to the main timeline. So is there a possibility to write a function like

[Code]...

View 3 Replies

ActionScript 2.0 :: 2 Functions To One Button?

May 2, 2006

i have to scripts each in a different movieclip, i have

Code:

_root.navigation_n_logo["next_btn"].onRelease = function() {
nextImage();
};
and

Code:

_root.navigation_n_logo["next_btn"].onRelease = function() {
galleryChoice(2);
};

so as you see, I want both functions to execute on the same button but it only does 1. how can i fix this? so that both functions execute on the same button/movieclip

View 4 Replies

ActionScript 3.0 :: One Button To Do Two Functions?

Jul 14, 2009

How could I code one button to do this

var showpage:Loader = new Loader();
var url:URLRequest = new URLRequest("fade.swf");
on1.addEventListener(MouseEvent.CLICK, showPage);

[code]....

And the Very Same button when clicked again to do this removeChild(showpage);Pretty much, What I have is a lightswitch, and when you click it, A black Fade appears arounf my FLVplayback.. And I want it, to where you click it again, the Black fade goes away..I can do this with two different buttons.. But was wondering if at all possible with one button.

View 1 Replies

ActionScript 2.0 :: Button Cannot Run Two Functions?

Apr 25, 2011

I have a button which should generate a salt mc and statin mc, but when i put the generating loop on the main timeline and run the function from the button it doesnt work. PS. i need the generating funcion on the maintime line as I need to remove the mc when I click the 'reset' button and also do hittests with the mcs

View 1 Replies

ActionScript 3.0 :: MC - Get A Button To Toggle Between To Functions?

Jun 18, 2009

I can't figure out how to get a button to toggle between to functions?It has to be more simple than an if()...else().. statement right?example:

myBtn_mc.addEventListener(MouseEvent.MOUSE_UP, what goes here?);

/* if the MOUSE_UP event is called and the chalkboard is blank, then write to the chalkboard
else erase the chalkboard */[code].......

View 3 Replies

ActionScript 3.0 :: Button Functions In IF Statements?

Aug 30, 2009

This time I am trying to use button functions with in IF statements.  However I am having trouble with the if statements regonizing the currentFrame(); or currentFrameLabel();.  I want diffrent button functions depending on what frame the playhead is in.  But the frames are in diffrent movieclips and what not.The next problem is that I do not full understand the way to do frame paths (IE Root.Movieclip.Movieclip) in AS3. series of tutorials that I could read and follow,

View 12 Replies

ActionScript 3.0 :: 2 CLICK Functions On 1 Button?

Feb 23, 2010

I'm making a menu in flash and I want that when I CLICK the button/movieclip moves up and when I CLICK again it moves down again. I allready did it with MOUSE_OVER and MOUSE_OUT but that gave me problems.
 
Here is the Code:
 
//Eventlistenersmenu_over.buttonMode = true;menu_over.addEventListener(MouseEvent.MOUSE_OVER,onOver,false,0,true);menu_over.addEventListener(MouseEvent.CLICK,onOut,false,0,true);//Functionsfunction onOver(e:MouseEvent):void {menu_over.gotoAndPlay("menu_op");}function onOut(e:MouseEvent):void {menu_over.gotoAndPlay("menu_beneden");}

View 3 Replies

ActionScript 3.0 :: One Button / Multiple Functions

Oct 31, 2011

I have used the loader script to load an external swf into current project. I have added a button to unload the external file when wanted, and was wondering if you could have multiple functions for that button, so that when you click it to unload it works as a 'home' button as well, and takes the user back to the mainpage again?Might be wise to mention that im kinda new to adobe flash and as3, and not sure if the way i have used to load the external swf was the easiest. Seems like a few have had some issues with this subject before me as well.

View 8 Replies

ActionScript 2.0 :: Multiple Functions For One Button?

May 8, 2008

How would I manage to enable a button to perform several operations? I want a button to do the following.

I want it to change colour etc, when it is hovered over, I also want it to activate anther flash file on the page via local connection on release. How do I allow the button to set up different actions? Do I need to make 2 separate invisible buttons? And have action script applied to both of them for the 2 commands? How for example would I be able to extend this so that I can have the button doing several things? Say:

1) On rollover it changes colour
2) On rollover it activates a flash mc on the page
3) On Click it changes colour
4) On release it takes the user to another page

View 2 Replies

ActionScript 2.0 :: Add Multi-functions To A Button?

Sep 20, 2009

How to add multi functions to a button ?[code]...

and by first_btn I wanna to disable one of the second_btn functions on press .

but the rest of second_btn functions remain work.how to do this ?

View 3 Replies

ActionScript 2.0 :: Call Two Functions From One Button?

Jun 8, 2010

I have written two arrays for two separate functions and trying to have a button call both. How is this done properly? The function calls, collection() and left() are conflicting.[code]...

View 1 Replies

ActionScript 2.0 :: Button Does Not Carry Out Two Functions?

Apr 26, 2011

i have a button which should generate two different variables, but it only carries out 1 function and not the other. If i put another button calling the second function it just overwrites the mc generated from the first function.

Also, I need the functions to be on the main timeline as i also need to remove the mcs when needed.

View 1 Replies

ActionScript 3.0 :: All Functions Run If One Button Is Pressed?

Feb 25, 2012

[Code].....

Even though I pressed only one button. The main menu button. PS: The faces are Colon and a P.

View 9 Replies

Actionscript 3.0 :: Button Functions On A Different Frame?

Feb 5, 2009

I am having trouble with defining buttons I have on a separate frame. I define the buttons in my main class on my first frame fine, I have a mc called buttons and then on frame 1 I have some buttons and on frame 2 I have a button called btspin.

so when I have the following:

buttons.btspin.addEventListener(MouseEvent.CLICK, spinmouseclick);
function spinmouseclick()...

in the class it doesn't work. And that makes complete sense to me.

So what I did instead was keep those functions still there, but I moved the listener into a function that is called once you get to the second frame. The function is called fine but when referencing the button inside that function I have a problem:

function spinmouseout(e:MouseEvent):void {
//Change BT Color
buttons.btspin.buttoncolor.transform.colorTransform = new ColorTransform();
}

when called mc-buttons is on the right frame it gives the error:

TypeError: Error #1010: A term is undefined and has no properties.
at MethodInfo-11()

View 1 Replies

ActionScript 2.0 :: Button With Multiple Functions?

Jan 28, 2003

how to make button do multiple things at the same time. i.e when button is pressed it animates object1 and object2 i have a buttons that opens a sliding door (code is:

on (release) {
control.gotoAndStop(2);
}

so it opens a door where sound control is and i want for the same button at the same time to open lets say another door somewhere in the same stage with a music tracks in ther

View 1 Replies

ActionScript 2.0 :: Button To Perform Two Different Functions?

Jan 8, 2005

I'd like a button to load a movie but only every third or fourth click. Is this possible? I don't know much about variables.

View 1 Replies

ActionScript 2.0 :: Button Functions Not Working?

Sep 14, 2006

i have a lil problem with making button functions to work on a mc within a mc...i have this on my outer mc:

Code:
onClipEvent (enterFrame) {
this.onRollOver = function() {

[code].....

View 6 Replies

IDE :: Get A Button To Do Two Different Functions With One CLICK Event?

Sep 30, 2009

I have attached a sample fla file of what i am talking about. I am trying to get a button to do two different functions with one CLICK event. depending were you are on the time line a window should open on close when button is clicked. The problem is it dose it once, opens then closes. I would like it to work every time the button is clicked either open or close depending on the state.

View 5 Replies

ActionScript 2.0 :: Call Two Functions With One Button?

Jun 8, 2010

Im doing something wrong.I have written two arrays for two separate functions and trying to have a button call both. How is this done properly? The function calls, collection() and left() are conflicting.Currently left() isnt working, but with collection() commented out it does.

Code:
collection_btn.onPress = function(){
_root.introscroller.gotoAndStop(1);
collection_btn.gotoAndStop(2);[code].....

View 1 Replies

ActionScript 2.0 :: Assign Button Functions In Forloop?

Nov 3, 2009

I'm populating a list of buttons dynamically with a forloop like this:

Code:
for(x=0;x<imageList.length;x++)
{

[code].....

View 2 Replies

ActionScript 3.0 :: Button Functions Not Working Properly?

Oct 17, 2010

I'm putting together a pretty basic website/portfolio. The buttons/code that go from page to page work great. The code I'm using to access larger images from thumbnails is basically the same, however it's not working.I have the site setup so that each larger image is it's own separate page, so basically the thumbnails act as buttons to access a specifically labeled page. Ex- Thumbnail/button "Character1_btn" goes to the page labeled as "Character1" to display the larger image. I hope this makes sense.Below is the code I'm using. As I said- all functions but the character1 function are working properly.. I really need the character 1 function to work.Quote:

stop ();
home_btn.addEventListener(MouseEvent.CLICK,playhom e);
function playhome(event:MouseEvent):void{

[code].....

View 2 Replies

ActionScript 3.0 :: Control Two Functions On One Button Click?

Jan 10, 2009

how I can control two events on one (the same) button click. On click, the first function must jump the user to a particular frame label and at the same time trigger a second function which is a movie clip on that particular frame. I must note that the event listener is attached to an actual Button and not a movie clip.

View 3 Replies

ActionScript 3.0 :: Button (MovieClip) With Two Click Functions

Aug 9, 2009

I'm almost 100% sure that I have to write an if, else statement for this. Below is the code I have for a button(movieclip) I created. It is suppose to play an animation when you click on it. Then when you click it again it's suppose to play a second animation that will take it back to the original state. What is happening is, it goes straight to the clicked state without playing the animation. However when you click the second time it plays the animation that takes you back to the original state. Am I correct in believing the only way to get the animation to play on both clicks is to use an if, else statement.

function clickPlus(event:MouseEvent):void {btn1.gotoAndPlay("clickOpen"); }btn1.addEventListener(MouseEvent.CLICK, clickPlus);
function clickX(event:MouseEvent):void {btn1.gotoAndPlay("clickClose"); }btn1.addEventListener(MouseEvent.CLICK, clickX);
btn1.removeEventListener(MouseEvent.CLICK, clickPlus);

View 3 Replies

ActionScript 1/2 :: Creating A Movieclip That Functions Like A Button

Aug 16, 2010

This has served me well, but I've been designing a new sight and wanted to get more into Action Script to control functions to help improve both my programming and keep my file size down.
 
So I decided to create an instance of a block (rectangle shape as another movieclip) and have multiple layers.  One which controls the actions of two other blocks.  The upper most block would not be visable until I ran the cursor over it (increase its Alpha property from 0 to 100 one step at a time in a loop).  This would reverse when the cursor ran off (reduce Alpha property from 100 [or less] back to 0 in a loop).
 
I've read and re-read every flash book I own on the subject and cannot understand why I can't control another instance of a different movieclip.

View 1 Replies

Professional :: Make A Button Have Multiple Functions?

Aug 19, 2010

can you make a button have multiple functions? as in if i click a button one and imahe will pop up and then click that same button and another different image will pop up??

View 1 Replies







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