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




Simple Button



Hey,

I have a text box with some writing in it, I want to be able to create a simple button that enables it to change text. Eg. Box says "Welcome to my website, here you will learn how to eat pies for a living" then the next lot of text would be "Blah blah blah etc.." .. I want people to be able to read the first part, then click to read the next part but all in the same box.

Help would be most appreciated!

Thanks,
Paul



FlashKit > Flash Help > Flash Newbies
Posted on: 06-06-2006, 06:55 AM


View Complete Forum Thread with Replies

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

Can You Help Me Fix Simple Javascript Code On Button Inside My Very Simple Component?
Flash MX 2004 (mac)
******************

Hi,

I have a custom component that consists of nothing more than two dynamic text feilds and a button. I want the button to open a popup window in the browser, and it does so using javascript (an extension i found).

I put the following function in the first (and only) frame of my actual component (and its also in the first frame of my entire movie, just in case):

callPopup = function() {
getURL(popup);
};


And then on the button in my component i have this:

on(press){
callPopup();
}

and then finally,there is a variable named 'popup' within my component (which would change in each instance) which is given a value in my test instance as :

"javascript:jspw3('../vwd_scripts/','popups/acroyoga.swf',',,0,Past%20Event,index,Past%20Event ,20,0,,0,450,550,0,0.001,0.001,,,1,0,,.0.0.');"


somewhere i am doing something wrong.. ..i am not sure if its the button code, or my link (variable 'popup') syntax. Or if its impossible to use javascript in this way.

I know my html page is set up correctly (correct info in the head of the page etc), since i am able to call the javascript from a regular html link (just for testings sake) which is on the same page as my swf.

Hmm..i hope i made some sense here.

I will be very gratefull for some help...i'm totally lost on this one...

thanks in advance

Cheska

Can You Help Me Fix Simple Javascript Code On Button Inside My Very Simple Component?
Flash MX 2004 (mac)

Hi,

I have a custom component that consists of nothing more than two dynamic text feilds and a button. I want the button to open a popup window in the browser, and it does so using javascript (an extension i found).

I put the following function in the first (and only) frame of my actual component (and its also in the first frame of my entire movie, just in case):

callPopup = function() {
getURL(popup);
};


And then on the button in my component i have this:

on(press){
callPopup();
}

and then finally,there is a variable named 'popup' within my component (which would change in each instance) which is given a value in my test instance as :

"javascript:jspw3('../vwd_scripts/','popups/acroyoga.swf',',,0,Past%20Event,index,Past%20Event ,20,0,,0,450,550,0,0.001,0.001,,,1,0,,.0.0.');"


somewhere i am doing something wrong.. ..i am not sure if its the button code, or my link (variable 'popup') syntax. Or if its impossible to use javascript in this way.

I know my html page is set up correctly (correct info in the head of the page etc), since i am able to call the javascript from a regular html link (just for testings sake) which is on the same page as my swf.

Hmm..i hope i made some sense here.

I will be very gratefull for some help...i'm totally lost on this one...

thanks in advance

Cheska

Simple Button Mouseover Effect - I Know It's Simple, Just Don't Know How To Do It
I know how to insert an MC into the OVER keyframe of a button so that it enlarges, but how do you make the button decrease to it's original state on mouseout? ie, so it tweens back to it's original state.

Thanks
G

Simple Button, Needs Simple Action Script
Hi there,

I have made button in flahs mx. The over state of this button contains a short movie clip. My prblem is that I would like the button to remain on the down state on release (ie. once the user has released the mous button)instead of just going back to the over state as it does at present. Ideally I would like the button to go back to the up state on a second click.

I have pulled most of my hair out trying to put together the right bits of action script that would help me do this but to no avail, and having no time to learn action script properly I don't think I'll get there anytime soon on my own. Can anyone help me, pretty, pretty please ~?

Need A Simple Script For A Simple Button
Hi,

I've got this simple button, that when I roll over it has a clip that fades in to orange, but it won't fade out when I roll off the button. How do I get the "orange" to fade out when I roll off the button?

I've attached the file.

Thanks for your help.

Blastbum

Simple Button Listener Not So Simple
Here is code that works fine without the Listener:

myButton_Zoom = function () {
bt_zoombig_mc._visible = !bt_zoombig_mc._visible;
};

Now when I try to add a listener it will not listen. Here is the code with the Listener:

listener = new Object();
listener.myButton_Zoom = function(objEvt) {
bt_zoombig_mc._visible = !bt_zoombig_mc._visible;
};
myList.addEventListener("myButton_Zoom",listener);


Can anybody please tell me why?





























Edited: 12/25/2008 at 11:26:59 PM by W_Bell

Simple Simple Radio Button [help]
Hi all,

I have an annoying problem that requires a simple solution. I need a radio button to do the following function when clicked;

on(click) {
trace("hello");
NewCharity = "Focus";
}

The trace function works fine but the word "Focus" is not printed into the dynamic text box named "NewCharity". I cannot figure out why and can't find a simple solution to it.

A good example of what I need can be seen working in WebWasp at : "http://www.webwasp.co.uk/tutorials/c04-radio-active/index.php"

Any help would me of much assistance..

Simple, Simple Button Code ... *&^%£&
I have some buttons on my movie that are instances of SimpleButton. I have labelled one of them 'photo' - I want my buttons to register EventHandlers so that I can use them to load movies. I'd prefer to use 'frame code' if possible ...

For some reason (which I can't imagine), it seems that SimpleButton doesn't have an onClick/onRelease or equivalent event handler.

Do I have to write my own class just to get a button which has a proper EventHandler ? I know that can't be true. Who would provide a button class that doesn't have a mouse.click event handler in the standard libs ?

What do you do for this ? Help !

I wrote this code which seems to add an eventhandler and doesn't throw up any errors. Unfortunately it won't link to google either though ...

Code:


function photo_link(event) {
getURL("http://www.google.com","_blank");
}

photo.addEventListener(MouseEvent.CLICK, photo_link);

Adjusting Simple Button .y Losing Button Functionality
I'm trying to dynamically move a "more info" button right under a block of text based on the height of the text. The problem is when I move the button in code, the button is no longer clickable(??). I'm using the CS3 IDE and creating a simpleButton. simpleButton is supposed to inherit the displayObject class so I don't understand why this is happening. If I trace out the button reference, it traces [object SimpleButton]. I have a textfield named 'txt' and button named 'btn' on the stage.


Code:
btn.y = txt.y + txt.textHeight + 10

Simple On And Off Button - Help.
I have background music playing I want the surfer to be able to
turn it off and turn it back on.

do I create one layer for sound - (I want the sound to loop
so I how do I do this?)


than a separate layer for the button?


where does the action script go?

I don't want two buttons. just one button that will stop and play the sound.

thanks.

Simple Button Help<----------------
DOES ANYONE KNOW HOW TO PUT A PASSWORD ON A BUTTON

Simple Button
i need some help with a simple button rewind. I want the button animation to reverse when the mouse leaves the button. Do you understand. I don't want the animation to completely stop, it needs to rewind and play backwards. Here is the fla file that i am working with. Thanks

Simple Button
can anyone give me a really quick example of how to make a button go to the next frame when clicked? i havent looked into buttons yet so i need to know

Button Help (im Sure Its Simple)
Heres what i got: I want to traditional underline for text hyperlinks, but the website im doing wont look good with jsut underlined hyperlinks. What im trying to do is have just the text, then on rollover i want the line the expand from the center underneath the text. I know enough about Flash to get a few things done, but i cant figure this out. Is there a tutorial somewhere on this? thanks

Simple Button
Hi All,

For some reason I cannot get a simple button to work in this *%$£+!$ programme!
I have followed the help and seaerched this forum but cannot get a result.
I have created an up, over and down state for the button and this works fine in edit mode. I have clicked the instance on the stage and applied a simple on rollover, go to and play frame 5 / on roll out, go to and play frame 1 event.
If I enable simple button actions in edit mode I do get the down state but not the go to frame then when I go to test movie I get neither the rollover nor the go to event - nothing!
The most frustrating thing is that I have done this before and it worked OK, I even have the fla file and can see it working.
I anyone has any thoughts on this I would be grateful for some detailed feedback.

Many thanks
AJJA17

P.S. Give me Director anytime!

Simple Button
I am sorry for this question that you probably get asked a lot... but I was just wondering how to easily make a button that when pressed, goes and plays a different scene...

I am making a movie, and I have a dvd menu...

Thanks a lot!

~griffyboy0~

Simple Button
I have created a button with the text that says HOME.
I want to be able to use the same button, but change the text to say: SALES. Or will I have to create a separate button for each category I have? How can I change the text to SALES without changing the text in the HOME button also. I have tried to create a copy of the button in the swap section, and edit the text but it changes the home text also.

Simple Button
Hello. I am also a newbie. I am trying to create a simple button. Click and go to a frame. I have used Director and have made many interactive cds and animations in that. I just can't seem to make this work. I have followed tutorials and examples. When I think I am folling them to the letter nothing happens. I have a ton of questions and I know in time I will get it but I need help now. Thanks

Simple Button
i am trying to add action to a button...just telling it to go to a web page and the button willnot work - i am using flaxh mx 2004 and this is usually simple and i am not sure what is going on. this is the code i am using;

on (release) {
getURL("http://www.ajc.com");
}

Simple Button Q
Hi all,

I have a button that, when pressed, I'd like a movie clip to play. I have the following script attached to the button ...

on(release) {
circle_mc.gotoAndPlay("beginning")
}

Did I do something wrong here? It won't work.

Thanks

Simple Button
i dont know why i cant figure this out. i have a graphic on my site that i need to link to a new site in a new window, whats the code for this?

please someone help a brother out

Simple Button MC
hey all,

not been practicing flash a lil while due to uni, but i'm having a real newbie problem here.
I'm just trying to do something ive done before and i think im missing something cause it aint working lol.

on the actions layer in frame 1 i have this.

B_intro.onRollOver() = function(){
gotoAndPlay(2);
}

and on a layer below in frame 1 i have a MC with the instance of B_intro

i dont see how this aint working.
heres the error i get.

**Error** Symbol=MC_Menu, layer=actions, frame=1:Line 1: Left side of assignment operator must be variable or property.
B_intro.onRollOver() = function(){

Total ActionScript Errors: 1 Reported Errors: 1


im working in flasj mx 2004 but im sure this should be pretty straight forward.

cheers for any help
G

Button Help (Sure Its Simple?)
Im sure this is a very simple thing to fix but i have had so much trouble!!! im pulling my hair out over it!!!
i would like to know why the red box (on the links button) does not leave the button once another button is pressed. this is strange as i used the same technique as the other buttons and they all work fine!! thanks if anyone can help me!! i uploaded the flash file in a zip (about 100KB)
Thanks again...
Matt

Here Are The Links...
http://www.kaosz.co.uk/helpflash.html
http://www.kaosz.co.uk/stuckhelp.fla

Simple Button Help
I'm doing a project and i have two images that i created that i want to convert to butons, there designed to act as "back" and "next" buttons so that when a scene is done, it won't jump to the next scene until the "next" button is clicked, and you can go back to the previous scene by clicking the "back" button, how do i do this?

Thanks in advance for any help.

[F8] Simple Button
Hello,
I wonder if there is a way to make a button that after beeing pressed on stays with the same color that it was on the roll over.
I have a grey button, that chenges to red on roll over (up Position) and i woul like for it to stay red after beeing pressed on so it can identify the page we are.
Thank you

Help- Simple Button
Hello, I'm getting so frustrated with this, it should be pretty easy. I'm relatively new at Flash, but have been able to create simple buttons! I have an imported png file in my library, which I have tried to make both button and movie clip instances to no avail.

I just want the button to jump to another frame when pressed. This is the code I've been using :

on (press) {
gotoAndStop(5);
}

I think this should be all I need, I check the syntax, it says no errors, but when I try to test or publish the movie, I get this compiler error message...(see attached)

PLEASE HELP!!!!!

[CS3] Simple Button
Hello, I have a picture of a dog with a white box next to it. I put some text in the box and a simple text button at the bottom of the box that turns red on the rollover. For some reason when I test my file the button does not even work. I added a square symbol behind it and changed the opacity to 0. Now the button kinda works. If my mouse is above the text (not touching the text) it works, also if my mouse is under the text it works. However if my mouse is directly on the text nothing happens. Where did I go wrong?

Thanks,

Simple App In/out Button
Hi there everyone:

I'm looking for a simple way to make an app that people would click that they are in or out of the office, so that managment knows who is around. I'm thinking I can make in and out radial buttons next to each name. can I make this without the need of a database, or will it have to go to one to be seen updated across multiple machines.

any advice would help, thanks

Simple Button
Hello Guys and Gals,
Here is my Prob. Im compiling and Organizational chart for a large company, every section of the chart has a rollover state with an explanation of the section. I've attached this code to each of the sections...

stop(); // stop the movie clip from playing (stop button from growing, we want that when the mouse rolls over only

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

this.onRollOver = function(){
rewind = false; //set variable (or switch) that decides wether ot not to play backwards...
play(); // play this movie clip.. (grow the button(tween));
}

this.onRollOut = function(){
rewind = true; //set or rewind switch to true so it will play backwards...
}


So all is running good. except one of the rollover states grows out to be another "org chart" which needs the same rollover states and for some reason these won't work. ive atached the pngs as it is now and if you scroll over the "business services" section you will see that it opens to another chart in which this script won't work.

can anyone help?

Simple Button
So I'm new to AS3 and I'm having problems creating a couple simple buttons. What I want to do is create a simple button that will tell the root timeline to play, then also create a number of simple buttons that will "go to and play" specific frame labels. I can't seem to figure this out in an AS3 file.

Can anyone tell me what the actionscript for this would be, where I would put it, anything else important I'd need to do, etc? The timeline for this project is extremely short, so any help would be greatly appreciated. Thanks.

Simple Button Help
hi i'm a bit new new to actionscript and trying to do something relatively simple. i am using this to make a mindmap.
at the center there is a button, when clicked, a new button appears next to it(when the mouse is over this button it will say something about the subject)
and when the new button is clicked it, a new button should appear next to it and will continue on, branching out to show my mindmap.

What i have been able to do so far is create the centre button, and when clicked it creates the 2nd and when mouse over-ed it says some points. Now the problem i have is that the this new button when clicked doesn't do anything =/.

i have 2 layers, actions, and buttons. on the button layer the 1st button is on frame 1, 1st(cambz) and 2nd button(eyez) are on frame 5, and 1st 2nd and 3rd buttons on frame 10

here is my code:


ActionScript Code:
stop();

cambz.addEventListener (MouseEvent.CLICK,clickH1);
eyez.addEventListener (MouseEvent.CLICK,clickH2)


function clickH1 (evt: MouseEvent){
    gotoAndStop(5);
    }

function clickH2 (evt: MouseEvent){
    gotoAndStop(10);
}

now when the eyez button is clicked it should goto frame 10 where the next button is, but it doesn't do anything. any ideas?

Simple Button Help Please
i just want to know how to make a button when clicked on go to a specific scene such as a button in scene one that when pressed activates scene two or three or any other scene! please help! thanks!

Another Simple Button
I have a Dynamic page that is a parts list in a MySQL database that I show on a page using PHP in Dreamweaver.
The page uses a repeat region to list the parts depending on what nav link is clicked and what I want to do is add a flash button to the repeated region that when clicked will take you to a larger view. I have all of this setup and working fine except for the flash button.

For instance when the page is loaded you may see 10 parts listed and the button will show up 10 times also, on button next to each part listed. I am currently using a simple image as a link to the larger view and it works fine. The link looks like this.

largeview.php?SearchField=<?php echo $row_Recordset1['Part']; ?>

My problem is that flash doesn't read the php in this code: "<?php echo $row_Recordset1['Part']; ?>". I need flash read the php code so it knows what part number to show.

Is there any other code that can be used to have Flash read the php code?

I hope I explained this properly and any help would be greatly appreciated!

Simple Button
I have a Dynamic page that is a parts list in a MySQL database that I show on a page using PHP in Dreamweaver.
The page uses a repeat region to list the parts depending on what nav link is clicked and what I want to do is add a flash button to the repeated region that when clicked will take you to a larger view. I have all of this setup and working fine except for the flash button.

For instance when the page is loaded you may see 10 parts listed and the button will show up 10 times also, on button next to each part listed. I am currently using a simple image as a link to the larger view and it works fine. The link looks like this.

largeview.php?SearchField=<?php echo $row_Recordset1['Part']; ?>

My problem is that flash doesn't read the php in this code: "<?php echo $row_Recordset1['Part']; ?>". I need flash read the php code so it knows what part number to show.

Is there any other code that can be used to have Flash read the php code?

I hope I explained this properly and any help would be greatly appreciated!


Mark this message as the answer.
Print this message
Report this to a Moderator
Nickels55
User is offline
View Profile

Senior Member Posts: 2048
Joined: 01/11/2006
Send Private Message
08/16/2007 07:41:46 PM
Reply | Quote | Top | Bottom

Tutorial on the subject:
http://www.kirupa.com/developer/actionscript/flash_php_mysql.htm
--------------------------------------------------------------------------------
~Flashtard - Giver of poor advice~


Mark this message as the answer.
Print this message
Report this to a Moderator
painlessbart225
User is online

Junior Member Posts: 3
Joined: 08/16/2007
Send Private Message
08/16/2007 09:28:43 PM
Reply | Quote | Top | Bottom | Edit

I guess I don't understand this very well I can't seem to get it to work.

I can get the part # to show on the page using:
print "myVar=$x";

but the button link I am trying to use is:
largeview.php?SearchField="myVar=$x"
I know this isn't right but the button is just a button using the option in Dreamweaver to Insert > Media > Flash Button and the only option is a link.
how should I write the link so that the flash button will read it?































Edited: 08/16/2007 at 02:45:31 PM by painlessbart225

Simple Button Help
Hi
I am new to flash and having a bit of trouble. All I would like to do is be able to create a button and have that button navigate to a frame.
What I am doing now is:

Insert - New Symbol - Button and name the button (ex: about)
Go through the up/over/down/hit steps and return to scene 1
I then drag the about button onto the stage
I give the about button the instance name of about_btn
In the action layer, I enter the following code:
stop();
_root.about_btn.onRelease = function(){
gotoAndStop("about");
}
"about" being the keyframe I would like to go to

When I test the button, I get error 1120: "Access of undefined property onrelease".

I am working on adobe flash cs3 on a pc. I know this is a very simple issue and any help would be greatly appreciated.

Thank you.

Simple Button..
I noticed when I switched from AS 2.0 to 3.0, and use the proper way by
adding a Mouse click event.. You loose the little cursor hand that
shows your on a link.

Any tips on how to get it programed back?

Thanks

-bill

Simple Button In AS3
hello everybody,
in my website I have a simple button that should trigger at every click a different frame. Browsing the net I have found the AS for the simple button (attached code) that works for a sigle click.
Would please tell me the AS to give to the button the function described above??
thank you so much







Attach Code

stop();


next.addEventListener(MouseEvent.CLICK, release);
function release(evt:MouseEvent):void {
gotoAndStop(2);
}

Simple Button Q...
i have a question about a simple button action.

i have a button, that when you click on it launches an mc, and when clicked again it plays the mc's next frame which affectively closes the mc. but...
when clicked again nothing happens. it's like an empty click or some thing.

if you click it again after that it works fine... second click works well, but then again... the third click does nothing.

i'm not sure why this happens. does any have any advice on this?

just wondering.

Button-simple
Hello!

I am new to Flash and I have a very simple question: I need a button in a movie clip to go back to the main timeline. i.e., a "home" or "back" button. When I have tried making this button, it just goes to the beginning of the movie clip, not to the main timeline. How to I go about doing this?

Thanks

Simple Button Q. FMX
I want to do this:

- Have a box on screen.
- When you move over box, another little box comes up from behind it.
- This new box changes color when you roll over it, and you can click it.
- If you roll off the little box, or the big original box, the little one slides back behind it.

This seems like it should be simple, but I am just stuck stuck stuck.

Would appreciate any help, thanks.

Simple If/Else With Button
Hello. This is probably an easy question. I have a button that turns a movieclip on and off. I want to be able to use the same button to turn this on/off. I figured you could use the if/else statements but can't seem to figure it out. Basically, when the mc is on, the button should turn it off, and vice versa. I have been using an ugly work around for this and I'm just looking for a cleaner, more proper way.

Thanks.

Need Simple Button Help
I have a flash movie with buttons which execute "gotoAndPlay" and then a specific frame set. These frame sets are governed by "stop" commands so they do not repeat. I wish to have some buttons disabled until others are clicked. How would i do this? Is this an example of Boolean logic? Should i use the "if" scenerio and if so then how? Please help...

In additon I also wish to have a variable scenerio where the number of times someone rolls over my button changes which frames are played.... I can give more details if needed and will check back frequently for your response for a little bit, Thank you.

Sincerely

FlashNoob84

Simple XML Button
I would like to have a button within a movieclip that is directed to a URL by an XML file....
so the getURL reads from an xml file. How can i do this?

Simple Button Q...
i have a question about a simple button action.

i have a button, that when you click on it launches an mc, and when clicked again it plays the mc's next frame which affectively closes the mc. but...
when clicked again nothing happens. it's like an empty click or some thing.

if you click it again after that it works fine... second click works well, but then again... the third click does nothing.

i'm not sure why this happens. does any have any advice on this?

just wondering.

Button-simple
Hello!

I am new to Flash and I have a very simple question: I need a button in a movie clip to go back to the main timeline. i.e., a "home" or "back" button. When I have tried making this button, it just goes to the beginning of the movie clip, not to the main timeline. How to I go about doing this?

Thanks

A Simple Button...
hello all,

could someone show me how to create a action script for a button that simply take browsers to pages such as Yahoo.com, etc., that are outside of my Flash pages.

I only know so far how to Go To a certain page within the Flash project.

Thanks!!!

A SIMPLE BUTTON
Hi guys please please help me, I have been using flash for a few years now and have just moved on to AS3 and can't make heads or tails of it.

I just need a simple button to link to a URL I used to use this but this will now not work in AS3..

on (rollOver) {
Arrow.gotoAndPlay("In");
gotoAndPlay("Over");
}
on (rollOut) {
Arrow.gotoAndPlay("Out");
gotoAndPlay("Out");
}
on(release){
_root.canflip=true;
getURL("http://www.bababababa.co.uk"); // go to link
}

any help please....

Thanks

J

Simple Xml Button
I am trying to create a simple flash button that gets its label and link from an xml file. Being rather new to Flash/xml integration, all of the tutorials that I have found are far more complex than I need.

I currently pull text from xml, but am having trouble getting links to work.

Thanks

Simple Back Button
Scenario: User clicks on 'example' button, the button action assigns two variables for 'current scene' and 'current frame label' then jumps to example page. On example page, a back button contains a gotoAndPlay which uses the two previously assigned variables.

Problem: gotoAndPlay won't accept an expression for the scene name, only a "quoted string".

Any ideas how to get around this?

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