Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




If (button Was Clicked)



i want to write somthing like this:

if(_root.nextbtn[[onrelease]]){
this.gotoAndStop(gotopage);
}
else(){
play();
}

how would i do this

thanks!
austin



Ultrashock Forums > Flash > ActionScript
Posted on: 2006-07-18


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

If This Button Clicked Load Mc With This Text If This Button(different One) Clicked L
if this button clicked load mc with this text if this button(different one) clicked load same mc, with different text...is this possible?

Display Movie-clip With Image/text/button ..when Clicked On A Button
We had generated a template.

Template has 2 area
Buttons on left and right had side area is blank

on click of button we want to display a movie-clip having image/text and buttons for nvaigation.


We found that on click we can display the movie ...it displays image text is not diapled. Also we want to display buttons on the same.

Your help is great value addtion to us.

Thanks in advance

Ramesh

Button States - How To Keep Button On Rollover State When Clicked.
on (rollOver) {
this.btn_about.gotoAndPlay("mouseover");
setProperty(this.btn_about, _x, 25);
setProperty(this.btn_about, _y, 29);
}
on (rollOut) {
this.btn_about.gotoAndPlay("mouseout");
}

on(release){
_parent.gotoAndStop("about");
}

There's my button code. Now a rundown on my delima.

I have a movie "company.swf" that is loaded into an empty MC "content" that is located within my main movie "main.swf". My buttons are all located inside an MC "subnav" inside of company.swf. I have seperate MC's for each button with an actual button with just a "hit" area. I would like each button to stay in the rollover state when clicked so a user knows where they are in each section. I hope I'm being clear here. My rollover and rollout works fine.

Please help!! Thanks

Text Field Over Button Prevents Button Being Clicked
I'm trying to create a custom button class that lets you specify some simple parameters, including the text that goes on the button. However, the text field blocks the button (because it's on top of the button), and so the even listener assigned to the button doesn't detect a CLICK event.

I've read about setting mouseChildren = true, but that works for other display objects and isn't an option for a TextField instance.

Can anybody tell me what I'm missing here. And also, is there a different way of going about having some sort of customizable button that might be better?

If it helps, here is my basic class. An instance of the class is instantiated with:

var btn:ButtonSimpleText = new ButtonSimpleText(120, 20, "Button Label");
addChild(btn);

CLASS BELOW










Attach Code

package {
import flash.display.*;
import flash.events.*;
import flash.text.*;

public class ButtonSimpleText extends Sprite {
public function ButtonSimpleText(w:Number, h:Number, labelText:String){
// Button
var button:SimpleButton = new SimpleButton();

var up:Shape = new Shape()
up.graphics.lineStyle(0,0xFFFFFF,1);
up.graphics.beginFill(0xCC0000);
up.graphics.drawRect(0,0,w,h);
up.graphics.endFill();

button.upState = up;
button.overState = up;
button.downState = up;
button.hitTestState = up;
button.addEventListener(MouseEvent.CLICK, clickListener);

// Text format
var tf:TextFormat = new TextFormat();
tf.font = "Arial";
tf.size = 12;
tf.bold = true;
tf.align = TextFormatAlign.CENTER;
tf.color = 0xFFFFFF;

// Text label
var label_txt:TextField = new TextField();
label_txt.selectable = false;
label_txt.text = labelText;
label_txt.width = w;
label_txt.setTextFormat(tf);

var btnHolder:Sprite = new Sprite();

btnHolder.addChild(button);
btnHolder.addChild(label_txt);

addChild(btnHolder);
}

private function clickListener (e:MouseEvent):void{
trace ("Click");
}

}
}

Make Button GotoAndPlay When Another Button Is Clicked
ok. next dilemma.

once the button is pressed it stops on frame 16. there will be several other buttons. what i'd like to happen is that when another button is pressed the previous button that was pressed (which would currently be on 16) will gotoAndPlay frame 17 which animates it and makes it known to the user that they have already clicked it.

here is the code i have right now which all it currently does is make the frame stop on 16 when it is clicked. i'm not sure what the best way to go with the code on making it jump to frame 17 when another button is clicked. i've included the fla file for reference.

if i used something like:
if (button1._currentframe==16)
gotoAndPlay(17)
then i would have to create this code for every instanced button...which could be time consuming if there are around 30 buttons or so.....


stop();
this.onRollOver = function() {
this.gotoAndPlay(2);
}
this.onRollOut = function() {
this.gotoAndPlay(3);
}
this.onPress = function() {
delete this.onRollOver;
delete this.onRollOut;
this.gotoAndStop(16);
}

If Button Has Been Clicked...
I know there's something that can do this, but I just don't know what it's called... Here's what's going on:

I have music changing throughout the entire movie. It changes whenever it gets to the frame, and the frame actions tell it to change to a certain song. Now, this makes it a little difficult to have an on / off feature for the radio. Basically, when the user clicks the "off" button, I want some variable or something (I'm horrible with actionscrip terms) to be set to a certain number (let's just say 0 is off, 1 is on in this example). When the movie reaches the frame that starts the new music, I would like to make it have a choice. If the certain variable is set to 0, it doesn't start to play the music. If it's set to 1, it plays the music as normal. I also want the movie to start out with the variable set to 1.

Yes, I know, I need to work on my actionscript vocabulary... But does anybody understand what I'm trying to do? If not, let me know, I might be able to set up some sort of .fla example. Thanks for any help!

Button Has Been Clicked
If I could kick myself in the head I would.

I am trying to create buttons that will change their appearance after they've been clicked. Just like when you click an html link, that link has now changed color to indicate it has been clicked.

I've tried for weeks now and keep coming up against a brick wall.
Why is there no simple way to do this, a component, something?!

I've come close by making a MC that has 2 frames and two buttons, one click brings you to the next frame. If I place that MC on the stage it works. However when I place the same MC on the stage and attach code to it:
on(press)...
the buttons in the MC are no longer active?

Turning grey.
please help......
B

Button If Not Clicked
Is there a possibilty to make a button, and give him the action that if there's not clicked in (example: 10 seconds, or 250 frames or what ever) the button plays the action?'

Thx in forward

Want To Allow Button To Be Clicked Only Once.
I searched but couldn't find anything like this, so I thought I'd just ask. Apologizes if it's been explained before! Just so you know, I'm still using Flash 5 (sad, I know.)

This is probably a simple problem to solve- I have a few buttons for navigation, and when someone clicks on one of the buttons I don't want the button to be available to be clicked on again until you're back on the main menu. How is that done? Any help greatly appreciated!

Button Clicked
I want to add a text when a button is clicked. I try to put the additional text on the Hit Event of the button, but it doesn't work, can Anyone help, please?

I Need A Pop-up Box To Appear When A Certain Button Is Clicked...
My current project is a site for my band.
I have 6 links, all of which work wonderfully.
-EXCEPT the "E-MAIL" button.
All the other buttons envoke simple timeline shifts.
But I would like the "E-MAIL" button to simply open a new window that makes the user ready to email my band, by just typing in their message (and return adress) then clicking "SUBMIT".
I know this might be a lot to ask of some one so...
THANKS TO ANYONE THAT CAN HELP ME...

Thanks,
   XAQ

Which Button Was Clicked
I'm making a set of buttons from xml...each button is corresponding with a picture in a photogallery...
Code:

for (var i:Number = 0; i < intSlideCount; i++) {

   var newThumb = this.addChild(new Thumb());
   newThumb.x = X + (SPACE * i);
   newThumb.y = Y;
            
   newThumb.theNum.text = i + 1;
   newThumb.addEventListener(MouseEvent.CLICK, onClick);
}


Here is my onClick listener...
Code:

private function onClick(e:MouseEvent):void {
   if(slideTimer.running) {
      slideTimer.stop();
   }
         
   slideLoader = new Loader();
   slideLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, fadeSlideIn);
   slideLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, showProgress);
   slideLoader.load(new URLRequest(xmlSlideshow..image[????????].@src));
}

i can't figure out how to get the button to correspond with the correct picture... hence the question marks...please help

Javascript Button Needs To Be Dbl Clicked, Why?
I am adding a javascript button. The purpose of the button is to go back. I have the following script and it is needing to be clicked twice before actually going back to the previous page. I have tried it with and with out the onclick in the code and nothing has changed. Can you help? Thanks in advance, I am desperate...

This is the code i have tried, both with the onClick and without:

on (release) {
getURL ("javascript: onClick(history.go(-1))", "_self");
}

When Button Is Clicked It Disappears
How would I use ActionScript to make a button that disappears when clicked on.
Thanks for the help

Run 2 Movieclips When Button Is Clicked.
ok here is my problem...it is simple i don't know why i can't figure it out ! When i click on a button i need my movie to run 2 movie clips, but i totaly forget how to use the _root. command. Could somebody please help me . Thanks for your time .

Actions After A Button Is Clicked
what code and procedure would i use to do this:
i have a set of buttons that will each show up a new movie clip. i have each different movie clip on a different layer. how would i make it so when you click on a button it will go to the next movie clip, but before that it will play, say the 10 frames of the movie clip that is already visibile? what i have is squares that basically fade in, then i want them to fade out on the exit. thanks.

Wich Button Was Clicked?
Hi!

I've made a small flash application where the user answers a couple of questions and the result is a graph. At first the user was supposed to answer the questions as fast as possible with no option to go back (and change the answer). The only way to make changes was to start from the beginning.

My problem now is that my boss have changed her mind and wants to have the possibility to go back and to be able to change the answers.

There's no problem to make the back-button and so on. The problem is the variables. When the user clicks the back-button and the application jumps back to the previous scene the state of the different buttons goes back to the default, unclicked state and the user cannot see what answer they have given. If they give the same answer once again the variable for that particular question is doubled. All buttons are movieclips and have different instance names. When a button is clicked the button-movieclip jumps to either a "clicked state" or a "unclicked state". The clicked state adds value to the variable and the unclicked state subtracts the same value.

I need to know wich button was clicked so I can use an array to "remember" the buttons state and the value of the variable so the user can change their mind and their canges are reflected in the variables ...

As there are 80 questions, I don't want to have 80 different
buttons. Now I got four different buttons for the four alternative answer possibilities.

So, how can I trace wich button that was clicked, and remember it.

Eh ... sorry 'bout the long question, but I wanted to make myself clear. ( I think I failed though ... ) If anybody understands what I'm asking and don't fall asleep while reading it, please help me.
Thanx

/

Disabling A Button After Being Clicked - How?
How do you disable a button after it is being clicked, and at the same time enable again the other buttons (so including the button that was disabled before?).

Can Button Do A Different Command After Being Clicked Once?
Can a button know if it's been clicked before, and if it has, do a different function the second and all subsequent clicks?

For example, the first time a button is clicked, I want the user to be taken to a specific frame where an intro MC sits. Lets call this frame 10 for discussion sake. If a user has already clicked the button once, visits somewhere else within the site and decides to come back, I don't want them to have to view the intro MC again, I want them to bypass it and go to frame 11.

Is this possible, if so how?

Thanks!

Button Only Works When Clicked Twice
I created a simple button which works fine in the .fla file. It has a "go to frame 2 and play" action. Whenever I export the file, the button does not work on the first click. It shows the down state fine, but you have to click twice to activate the action.

Please help.

Yes, I'm more or less a beginner.

Hide The Clicked Button
in Director, you can use 'Me' to call on the object that has been clicked, dragged, whatever...

is there a way to call on an object in flash in that same way?

for example, i'm wanting to have a button disappear once it is clicked. thing is, i have 25 buttons on the screen with different instance names.

i could go to every button and put in 'button01._visible = 0;' but there's gotta be another way.

something like...

Code:
on (release) {
me._visible = 0;
}

Button Needs To STAY Clicked
I'm creating multiple swf palettes for a project in Director, and the navigation is multi-tiered.
it's important for each button in a palette that the user clicks to stay down until they click another button in the same palette. Please don't tell me I have to do this through the timeline...

Hope someone can help.

Button A Different Color After Clicked
Sorry if this problem has been addressed before but here it goes.

I am creating an interface with four main buttons. When the user clicks on one of the buttons and the movie goes to that scene, I would like for that particular button to have a different color than the other buttons. It will retain this color while the user is in that scene.

How do I do this?

Thanks for the help as always.

Rollout Only If Button Isn't Clicked
How do I tell the rollout to only play if the button ISN'T clicked? If the button is clicked I want it to do what the on release command tells it to do and not the rollout command.

How To Make A Button Known When Clicked
how do I make a button change a differant color when the user has clicked it, so they can see what buttons they have clicked already.

purley action script, so i don't have to re-design the button


PCRIDE

Button State Once Clicked
I have a button that once clicked I want to change color. How do I do this!???

Thanks

Pease Help MC Following Clicked Button
Can anyone help me do this:

I want a small symbol (or clip) to move over to various buttons as they're clicked.

An example is here:

http://www.flashforward2001.com/flash/flash_site.html

Notice the small orange cross sliding over near the menu buttons as they're moused over.

Only difference is that I want the cross to only slide over once a button is clicked.

Any ideas anyone?!?

Thanks,

Alli

Button Placed On Position When Clicked
Please see this template and tell me how to create a button like this. (when click go to the left and other come to their position) I want to know the actionscript, if possible please include the sample source file.

I don't want to know regarding the bending effect because i acheived that.

Link
-----
http://sv2.3dbuzz.com/vbforum/attach...&postid=725989

Button Only Works If Not Clicked Before
So i have this button, that when clicked a bunch of stuff slides in, typical right? Now the problem is if you click the same button again, it all vanishes and slides back in, which is expected. Now i want that button to only work if it hasnt been clicked, i figured i would have to do something like this:

on (press) {
_root.nogo = 3;
}
on (release) {
if (_root.nogo != 3) {
tellTarget ("/news") {
_root.goto = 25;
play();
}
} else {
stop();
}
}

But it doesn't work. Nogo, is a variable to which each button if clicked assigns a number. Then that same button has the if/else statement to regulate is ability to be clicked. I must have overlooked something though, any help?

How To Remember A Button Which Has Been Clicked?
Hi,

I have about 30 buttons which represent 30 photos. So when you click one of them, it shows the respective photo. I basically need 2 button functions:

1. Toggle
The clicked button will be "Off", but when you click any other button, the previous clicked button will be reactivated(toggles back to "On").

2. Remember the buttons that have been clicked
Those clicked buttons will be dimmer than fresh buttons(never been clicked), but they can still be clicked again. That way user can always revisit the photos they have just gone through while knowing it before they click them again.

Those two functions are tough for me to implement since I'm a flash newbie. But they're important part of the interaction design. Can anyone help me out here?

How To Remember A Button Which Has Been Clicked?
Hi,

I have about 30 buttons which represent 30 photos. So when you click one of them, it shows the respective photo. I basically need 2 button functions:

1. Toggle
The clicked button will be "Off", but when you click any other button, the previous clicked button will be reactivated(toggles back to "On").

2. Remember the buttons that have been clicked
Those clicked buttons will be dimmer than fresh buttons(never been clicked), but they can still be clicked again. That way user can always revisit the photos they have just gone through while knowing it before they click them again.

Those two functions are tough for me to implement since I'm a flash newbie. But they're important part of the interaction design. Can anyone help me out here? A sample FLA file would be great!

Btw, I use Flash MX.

MC Button Will Not Work Until Clicked Twice...
Hi all, I have the following code on a MC on my main timeline.


Code:
on (release) {
_root.mainFader.gotoAndPlay("fade");
_root.newClip = "systemClip";
}

on (rollOver) {
_root.picMask.gotoAndStop("systemFrame");
_root.picMask.maskFader.gotoAndPlay(1);
_root.navOverview.gotoAndPlay(2);
_root.picMask.timerClip.stop();
}

on (rollOut) {
_root.navOverview.gotoAndStop(1);
_root.picMask.timerClip.play();
}
Everything works, however, when the frame with this button is loaded, the first time you click the MC it does not execute the on (release) portion. You have to click it a second time to make it work.

Does anyone know what could cause this to happen or have any solutions?

How Would I Determine The Last Button Clicked?
Hi there, hopefully this shall be a quick question!

How would I go about creating a variable that determines the last button that was clicked.

I want to be able to say "if (lastbuttonclicked=="Main")"

Is this possible?

Thanks

Button Clicked Twice Problem
How do I make a movie clip play once only when a button is clicked and on the 2nd clicked nothing well happen.

If Button Clicked Twice, Goes To A Different Slide
Hello, I am currently working on a flash project for my uni degree and i am fairly new to flash. In this project i am working on i have a menu page which stays the same throughout BUT when you click the menu buttons it will go to the right frame number on the first time its clicked, but on the 2nd of 3rd time it will go to the next frame. i have enclosed the file, if anyone could help i would be very grateful, thank you

code for buttons

on(press){
gotoAndPlay(10);
}

//frame number goes up in integers of 5 for each slide

[CS3] If ANY Button Is Clicked Action?
Maybe this is a stupid question. I have a movie clip that dynamicly comes on stage when a button is clicked. I have built an exit for this movie. However, if the visitor attempts to go to another area of the site that mc will remain there. Is there a way to build a function that executes an action if ANY buttons are clicked. A full-proof way to unload that mc if the visitor attempts to go to another area.

Returning A Value From A Clicked Button To Be Used Later On.
I have a button that I want to return the value of currentSelection which gets assigned when a user clicks. How to I get the value currentSelection so that I can use it later in my busLocation function. Thanks for looking


PHP Code:



button.onRelease = function() {   endX = -section4;   endY = 0;   currentSection = section4 + currentPosition;  trace(currentSection);}; 





PHP Code:



function busLocation() {  bus_mc._x += 1;  trace(currentSelection);//traces undefined  if (bus_mc._x = currentSelection) {    clearInterval(busLocationInterval);    }} 

Need My Button To Stay Clicked
Hi there, im new here and i thing that its not too complicated my question...
im new on actionscripting too but i am trying hard too make one menu for my site.

I aprreciate any of u that may help me!


Question: Need that the button clicked, stay clicked until button clicked, so that previous button will back to his previous stage(normal).

And if u can clean up mycode..

my code:


import mx.transitions.Tween;
import mx.transitions.easing.*;

pagini.onEnterFrame = function(){
if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
}
}


pagini.onRollOver = function(){
tellTarget("quad1")
gotoAndPlay("sobe")
var teste:Tween = new Tween(pagini, "_y", Elastic.easeInOut, 10, 0, 0.5, true);
rewind = false; //set variable (or switch) that decides wether ot not to play backwards...
play(); // play this movie clip.. (grow the button(tween));
}

pagini.onRollOut = function(){
tellTarget("quad1")
gotoAndPlay("desce")
var teste:Tween = new Tween(pagini, "_y", Strong.easeOut, 0, 12.5, 0.5, true);
}


pagini.onRelease = function(){
tellTarget("alfa")
gotoAndPlay("subir")
_root.ameg.gotoAndStop(1);
_root.prod.gotoAndStop(1);
_root.n = 1;
getURL("http://www.megaforth.com.br/index.asp");
}


ameg.onEnterFrame = function(){
if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
}
}

ameg.onRollOver = function(){
tellTarget("quad2")
gotoAndPlay("sobe")
var teste:Tween = new Tween(ameg, "_y", Elastic.easeInOut, 10, 0, 0.5, true);
rewind = false; //set variable (or switch) that decides wether ot not to play backwards...
play(); // play this movie clip.. (grow the button(tween));
}

ameg.onRollOut = function(){
tellTarget("quad2")
gotoAndPlay("desce")
var teste:Tween = new Tween(ameg, "_y", Strong.easeOut, 0, 12.5, 0.5, true);
}

ameg.onRelease = function(){
getURL("http://www.megaforth.com.br/amegaforth.asp");
}

prod.onEnterFrame = function(){
if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
}
}

prod.onRollOver = function(){
tellTarget("quad3")
gotoAndPlay("sobe")
var teste:Tween = new Tween(prod, "_y", Elastic.easeInOut, 10, 0, 0.5, true);
rewind = false; //set variable (or switch) that decides wether ot not to play backwards...
play(); // play this movie clip.. (grow the button(tween));
}

prod.onRollOut = function(){
tellTarget("quad3")
gotoAndPlay("desce")
var teste:Tween = new Tween(prod, "_y", Strong.easeOut, 0, 12.5, 0.5, true);
}

prod.onRelease = function(){
getURL("http://www.megaforth.com.br/produtos.asp");
}

saladeimp.onEnterFrame = function(){
if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
}
}

saladeimp.onRollOver = function(){
tellTarget("quad4")
gotoAndPlay("sobe")
var teste:Tween = new Tween(saladeimp, "_y", Elastic.easeInOut, 10, 0, 0.5, true);
rewind = false; //set variable (or switch) that decides wether ot not to play backwards...
play(); // play this movie clip.. (grow the button(tween));
}

saladeimp.onRollOut = function(){
tellTarget("quad4")
gotoAndPlay("desce")
var teste:Tween = new Tween(saladeimp, "_y", Strong.easeOut, 0, 12.5, 0.5, true);
}

saladeimp.onRelease = function(){
getURL("http://www.megaforth.com.br/sala.imprensa.asp");
}

repres.onEnterFrame = function(){
if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
}
}

repres.onRollOver = function(){
tellTarget("quad5")
gotoAndPlay("sobe")
var teste:Tween = new Tween(repres, "_y", Elastic.easeInOut, 10, 0, 0.5, true);
rewind = false; //set variable (or switch) that decides wether ot not to play backwards...
play(); // play this movie clip.. (grow the button(tween));
}

repres.onRollOut = function(){
tellTarget("quad5")
gotoAndPlay("desce")
var teste:Tween = new Tween(repres, "_y", Strong.easeOut, 0, 12.5, 0.5, true);
}

repres.onRelease = function(){
getURL("http://www.megaforth.com.br/representantes.asp");
}

revend.onEnterFrame = function(){
if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
}
}

revend.onRollOver = function(){
tellTarget("quad6")
gotoAndPlay("sobe")
var teste:Tween = new Tween(revend, "_y", Elastic.easeInOut, 10, 0, 0.5, true);
rewind = false; //set variable (or switch) that decides wether ot not to play backwards...
play(); // play this movie clip.. (grow the button(tween));
}

revend.onRollOut = function(){
tellTarget("quad6")
gotoAndPlay("desce")
var teste:Tween = new Tween(revend, "_y", Strong.easeOut, 0, 12.5, 0.5, true);
}

revend.onRelease = function(){
getURL("http://www.megaforth.com.br/revendedores.asp");
}

downl.onEnterFrame = function(){
if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
}
}

downl.onRollOver = function(){
tellTarget("quad7")
gotoAndPlay("sobe")
var teste:Tween = new Tween(downl, "_y", Elastic.easeInOut, 10, 0, 0.5, true);
rewind = false; //set variable (or switch) that decides wether ot not to play backwards...
play(); // play this movie clip.. (grow the button(tween));
}

downl.onRollOut = function(){
tellTarget("quad7")
gotoAndPlay("desce")
var teste:Tween = new Tween(downl, "_y", Strong.easeOut, 0, 12.5, 0.5, true);
}

downl.onRelease = function(){
getURL("http://www.megaforth.com.br/downloads.asp");
}

falec.onEnterFrame = function(){
if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
}
}

falec.onRollOver = function(){
tellTarget("quad8")
gotoAndPlay("sobe")
var teste:Tween = new Tween(falec, "_y", Elastic.easeInOut, 10, 0, 0.5, true);
rewind = false; //set variable (or switch) that decides wether ot not to play backwards...
play(); // play this movie clip.. (grow the button(tween));
}

falec.onRollOut = function(){
tellTarget("quad8")
gotoAndPlay("desce")
var teste:Tween = new Tween(falec, "_y", Strong.easeOut, 0, 12.5, 0.5, true);
}

falec.onRelease = function(){
getURL("http://www.megaforth.com.br/contato.asp");
}

faq.onEnterFrame = function(){
if(rewind == true){ //if rewind switch is set to true play backwards
prevFrame(); // play backwards
}
}

faq.onRollOver = function(){
tellTarget("quad9")
gotoAndPlay("sobe")
var teste:Tween = new Tween(faq, "_y", Elastic.easeInOut, 10, 0, 0.5, true);
rewind = false; //set variable (or switch) that decides wether ot not to play backwards...
play(); // play this movie clip.. (grow the button(tween));
}

faq.onRollOut = function(){
tellTarget("quad9")
gotoAndPlay("desce")
var teste:Tween = new Tween(faq, "_y", Strong.easeOut, 0, 16.4, 0.5, true);
}

faq.onRelease = function(){
getURL("http://www.megaforth.com.br/faq.asp");
}

FLV Streaming Before Button Is Clicked
Hi, I would like the following script to stream video after btn1 is clicked but the current code streams the video as soon as the .swf is opened:


ActionScript Code:
btn1.addEventListener(MouseEvent.CLICK,onRelVol1);

function onRelVol1(ev:MouseEvent):void{
    videoStream.play("http://www.mothergoosedvd.com/video/vol1_clip1_240x180.flv");
}

var videoConnection:NetConnection = new NetConnection();
videoConnection.connect(null);
var videoStream:NetStream = new NetStream(videoConnection);
var cli:Object = new Object();
cli.onMetadata = metaDataHandler;
videoStream.client = cli;
videoStream.play("http://www.mothergoosedvd.com/video/vol1_clip1_240x180.flv");
var video:Video = new Video();
video.attachNetStream(videoStream);
addChild(video);

function metaDataHandler():void{
trace("Metadata handled");
}

Radio Button Clicked?
Hi mates!

I've programed a multiple choice form containing 20 Radio Button Groups including 4 Button each. But when I switch between the sites the status of the button clicked before is gone.

What must I do in order to keep the status of the selected button displayed?????

How Do You Have A Button, When Clicked, Go To A New Scene?
How do you have a button, when clicked, go to a new scene? That's my question, but it may not be what I want. I am trying to make a 3D version of my room. I want there to be many clickable places in my 3D room (ie. turn the computer on, turn the light on, open a book) Is this what I need (the ability to switch scenes) or do I need somthing else. The problem is that I am a good artist, but an awful programmer. Thanks for the hlep!

Unload MC When Other Button Clicked?
Hi, I have this image gallery from a template file I'm attempting to customize with actionscript for more flexibility but I came across a problem with external jpg image loading. You see, when loading them via a click of a thumbnail, I load the jpeg into a new MC on the highest level. Now I'm looking for a way to unload it when any further buttons are clicked (including it's own thumbnail). I realize I could call the unload command in every single button in the interface but I was wondering if there was a global function I could use instead. Something like "anyButtonRelease"

Any ideas?

Or maybe I'm looking at this the wrong way...

thanks

Play MP3 From URL When Button Is Clicked
Hello,

Can anyone give me the ActionScript to solve this problem.

I have a button, when this button is clicked I want it to play an MP3 from a URL somewhere on the web. In this case "

How To Emulate A Button Has Been Clicked?
Hi:

I have a MC and when the user clicks it something is done:

myButton.onRelease = function() {
....
}

How can I simulate it has been clicked? i.e. send an "artificial" onRelease event?

Thanks in advance,

David P.

How Do I De-activate A Button After It's Clicked Once
I'm doing a simple quiz and I only want the user to add to the total score once if he presses the correct button. How do I stop him from being able to click it multiple times using script rather than just adding a key frame and removing it's instance name or replacing the symbol altogether. This is what I have on the frame for the button.

car_btn.onRelease = function() {
right = new Sound();
right.attachSound("right");
right.start(0,1);
subTotal++;
gotoAndPlay("correct4.1c");
};

Keep A Button Set To Hover Once Clicked
Hi,

I was wondering if there was a quick way to set a button to it's hover state once clicked?

I know how to do this by having it be a movie clip and changing its time line position onRollOver. onRollOut and onRelease. I am just trying to do this quick using a button so didn't want to deal with all that. Thanks!

Checking Which Button Is Clicked
I have four buttons on frame one. When one of the buttons is clicked, it then goes to fame two. There is not much difference between what the buttons do: addition, subtraction, multiplication, and division. Ideally the program would

1) Check which button is clicked
2) Go to frame 2
3) Depending on which button was clicked in frame 1, do an addition, subtraction, multiplication, or division

I have a couple of issues

1) Is there a simple way to check which button was clicked? I figure you could have different function calls in the addEventListener function for each button and then write a different function for each button. But I was wondering if there is a way to do it with if statements? Meaning the same function is called in addEventListener for each button and then the function checks which button triggered the function call. The code below shows what I'd like to do (it includes pseudo code).

2) How do I pass a variable from frame one to frame two? Here I could have 4 separate frames (one for each arithmetic operation) but I'd prefer to have only one frame and pass the correct operator (+, -, *, /) to frame two and then have frame two do an addition, subtraction, multiplication, or division depending on which operator was passed to it.







Attach Code

//FRAME ONE CODE

stop();

btnAdd.addEventListener(MouseEvent.CLICK, fnSolve);
btnSubtract.addEventListener(MouseEvent.CLICK, fnSolve);
btnMultiply.addEventListener(MouseEvent.CLICK, fnSolve);
btnDivide.addEventListener(MouseEvent.CLICK, fnSolve);

function fnSolve(event:MouseEvent):void{
if (btnAdd was clicked){
Pass "+" to frame two
gotoAndStop("solve");
} else (if btnSubtract was clicked){
Pass "-" to frame two
gotoAndStop("solve");
} else if (btnMultiply was clicked){
Pass "*" to frame two
gotoAndStop("solve");
} else if (btnDivide was clicked){
Pass "/" to frame two
gotoAndStop("solve");
}
}


//FRAME TWO CODE

check the varible from frame 1 for a +, -, *, or +

Sound When Button Is Clicked
I want to put a sound on, for when I click a button it plays the sound... but I don't know how to do this?
I'm making a game where you beat this UNFAIR referee up and I don't know how to make sounds when you click him... please help

Button Clicked State
Hi everyone!,

Somene's help or guidence would be greatly appreciated.

I have a button, which has been built using the "Complex Button" tutorial on this site. Once the button (which is really a movie clip) has been clicked, I would like the animation to play until the final frame and then stop. At the same time it needs to link to another frame.

For example, on the attached file when you click on 'selected projects' the button should play until it is orange and then stay in that state.

I have attached a flash file with just the button. I have searched all threads for a solution before posting.

Can anyoneplease help?

Attached Files

Copyright © 2005-08 www.BigResource.com, All rights reserved