Help with basic buttons
I have 5 buttons that are all white and I want to have the
buttons to turn black and stay black after I have pressed it ,so I
know what pages I have been to previously
How to do this
thanks
Use the onRelease event for the button to tell its timeline
to go to a particuar frame (the one you've drawn the button in
black in) and stop. So, something like this:
myButton.onRelease = function() {
myButton.gotoAndStop(insertFrameNumberHere);
Hope that helps!
Similar Messages
-
Hello,
I need help with a button. I created a button and set it up
so that when you click and hold it, the button becomes lighter in
color (I used Alpha). I want the button to stay this light color
after i release the click. Right now it goes back to the normal
color when I release the click. Can somone help we this?
Thanks!rpofclt wrote:
> Hello,
>
> I need help with a button. I created a button and set it
up so that when you
> click and hold it, the button becomes lighter in color
(I used Alpha). I want
> the button to stay this light color after i release the
click. Right now it
> goes back to the normal color when I release the click.
Can somone help we
> this?
you can't use the button itself if you want to maintain the
DOWN state after
release as button automatically resets itself once the mouse
lives the HIT zone.
Use movie clip instead and on press simply send it to a frame
where there
is DOWN state like image.
Best Regards
Urami
<urami>
If you want to mail me - DO NOT LAUGH AT MY ADDRESS
</urami> -
Help with linking buttons to Scenes
Hey,
Rookie to Flash and AS3. Just needed some help with my buttons. Im making a flash program about pancakes (random I know). I have a "Mainmenu" scene and then a "Recipe" scene. I have a button on my mainmenu which takes me to the recipe page when I click it, the code behind the button is
"stop();btn_recipe.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);function mouseDownHandler(event:MouseEvent):void {
gotoAndStop(1, "Recipe");
Then when I arrive at my recipe page I have a button which will take me back to my MainMenu, the code behind that button is:
"stop();btn_home.addEventListener(MouseEvent.MOUSE_DOWN, mouse5DownHandler);function mouse5DownHandler(event:MouseEvent):void {
gotoAndPlay(1, "MainMenu");
So I run my program and the first button works and takes me to recipe page but the button to get to the main menu does nothing, click it and no response or anything
Please helpFirst, hopefully having all your code mushed onto the same line is a copy/paste error, otherwise it should look like...
stop();
btn_recipe.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
gotoAndStop(1, "Recipe");
If the intention is to click the buttons to make them work, then you should use CLICK instead of MOUSE_DOWN. MOUSE_DOWN can be a persistent state whereas CLICK involves releasing it afterwards.
As for the code to get you back home, where is it located on the timeline? Are you getting any error messages when you try to use it?
One thing you should learn to use is the trace() function. It is useful for troubleshooting. You can use it now to see if your second button is talking to the function at all...
stop();
btn_home.addEventListener(MouseEvent.CLICK, mouse5DownHandler);
function mouse5DownHandler(event:MouseEvent):void {
trace("the button works okay");
gotoAndPlay(1, "MainMenu");
If you don't get that message in the output panel, you'll know the button is not properly coded to work.
Most folks here will recommend you get away from using scenes in a design that includes navigation--they have a history of being problematic. Instead of using scenes, divide the one main timeline up into sections or use movieclips for the sections and manage their visibility... or do a bit of both. -
Help With Radio Buttons -- URGENT!!
Hi i am new to using UI compents in flash.
Basically i havnt a clue where to start.
Just some simple action script will help and be much
appreciated if someone can give me it.
Basically i have a question to ask which requires radio
buttons to answer the question.
I have a question and the answers are A, B, C, D.
I want:
A to equal 1
B to equal 2
C to equal 3
D to equal 4
E to equal 5
Would someone be able to tell me how to set up the radio
button so that the value of the radio button is stored into an
array called SCORE.
i dont need a tutor for arrays, i can do them, i just need
help with the radio buttons so a reference to an array would be
enough, eg how to store the answer from the radio button in an
array.
Thank youPlace the radio buttons on the stage and set their parameters
to what you need. Make sure that for each group of radio buttons
you give them the same group name. Then you could use something
like this:
var listenerObject:Object = new Object();
var answerArr:Array = new Array();
listenerObject.click = function(eventObj:Object) {
answerArr.push(eventObj.target.selectedData);
trace(answerArr);
radioGroup.addEventListener("click", listenerObject);
radioGroup refers to the group name for the buttons.
eventObj.target will refer to the actual radio button
clicked.
Tim -
Need help with basic program.....!
I've to write a program that generates a random number, which the user has to try and guess, after each guess they're told whether it's too high or too low etc., I've gotten this far, however, the user has only 10 guesses.... In my program I've used a while loop and the user gets an infinite number of guesses, I know I'm supposed to use a for loop, but can't seem to get it to work properly. Also, when the user guesses the number, the program then has to print out how many guesses it took, and I have no idea how to get it to do this AT ALL!!! I'd really appreciate some help with this, thanks v. much!!!!
I've to write a program that generates a random
number, which the user has to try and guess, after
each guess they're told whether it's too high or too
low etc., I've gotten this far, however, the user has
only 10 guesses.... In my program I've used a while
loop and the user gets an infinite number of guesses,
I know I'm supposed to use a for loop, but can't seem
to get it to work properly. Also, when the user
guesses the number, the program then has to print out
how many guesses it took, and I have no idea how to
get it to do this AT ALL!!! I'd really appreciate some
help with this, thanks v. much!!!!Hey not every book covers every aspect of Java (if you haven't got a book and don't want to buy 1 i recommend an online tutorial) If u want the user to have an infinate number of guesses, use an infinate while loop. Put this in a file called app.java:
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class app extends Applet implements ActionListener
JLabel lbl=new JLabel("Guess a number between 0 and 10:");
JTextField txtfield=new JTextField(20);
JButton button=new JButton("Guess...");
JLabel lbl2=new JLabel();
int randomnumber=Math.round((float)Math.random()*10);
public void init()
add(lbl);
add(txtfield);
add(button);
button.addActionListener(this);
public void actionPerformed (ActionEvent e)
String s=new String("");
s+=randomnumber;
if (e.getSource().equals(button) && txtfield.getText().equals(s))
setBackground(Color.white);
setForeground(Color.black);
lbl2.setText("Got it!");
add(lbl2);
validate();
else
setBackground(Color.white);
setForeground(Color.black);
if (Integer.parseInt(txtfield.getText())>randomnumber)
lbl2.setText("Too High!");
else
lbl2.setText("Too Low!");
add(lbl2);
validate();
Then create a HTML document in the classes folder:
<HTML>
<HEAD>
<TITLE>APPLET</TITLE>
</HEAD>
<BODY>
<HR>
<CENTER>
<APPLET
CODE=app.class
WIDTH=400
HEIGHT=200 >
</APPLET>
</CENTER>
<HR>
</BODY>
</HTML>
It will do what you wish. If you want to have more then 10 numbers to guess, for example 100, do this:
int randomnumber=Math.round((float)Math.random()*100);
Does that answer your question? -
I need help with a button animation!
Hi,
I hope someone can help with a simple-looking problem which
nonetheless has me stumped!
I have a feeling that I've missed something obvious.
I've created a movie clip to act as a button (I've called it
"abs_button") and placed it on the stage.
My main movie has one frame.
Within the "abs_button" movie clip there are 5 layers.
Labels, actions, default button state, rollover state and rollout
state.
Technically, default button state, rollover state and rollout
state could be on the same layer as they don't overlap, but I've
given each animation its own layer for clarity.
FRAME 01.
Default button state is one frame with a graphic of the
button. Just a label at the start ("abs_up") and a "stop();" action
at the end.
FRAME 02 to 31.
Rollover state is a 30 frame animation. Label at start
("abs_over"), "stop()"; action at the end.
FRAME 32 to 62.
Rollout state is a 30 frame animation. Label at start
("abs_out"), "stop()"; action at the end.
All animations were achieved with tweens.
My initial "abs_button" code:
on (release) {
getURL("targetPage.htm", "_self");
on (rollOver) {
gotoAndPlay("abs_button", "abs_over");
on (rollOut) {
gotoAndPlay("abs_button", "abs_out");
As it stands, the animation jumps to frame 1 of "abs_out" on
rollout.
I need the "abs_over" animation to always play through to the
end, as the "abs_out" is "abs_over" in reverse (i.e. image grows
large on rollover and shrinks again on rollout.
I've tried for 2 days to solve this, but I clearly need help.
My experiments with variables simply didn't work.
I would be grateful if someone could tell me where I'm going
wrong!
Thanks,
Andyuse this:
on (rollOver) {
gotoAndPlay("abs_over");
Since the code is attached directly to the movieclip, you
don't have to
identify the clip. A gotoAndPlay() function takes a frame
number or a
frame label name as its argument, never the name of the clip
that
contains the frame number or name.
Rob
Rob Dillon
Adobe Community Expert
http://www.ddg-designs.com
412.243.9119 -
Little bit of help[ with a button.
Good day all!
I need help making a button. This is what I want to happen.
I have a bunch of text, One of the words "merino" is bule as
to say there is a link hear! And I want an image of the "merino" to
come up, like a "ALT" box. Or have an image in the "ALT" box?
I know how to do this in "Flash" i.e just drop in the image
on the over state of the button event. Easy as pie! This is why I
cant get to grips with Dreamweaver! I hate it!
But I am willing to learn and maybe in time love???
Thanks all!"satrop" <[email protected]> wrote in
message
news:f0o4t7$954$[email protected]..
> Good day all!
>
> I need help making a button. This is what I want to
happen.
>
> I have a bunch of text, One of the words "merino" is
bule as to say there
> is a
> link hear! And I want an image of the "merino" to come
up, like a "ALT"
> box.
>
> I know how to do this in "Flash" i.e just drop in the
image on the over
> state
> of the button event. Easy as pie! This is why I cant get
to grips with
> Dreamweaver! I hate it!
>
> But I am willing to learn and maybe in time love???
HTML is a lot different from Flash! :-)
I believe you could do this using DW's Show-Hide layer
behavior - have
mousing over the link trigger a layer with the image to
appear. Someone else
may have a better idea.
Just FYI, having to mouse over a link in order to get more
information about
it isn't usually appreciated by users. You *might* want to
re-think this
plan..
Patty Ayers | Adobe Community Expert
www.WebDevBiz.com
Free Articles on the Business of Web Development
Web Design Contract, Estimate Request Form, Estimate
Worksheet -
Need help with encore buttons - highlights
Hi All
I am seeking help with Encode CS5. I have a project working fine except that I dont have highlights for buttons, at least I think thats what its called. So when the mouse or remote control navigates up/down toa button it changes colour.
In the properties of my button, the highlight option is greyed out.
How do I apply highlights ?
many thanks
Chris AndersonHi Bill
Thanks for your reply.
Here are 2 screen prints. One from encore the other from photoshop.
First time I have inserted images, and they seem a little small on this message - if you have any problems reading I could email to you.
I have highlighted the first button - which is called 'Highlights' - same issue with all the other buttons.
Do you have to use photoshop to add highlighting? or can you do this in encore - i dont have much experience with photoshop.
Not sure how to check 'Color Set' ? can you tell me how to get that for you - same for transparency for states? - I havent experienced them or changed them as I dont know how to
Yes it was duplicated - have left a message not to reply
Thanks again
Chris -
UWL - Help with Decision Buttons
Hello SDNers,
I'm customizing the UWL iView to show approval itens only, and their respective decision buttons.
Everything looks ok, but when someone try to submit the decisions it shows the message:
"reject wasn't correct"
Where "reject" is the name I gave to the action.
It also happens with the approval action.
Below is the XML I've created.
Does someone have a clue in what that message means, or what I've done wrong?
Thanks in advance!!Hi There,
Make sure that your decisionKeys are correct. I have seen issues with this many times. Log on to the backend system and call SAP_WAPI_DECISION_READ or SWK_DECISION READ for a specific workitem (You can get the details of the workitem id from the support information on the UWL - enable this and you can check this specific workitem) The decision key is an internal value (typically a numeric value) corresponding to the selected decision used by the provider.
You will need to ensure that you have x amount of decisions configured in the xml file, where x = the amount of decisions configured in the backend system.
For additional help with this topic please see the userDecision Action Handler documentation:
http://help.sap.com/saphelp_nw70/helpdata/en/7a/df014b037141ca9afc6433ed42b519/content.htm
Beth Maben
EP - Senior Support Consultant II
AGS Primary Support
Global Support Centre Ireland
Please see the UWL Wiki @
https://www.sdn.sap.com/irj/scn/wiki?path=/display/bpx/uwl+faq *** -
Help with Social buttons ...
Hi,
I'm designing a muse site with social buttons that are created when you embed code from a site such as facebook, and others. They look like this on my site ...
I would like to build a 'social' area on my site that looks like this instead ...
So, to clarify when my user clicks on the 'f' in the lower of the two graphics above I'd like my website to behave as if the user had clicked on the 'f share' icon generated by the embedded html from facebook.
How?
Many Thanks!
GaryHi Gary
This would be a customization with codes for share.
You can use Share This and use the embed code for the same view that you have mentioned , which will allow users to share the page where you will insert the code.
http://www.sharethis.com
- Select Website
- Select the layout
- Generate the code
Thanks,
Sanjit -
Hey there, i've recently been following a tutorial and I have come across a problem with the AS for the nav buttons, http://www.flash-game-design.com/flash-tutorials/basic-flash-website-tutorial-6.html, the tutorial says to write:
btnabout.onRelease = function(){
content.gotoAndStop("about")
btnport.onRelease = function(){
content.gotoAndPlay("port")
btncont.onRelease = function(){
content.gotoAndStop("contact")
I have done this and it came with an error saying needs to be in handler, so i re-entered this:
btnabout.on(release) = function(){
content.gotoAndStop("about")
btnport.on(release) = function(){
content.gotoAndPlay("port")
btncont.on(release) = function(){
content.gotoAndStop("contact")
This code then came back with a Expected a field name after '.' operator. btnabout.on(release) = function(){ can anyone please help me i'm starting to pull hairs out?!
Thanks
P.S it must be AS 2.0 as that is what my portfolio page uses.The problem with the first attempt was not the code, but where you placed it. That code needs to be placed on the timelinein the same frame as where the buttons are (preferably in a separate 'actions' layer). This approach is the better approach than trying to place the code on the objects because it keeps all code in a single easy to find location... the timeline.
For the second attempt, assuming you were still trying to attach the code to the buttons, you should change the code to....
on(release) {
content.gotoAndStop("about")
on(release){
content.gotoAndPlay("port")
on(release){
content.gotoAndStop("contact")
but.... each of those needs to be attached to the button associated with it and not grouped together. This is an older style of coding that is best avoided due to ending up with code hiding on objects. -
Help with dynamic button click inside titleWindow
Hi Everyone, Your Help is much appreciated
I am building a flex application and I want the user to click
on a button and send them to another website. Basically I am
creating a tileList that holds thumbnails (created using item
renederer) and on click a popup with the same image and button will
be created. I get errors when I click the link button. This is what
I have so far:
// This is my custom item renderer
<mx:VBox xmlns:mx="
http://www.adobe.com/2006/mxml"
horizontalAlign="center"
verticalAlign="middle">
<mx:Image source="{data.@thumbnailImage}" />
<mx:Label text="{data.@title}" />
</mx:VBox>
// My TileList
<mx:TileList id="tileList"
dataProvider="{xmlListCollection}"
itemRenderer="CustomItemRenderer"
maxColumns="4"
columnWidth="140"
rowCount="2"
rowHeight="140"
verticalScrollPolicy="off"
horizontalScrollPolicy="off"
itemClick="tileList_itemClick(event);" />
// This is my code
private function tileList_itemClick(evt:ListEvent):void {
// Set the TitleWindow
myTitleWindow = new TitleWindow();
myTitleWindow.title = evt.itemRenderer.data.@title;
myTitleWindow.width = 350;
myTitleWindow.height = 600;
myTitleWindow.showCloseButton = true;
// Set the Image
img = new Image();
img.maintainAspectRatio = true;
img.buttonMode = true;
img.useHandCursor = true;
img.source = evt.itemRenderer.data.@fullImage;
img.addEventListener(MouseEvent.CLICK , image_click);
//Set the Label
myLabel = new Label();
myLabel.text = evt.itemRenderer.data.@title;
myLabel.setStyle("fontWeight","bold");
// Here I set the Button but its not functioning
var btn:Button = new Button();
btn.label = evt.itemRenderer.data.@link;
btn.buttonMode = true;
btn.addEventListener(MouseEvent.CLICK,clickHandler);
myTitleWindow.addChild(img);
myTitleWindow.addChild(myLabel);
myTitleWindow.addChild(btn);
PopUpManager.addPopUp(myTitleWindow, this, true);
PopUpManager.centerPopUp(myTitleWindow);
// This is the Part I can't get it to work
private function clickHandler(e:MouseEvent):void{
var url:String = "
http://" + data.@link;
var myRequest:URLRequest = new URLRequest(url);
navigateToURL(myRequest,'_blank');
My xml looks like this
<gallery>
<image title="Image One"
thumbnailImage="assets/big.jpg"
fullImage="assets/small.jpg"
link="www.google.com"
description = "Search Google"/>
</gallery>What error?
Is your url being concatenated correctly? Trace it.
Tracy -
Help with assignment- buttons that control movie clips
I am pretty new to flash and my professor gave us an assignment with little help or tutorials.
He wants us to create a SWF that features a house and it's front yard and two buttons.
One button that says Sunrise, and one that says Sunset.
When I push the sunrise button, the sun needs to rise above the house and stay there. When I push the Sunset button, it needs to set- and then a ufo needs to land on the lawn.
So i think I have a pretty good grasp on the assignment, but the actionscript is throwing me off. How can I make buttons that will control the sun movie clip to rise- stay above the house, and then set? The ufo is a whole new matter. The sunset button should make the sun lower and then a ufo land on the lawn.
Please help explain/link me to the proper tutorials. One thing that i'm worried about is that the sun will rise- and then stay above the house even if i click the sunset button.
Your help is greatly appreciated.Well i can think of a few ways to do this.
Depending on what you have been taught so far you should be able to do this if you know how to make a button, a movie clip, and the basic script for the timeline. ie. play,stop, gotoandplay etc.
I understand you have been set a task and you want the answer straight away. But i doubt he would have given you anything you couldn't handle. Also I learnt more from trial and error and searching the net than from most of my teachers at coll and uni, It's frustrating i know, but the buzz you get when you finally crack it is amazing. Stick in there!
That being said i remember the panic I suffered and like to help so here's a thought:
You could just have the 2 buttons play a basic movie clip. The sky could rotate one way to make the sun rise and add a "stop" in the actions to make it stay there, and to the left to sunset with both images together but not being shown all the time by using a mask. You could even add in the ufo to the clip but this would only work if you added an extra part to the movie so that when the ufo has landed it flys out again and then begins to rotate the sun and moon again. ( buttons would be dissabled during the play modes to avoid chaos) This is just a quick thought. I'm sure there are several ways of doing this depending on how fancy it needs to be.
If your teacher really has given you no notes on buttons,movieclips and actionscript i would sujest Adobe TV. Nice videos that explain step by step. OR try downloading a tutorial file with buttons and movie clips and look at the coding they use in the file. Thats how i have learnt most of it since finishing Uni.
Good Luck
Cobie -
I am looking for a way to enable/disable all buttons in a
swf. I found this searching here but I don't understand it, and am
looking for some of the many ways, as mentioned.
http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=288&threadid =1240137&highlight_key=y&keyword1=enabled
I am messing with having things load in what I call "windows"
and when you close a window, basically it just collapses the .swf.
The problem I have is that the cursor reacts to roll overs and I
can still rollover buttons in the swf even though its collapsed. To
see this prob go to:
www.custom-differentials.com
and open the gallery, then drag the gallery to the middle of
the screen, close the gallery, then move the mouse around the
outside of the "title bar" and watch the mouse change colors even
though there is nothing there. I put a trace in the rollover
handlers so I know which buttons are causing this. I just would
like a broad sweep disable all buttons while the window is closed.
Thanks in advance for any help.OK, I lied to you. I meant to say I was setting the _height
value of the swf to .1, not the y value. Any way the lie is that I
was actually setting it to 0, which is what was causing my problem.
I changed the resize value to .1 and the problem dissapeared. I am
going to try out your suggestion though, for s&g. Thank you for
the help.
I am not gonna mark this answered cuz I am curious on the
original question. Before your suggestion and me stumbling onto my
own stupidity, I was trying out an array that stored button names
and I would cycle through them enabling and diabling as I opened
and closed. One thing I noticed was that my galleries contained 50+
pics and the latency in my push loop may have become a problem.
Thanks Again. -
Really need help with basic static forms?!?!
I was thrown into creating forms for our Business Managers and I am not a developer in any way! I am a Recruiter, but somewhat tech savvy (or at least I thought I was).
I am trying to create basic static forms. I started by using Adobe Professional and them moved to LiveCycle Designer because of what I thought were better "editable" options when creating the form. I want to be able to send my manager's forms via e-mail (PDF), they can enter the requesting information in the fields, save a copy for themselves, print, and e-mail to me. We are not using any of the Adobe Server things, I don't want them to submit via an e-mail button on the form. We are a non-profit organization and my managers are using all different versions of reader.
I am getting extremely frustrated because in testing the form everything seems to be working properly including tab order, print, save and everything I want it to do. Then, I send them out for my managers to use, for some Manager's they work great, no problems at all! But then, I keep getting these weird issues from different Managers with the same form. For one of them, what they typed in the field, now looks like it's behind the text box, like when you select Highlight all, you can see what he typed, but then if you click into the text box, you can see what he typed. Another Manager said, two (crucial) fields would not show the text entered when she tries to save or print, but on screen you can see it????
So after the rambling, I guess my questions are: should I be using Live Cycle to create such basic forms or should I be using Adobe? Can anyone recommend a good "FOR DUMMIES" book that will help me figure out what I am doing wrong, and not explain in "IT" language?
This is really getting embarrassing!! Any help would be greatly appreciated!!!!1. Make sure to set the PDF target version. Goto File -> Form Properties (see the first screenshot attached)
Find out the minimum Reader version used in your organization and set this value accordingly. If you are not sure, select the least recent version.
2. two (crucial) fields would not show the text entered when she tries to save or print, but on screen you can see it
This may be due to the visibility settings of the fields. Just make sure that you have selected visible instead of visible (screen only)
See the second screenshot attached
Hope this may help you.
Nith
Maybe you are looking for
-
Media encoder stops encoding at the end of the video (Premiere CC 2014)
I've finished editing a video (just under 4 minutes). When I try to export it to a windows media file (HD 1080p) it always stops encoding at around the 50% mark. I have tried exporting to a shared network drive as well as the local hard drive with th
-
EMET 5.2 Crashes Outlook 2013 when EAF enabled
Question moved to https://social.technet.microsoft.com/Forums/en-US/78ed8791-9a77-40f5-abba-0fd35883ea36/emet-52-crashes-outlook-2013-when-eaf-enabled?forum=emet Hi I'm testing EMET 5.2 for deployment into our environment. However I've come across a
-
What is the best macbbok pro for video and photo editing
I am looking at getting a Macbook Pro but not sure about how to configure it. What are the advantages of the 13 vs 15 and the dual core i7 vs quad core i7?
-
Cannot Search in my IMAP Account
I have Outlook 2013 configured to use both an Office 365 and an IMAP email accounts. This setup has worked fine for about a year. Last week, I "suddenly" couldn't search my Inbox for the IMAP account. I can still search in my Office 365 account. I h
-
Printing dashed or dotted plot lines of a cnigraph with VC6
Hi, I have a problem with printing dashed or dotted linesof a CNiGraph with VC++. The lines are always printed solid. As posted in other threads I set the line width to 0 and use ControlImageEx to get the CNiPicture but it doesn't work. Please help..