Button class not creating a button
Hi,
I have some AS3 code which I was hoping would create a
re-usable button class but it does not. I just get a blank canvas.
I am not getting any errors. Code is attached. Anyone see what is
wrong?
thanks for the response.
to instantiate this class with the var code that you posted
and I reposted. Would this code be added to the .as file or would I
put that on frame 1 of the .fla file?
Also I want to create multiple buttons and position them on a
page within a grid. With the class code I have posted, how would I
go about doing that? Lastly, I want one of two movie clips to
display once the button is clicked. Can someone explain how I would
go about that as well?
thanks
Similar Messages
-
Can not create a button or load finished tutorials.
I am a fairly new user to DVDSP(latest rev and up to date), creating only several projects on the platform. Now with this past project I go to create a simple dvd
1 menu
1 video/audio track NTSC
1 button
Now I create my menu, import my video, place my video on the track and then go to create a button to link the two.... The program will not let click and drag to create the button. I bash my head for two hours and then come in today.
I grab the tutoral media, copy it to my HD, then try to launch a finished project. It sits for over 15 minutes on the loading bar.( loading menu's).
I trash all things DVDSP based and reinstall.. Still won't work.
Please help.Hi Dave, welcome to the discussions... sounds like you need a band aid or two!
When you make a simple disc such as yours, it sometimes helps to use a more simple workflow. How about importing the assets and then dragging them on to the menu editor window, but holding long enough to see the dialog box. Move down to the choice that creates a button, adds the assets to a track and links the two together.
You can then apply a templated menu if you so choose.
As for why you can't create the button - this may sound silly - but you are in the menu editor tab aren't you, not looking at the track footage instead? -
9x9 array of buttons and not a single button worked
im trying to build a 9 x 9 block composed of buttons. I used array of buttons.
here's my code with my explanation and poor logic thinking details.
public class ButtonArrayDemo extends JFrame implements ActionListener
private JButton[] sButton;
private int[] x;//manipulation purposes only
public ButtonArrayDemo()
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout( new GridLayout(9, 9) );
sButton = new JButton[81];
x = new int[81];
// creates the buttons,action listeners, syntax is correct but
// i doubt the logic
for (int i = 0; i < sButton.length ; i++)
JButton button = new JButton();
button.setText(" ");
button.addActionListener(this);
sButton[i] = button;
buttonPanel.add(sButton);
x[i] = 0;
getContentPane().add(buttonPanel,BorderLayout.SOUTH);
setResizable(false);
// what i want for this is that, when a button is clicked, it displays the
//number 1 then increments by 1 if clicked again. Like,when i click a
//blank button, it displays the number "1", if i clicked it again, it displays
//the number 2. This goes on until number 9. When the button is clicked
//on the 10th time, it leaves the button's text blank. Syntax is fine but
//i doubt the logic.
public void actionPerformed(ActionEvent e)
int y;
for(y = 0; y < sButton.length; y++)
if(e.getActionCommand().equals(sButton[y]))
sButton[y].setText(Integer.toString(++x[y]));
if(x[y] == 10)
sButton[y].setText(" ");
x[y] = 0;
Now, i created the main and compiled the program. The frames appeared complete with 81 buttons. But, when I click on any button,
it does nothing. The button's text which is supposedly to change is not displaying anything. this is a vital thinking process for me and any help from someone would be very much appreciated.
thanks for reading and i hope someone will respond to my problem.
lots of thanks.I believe the problem is that you are using the actionCommand but you did not set the actioncommand for the buttons. I suggest you either set the action command for each button to a unique item or use getSource instead.
Also, you might want to break out of your for loop once you find the correct button.
Also, if the future use the code formatting tags and this probably should have been in the Swing forum. -
My new IPad cannot start. No any response on any button. Not show charging.
Pls. can someone help about.
Thks.See Here...
How to Get Started
iPad User Guide iOS 5
http://manuals.info.apple.com/en_US/ipad_user_guide.pdf -
Reset Button does not reset Radio Button
Xcelsius 2008 Engage, 5.1.1.0 (Build 12,1,1,344) - SP1/FP1
The Reset Button does not appear to be resetting the Radio Button back to its default selection. I don't know if other components are similarly affected or not, but this appears to be the only one that I'm using that has this problem. Is this a known issue?
Just to be clear, everything else appears to be resetting OK at this point, just the one component that retains whatever was selected during a given session.
This does not kill my ability to go live with a project, but it does look bad. Any chance this made it onto the list for January's Fix Pack 2?Grace & Sammi,
Thanks so much for the quick response!
Just now I repeated the problem using a brand new project devoted to this issue. It uses a simple spreadsheet, three Radio Objects and a Reset Button.
-- Radio Button #1 is a "Fruit or Vegetables" selector. The labels are spreadsheet cells A3-A4 and it insert into cell B3. Selected Item (default selection) is "Label 1" which is "Fruit".
-- Radio Button #2 is a "Fruit" selector. The labels are spreadsheet cells A6-A8 (Apples, Bananas, Oranges) and it inserts into cell B6. Dynamic Visibility is set on "Fruit" being selected by Radio Button #1. Selected Item (default selection) is "Label 1" which is "Apples".
-- Radio Button #3 is a "Vegetable" selector. The labels are spreadsheet cells A10-A12 (Carrots, Celery, Potatoes) and it inserts into cell B10. Dynamic Visibility is set on "Vegetables" being selected by Radio Button #1. Selected Item (default selection) is "Label 1" which is "Potatoes".
Cell A1 reports the final selection. Using this formula
=IF(B3="Fruit","Selected: "&B6,"Selected: "&B10)
it checks B3 and shows whatever was selected there.
To repeat the problem in Preview mode:
1. Pick "Fruit", then "Bananas" (second option).
2. Pick "Vegetables", then "Potatoes".
3. Pick "Fruit" from the first Radio component again, and then click Reset.
You will see that "Fruit" resets back to Apples". When you click "Vegetables", you will see that "Potatoes" are still selected. But that Radio should have jumped back to the default "Carrots" selection. Or at least, that is how I would normally expect a reset button to behave.
I suspect the issue has something to do with dynamic visibility. E.g. the Reset Button can't change the state of the invisible component.
-F -
Our business has updated Adobe reader to 10.1.6. I have a BUTTON that I use to send an email using Javascript but now it will not work and sometimes it freezes up. When I open the same file in Acrobat Pro X it works fine. I need it to work in Adobe reader since my coworkers do not have Pro on their computers.
I do have a computer that has an older version of Adobe reader on it and it has the repair option in the help section and when I click repair the file starts to work but with the update to 10.1.6 the repair option is gone. I cannot uninstall or revert back to the older version because our IT department will not allow it so that option is not available to me.
Can anyone help please?I'm experiencing a similar issue in Reader 11.0.06 and the latest Acrobat XI as well. Anyone using 11.0.05 is fine. What changed in the latest update?
Update: I've been playing around with the Javascript settings in the preferences panel and I'm not sure what combination of the checkboxes makes the difference, but it seems to be working properly now. I'll update this post when I have the time to figure it out. (I had a feeling it was a security thing — the update notes for 11.0.06 weren't very enlightening, but they did say "security".)
Message was edited by: schelling -
Iphoto 8 on Mac Pro email button will not create "Larger" images!?
When I use the email function (from sharing menu or "email" icon) iPhoto generates the same (small) size file no matter which size I choose in the menu. This happens for all originals regardless of the raw size. This is not an issue for me on my laptop w/iPhoto 6. Anybody??? -Thanks.
Chris
What version of the OS are you using? iPhoto 08 won't run on 10.3 and you're list refers to 10.3.
Later versions of Mail have a setting for sizing pics in the New Message Window:
Uploaded with plasq's Skitch!
That's the usual cause of this problem (but not on 10.3).
Regards
TD -
Any way to change back button title without creating new button?
Hi,
Is there any way to change the back button title on a navigation controller without having to create a whole new button and action to go with it?
Thanks
RayYes, you don't need to create a new a new action mechanism etc.
One way to change the back button text on a the navbar of a view is to create a new UIBarButtonItem (with nil tagget and nil action )
Then set self.navigationItem.backBarButtonItem of the parent view controller to the new button
Note that you're setting the backbarButtonItem of the parent view controller (and not the view controller on which this bar button will be displayed). This automatically plugs in the default target, action etc. So you don't need to implement it -
I want to user JAR button that i created with button maker
ive download one oh those java Button Maker and it creats me a jar file with .class file i want to use it on my Panel that ive created by myself
(im working with eclipse)
How do i do it?
tnx
Message was edited by:
devianceAdd the jar to your project?
-
Dear Sirs,
I am following the example in the "Enterprise Java Beans manual" to use Jdeveloper to create the Hello World EJB described in appendix B.
My EJB is deployed successfully but when I run the client I get "ClassNotFoundException: hello.HelloHomeHelper".
I imagine that the computer is trying to load the HelloHomeHelper.narrow method to properly case the call to the create method of my EJB. But such class only gets created when you use the wizard "Generate CORBA Server classes". But I cannot do that since I am not extending org.omg.CORBA.Object object. Rather the EJB I am implementing implements the "SessionBean".
So why I am having CORBA-related problems with EJB?
thanks.Hi,
I have the same problem with bc4j deployed on Oracle 8.1.7 as session EJB.
I'm testing the deployed bc with a client code. I have the following problem on the lookup method:
avax.naming.NamingException: Unknown reasons. Root exception is
java.lang.ClassNotFoundException: vebs.jbo.common.ejb.VeAppModuleHomeHelper
void oracle.jbo.client.remote.ejb.aurora.AuroraEJBAmHomeImpl.initRemoteHome()
void oracle.jbo.client.remote.ejb.aurora.AuroraEJBAmHomeImpl.<init>(oracle.jbo.JboContext, java.lang.String)
oracle.jbo.common.JboHome oracle.jbo.client.remote.ejb.aurora.AuroraEJBInitialContext.createJboHome(java.lang.String)
java.lang.Object oracle.jbo.common.JboInitialContext.lookup(java.lang.String)
java.lang.Object javax.naming.InitialContext.lookup(java.lang.String)
void bctest.main(java.lang.String[])
but if I see in the Oracle db, the class is exported.
Help me!! -
Button asset not visible in button.
Details: fifteen buttons, each shows (button asset) a single frame of the target video for that button. First four menus were fine, but starting with the last button on menu five, the video is no longer visible in the button when programmed as the asset in the button editor.
It is not visible in either the menu or in the button editor. But it does play.
Now it seems that any new video asset will not be visible in any button.
is this a memory problem?
Any suggestions?Hi Venkatesh,
Steps :
1) Go to SU01 of the buyer
2) Go to Personalization tab
3) Double click on Personalization object key 'BBP_WFL_SECURITY'
You will get a pop up for 'Authorization level for Authorization'
4) Here change the securtiy level from 1(=no changes allowed) to at least 2(=low)
<b>Reward points for helpful answers</b>.
Regards,
Andy -
Creating a button with text in FlashCS5
I am fairly new with using FlashCS5. I just finished the class and created a button with text in it for class but now when I need to do it for a project I can't seem to get it to work.
I am trying to create a simple start and stop button to start and stop a Flash movie. I can get the buttons to work without any text, such as the word start and stop in the middle of each. Everything I've tried to do with the text on the button turns out the same.
What happens is that in Flash the buttons appear to work fine. The little hand with the finger shows no matter where I place my cursor on the button but when I test them the area where the text is does not allow the click to work. I have tried specifying a hit area and made sure that the hit area was larger than the entire button but still the middle where the text is doesn't work. Outside of the text area works fine.
Any ideas? I've spent 4 hours on this.Thank you for the reply but what I am doing is much simpler. I am creating a gray rectangle and putting text in the center. I am then selecting both the rectangle and the text and converting it to a button. I am then editing the button from the library and adding a keyframe to the hit area, drawing a rectangle around the button to establish the hit area.
I am enabling simple buttons and when in Flash it appears fine. It is when I test that the area where the text is doesn't function as clickable. -
Create Asset Master Button does not appear while creating SC.
Dear Friends,
We are working on SRM 5 and trying SSP with classic scenario. The issue is while creating Shopping cart for account assignment Asset, system does not display Create Asset Master button.
We have maintained following configuration in our SRM system.
1. The authorizations object M_BBP_*** is setup and activated for Employee creating shopping cart as well as RFC user.
2. Attribute Asset Class (ANK) is maintained in Organization structure as per Backend asset class
3. Attribute Account Assignment Category (KNT) is maintained for Asset in Organization structure
4. GL account for product category and account assignment is maintained
Still while creating Shopping cart for Account assignment Asset system does not display button Create Asset Master.
Any idea which setting I am missing?
In R/3 I am able to create Asset master while creating Purchase Requisition.
Regards,
Sandeep ParabHi
<u><b>Please go through this -></b></u>
http://help.sap.com/saphelp_srm50/helpdata/en/03/340ff8a5c711d4b2d8000102ade1c8/frameset.htm
Asset Procurement in EBP
Re: Asset number creation in EBP ?
Asset Procurement in SRM 5.0
Re: Cost center in asset item
Note 492107 - Account assignment with asset (changes in EBP)
Note 492073 - Account assignment to asset when creating a shopping basket
Note 897843 - Mixed account assignment types with asset in extended PO
Note 732374 - No default values from attributes for account assignment
Note 921767 - Default settings: Account assignment data is blank in ECS
Note 588898 - Additional documentation for SAP Enterprise Buyer 3.0
Note 575654 - Additional documentation for SAP Enterprise Buyer 3.5
Note 750381 - Asset master number is not transferred from details (2)
Note 674802 - Asset master number is not transferred from details
Note 484020 - No Asset Class Description when creating asset master
Note 936541 - Subsequent note to Note 543055
Note 613671 - RAISE COMPANY_CODE_NOT_VALID with enclosure creation
Note 455124 - Error message on unavailable asset class
Note 579900 - Account assgnmnt screen 2000: asset class transltd incrrctly
Note 399377 - EBP transfer of the asset text via EBP (as of Release 4.5)
Note 493512 - EBP: Message 197 (BBP_PD) not displayed by system
Note 423307 - Messages (BBP_PD) 193/194/195/197/202 translated incorrectly
Note 202684 - No derived account asgnmnt information frm back end
Regards
- Atul -
Creating a dynamic button class
Hi all. I'm trying to create a button class that has some
properties such as scale that can be coded at runtime. The tutorial
I found hard codes the scale amount into the class, but I would
like to be able to create a new instance of the button class in
Flash, and say on the main timeline, define my variables for
scale...and pass these to the class file. I'm running into an
"1120" error message. I have attached the original working code.
Thanks.Thanks. I'm having trouble finding a clear tutorial that I
can understand on this topic. I've tried creating a set function
but not sure where to write the get function. I have attached my
class file and my call to it in the main timeline. I've been
struggling with learning custom classes and appreciate any help!
Also, I am now creating a new instance on the main timeline
instead of linking to it in the library. What is the best way of
doing this. -
Creating a Button Class from MC
I have a few simple questions for those who know about
classes. I have been reading the tutorials on creating classes and
specifically extending the MC class. I am pretty sure that an
extended MC_Class might help me get what I need from my project.
I essentially have a bunch of buttons, hundreds to be exact -
and the exact number needs to be dynamic. Each one is currently a
static MC with a bunch of variables assigned to each one via global
variables. Its iis pulling in data taht assign the button values
from XML files and - these XML files may change.
Q1. If I extend the MC class so I can add attributes to MC's
instance (Avoiding global variables) - will it mess with the rest
of the movie clips in my scene? I mean if all I want to do is ad a
a few dynamic string variables - it really shouldnt effect any of
the other clips would it? MC.JumpURL = "newurl.com", MC.Thumnail
="/here/image.jpg" (This would help alot)
Q2. What if I wanted to define actions of the new MC in the
class? If the MC is an extension of the MC class. Would all of my
MC's automatically take on the actions of the custom MC Class? For
instance - I want the movieclip to animate onscreen and have
rollover effects. I could do this easy if it were static - but I
need this to become dynamic. Also - there are now unknown
quantities to deal with
Q3. How exactly would I call and assign the MC its atributes
at the same time? And how do I specify this MC to use the functions
defined in the class and not the other MC's I created elsewhere in
the File.
Example. Currently I have a grid of MCs' created when the
User clicks a menu item (Another type of MC).
Each new MC animates onstage - it calls a
loadMovie(_root.thumb[0], this.Flipper) to assign and embedded MC
an image defined in the XML that was loaded and assigned because I
placed the instance on stage and wrote a MC script on each MC.
Confused - check out what I am creating at
www.vincesidwell.com/Fischer
Click Fabrication or TurboSystems menus. Both menues will
load a new set of Thumbnails at the bottom. They are loaded via an
XML loaded by the menu and a function assigns the jpgs for the main
gallery, Rollover image, and eventually a URL for a downloadable
High Res Image.
The client recently added more than 9 images per menu item. I
will need to create a scrollable thumbnail gallery with dynamic
quantities
I can manually create the MC Scroller item for static number
of buttons. But scripting an unknown for each ones links and images
is insane. So I am looking at Classes. Assign a custom class for
the flipping buttons and I should be able to assign tthem as the
XML loads, and have it automatic. (pray please please please)
Anyhelp?
Thanks
Vince SidwellHi there!
I'll try and give some answers to your questions below...
"vin-E" <[email protected]> wrote in message
news:[email protected]...
>I have a few simple questions for those who know about
classes. I have
>been
> reading the tutorials on creating classes and
specifically extending the
> MC
> class. I am pretty sure that an extended MC_Class might
help me get what
> I
> need from my project.
>
> I essentially have a bunch of buttons, hundreds to be
exact - and the
> exact
> number needs to be dynamic. Each one is currently a
static MC with a
> bunch of
> variables assigned to each one via global variables. Its
iis pulling
> in
> data taht assign the button values from XML files and -
these XML files
> may
> change.
>
> Q1. If I extend the MC class so I can add attributes to
MC's instance
> (Avoiding global variables) - will it mess with the rest
of the movie
> clips in
> my scene? I mean if all I want to do is ad a a few
dynamic string
> variables -
> it really shouldnt effect any of the other clips would
it? MC.JumpURL =
> "newurl.com", MC.Thumnail ="/here/image.jpg" (This would
help alot)
You do not have to create a new MC class to assign local
values or functions
to it. A pseudo code example:
Loop through total buttons you want to make (which can be
number of entries
in an XML file)
Create a new movieclip and load the button graphic into
this, give it a
name like
MyButtonX, where X is an increasing number based on which
button this
is. (Instead of creating
and empty movielcip, you could also attach a movie (or
button) from
library.
Assign the values and create the functions for this button
that you
would like (probably based
on information in the XML file):
MyButtonX.someVariable = node.attribues.someData;
createOnRelease(MyButtonX, someOtherParamters)
(where you have defined the function createOnRelease to do
something
like
function createOnRelease(MC, someOtherParameteres) {
MC.onRelease = function() {
do what you want to do based on someOtherParameteres
Position and resize MyButtonX
In your example you have a 3x3 grid, which might extend to
3xTOTAL,
so you'd have to use some
mathematical formula based on the value X, something like
MyButtonX._x =
(((X-1)%3)*(buttonWidths+hSpaceBetweenButtons)
MyButtonY._y = Math.floor((X-1)/3)*(buttonHeights
+vSpaceBetweenButtons
end of loop.
>
> Q2. What if I wanted to define actions of the new MC in
the class? If
> the MC
> is an extension of the MC class. Would all of my MC's
automatically take
> on
> the actions of the custom MC Class? For instance - I
want the movieclip
> to
> animate onscreen and have rollover effects. I could do
this easy if it
> were
> static - but I need this to become dynamic. Also - there
are now unknown
> quantities to deal with
If you actually create a new class, than all instances of
that class will
have the methods you define for it (just like all instances
of a movieclip
has those methods. At least, have them available. That
doesn't mean they are
always in use ... like for example the onRollOver. But again,
you don't need
to create a class to give all your dynamically created
buttons a rollover
effect. (Check code above).
> Q3. How exactly would I call and assign the MC its
atributes at the same
> time? And how do I specify this MC to use the functions
defined in the
> class
> and not the other MC's I created elsewhere in the File.
You use the instance name of the MC to access that MC and its
attributes/methods. For example button number 10 might look
like this:
trace(MyButton10._x);
trace(MyButton10.someVariableYouHaveDefined);
MyButton10.callSomeFunctionYouHaveDefined();
For a movieclip to access a variable that has been defined
for that instance
of the movieclip, use "this" to point to that particular
instance. So if we
defined the function "callSomeFunctionYouHaveDefined" for
button number 10
and want to access "someVariableYouHaveDefined" for this
particular
instance, then
MyButton10.callSomeFunctionYouHaveDefined = function() {
trace(this.someVariableYouHaveDefined);
> Example. Currently I have a grid of MCs' created when
the User clicks a
> menu
> item (Another type of MC).
> Each new MC animates onstage - it calls a
loadMovie(_root.thumb[0],
> this.Flipper) to assign and embedded MC an image defined
in the XML that
> was
> loaded and assigned because I placed the instance on
stage and wrote a MC
> script on each MC.
>
> Confused - check out what I am creating at
www.vincesidwell.com/Fischer
>
> Click Fabrication or TurboSystems menus. Both menues
will load a new set
> of
> Thumbnails at the bottom. They are loaded via an XML
loaded by the menu
> and a
> function assigns the jpgs for the main gallery, Rollover
image, and
> eventually
> a URL for a downloadable High Res Image.
>
> The client recently added more than 9 images per menu
item. I will need
> to
> create a scrollable thumbnail gallery with dynamic
quantities
>
> I can manually create the MC Scroller item for static
number of buttons.
> But
> scripting an unknown for each ones links and images is
insane. So I am
> looking
> at Classes. Assign a custom class for the flipping
buttons and I should
> be
> able to assign tthem as the XML loads, and have it
automatic. (pray please
> please please)
Again, no need for a class for this. If you load the buttons
into seperate
MCs, and make sure to have all these MCs created inside a
common parent MC
for these buttons (which then _only_ contains these buttons).
You can move
this parent MC up and down on the stage based on the
scrollbar. And you can
read height off this MC to create your scrollbar.
You might want to check out the following tutorials at
http://www.gotoandlearn.com/:
XML Video Playlist
Creating Animated Buttons
Introduction to OOP
Now, I've said many times you don't need to make your own
class to do what
you want. That does not mean you can't make your own class. I
just think
that the main problem you are facing is the dynamic part,
which you will be
facing if you make your own class or not.
/Jensen/
>
> Anyhelp?
>
> Thanks
> Vince Sidwell
>
>
>
Maybe you are looking for
-
ITunes Match and additional users
I have a 15" Late 2008 MacBook Pro with 8 Gig of RAM and a 256 SSD. I am running 10.8.2 and iTunes 10.7 (21). I subscribed to iTunes Match shortly after it was introduced. About a week or two ago I discovered a serious problem with my iTunes songs. A
-
I can no longer upload photos with the camera attachment. I am getting an error saying the device uses too much power. I have used the device before. Is there anything that can be done to fix this problem?
-
macbook air turns on to a white screen (usual sounds) then goes black leaving the white curser (the keys sound when depressed) await advise please
-
Problem opening a video (photoshop format)
Every time I try to open a video its stops at "reading photoshop format". Any chance someone knows whats up?
-
No refund, but got emails to confirm them
i recently refunded a couple of items that i had accidentally purchased and i have not gotten my money back. i got an email for each item i refunded to confirm that the refund had been successful, but i have had no money credited to me. please help!!