Beginner (I want to make a simple button with code)(very basic)

I've had some success with AS3, but so far all the code I've
written just runs once the program starts, and thats it. The code
is attached to the first frame of the flash file.
I want to be able to take the code I've already made, and
stick it into a button, so the code will run every time the button
is pressed, without having to reload the whole program.
Basically all I want to do is make a button that runs the
code:
trace('hi');
every time it is pressed.
Once I have that, I can figure out the rest by my self.
Please help.

Is this button on the stage and in the timeline? If it is,
then select the button on the stage and then, in the Properties
window, give the button an instance name if it doesn't have one
yet.
In a new layer, in the first frame, add this code:
buttonInstanceName.addEventListener(MouseEvent.MOUSE_UP,
buttonUp);
function buttonUp(event:MouseEvent):void {
trace("hi");
substitute the button instance name that you used for
"buttonInstanceName" in the first line.

Similar Messages

  • I want to make a simple line chart

    i want to make a simple line chart using the data in two nonadjacent columns.
    it seems that the easiest way to do this is to export the sheet to google docs and use THEIR charting, which is a two-click deal.
    is there an easy way to do this in numbers?
    my impression:
    numbers:
    very fancy, super pretty, easy to modify APPEARANCE, difficult to use actual charts. custom paint job on a junker
    googledocs:
    available everywhere, basic, more difficult with actual data flexibility, but you can use what you've got.
    the whole emphasis on numbers seems to be how pretty i can make displays, but not a lot of emphasis on making it easy to make things work.
    can anyone shed some light on how to make this simple instead of pretty?

    You can definitely use the technique I mentioned to order the columns to make it easy to chart:
    Here I created a table (the top one) to hold the original data and make a second table (the lower one) to pull data into two adjacent columns:
    The bottom table, as I said pulls data from the top data table:
    Then highlight the data in the table to chart, and selec the chart type from the menu (I suggest the bar chart which is the first item in the chart tool menu):
    I made up this data and mean it to be no reflection on your running ability 

  • I want to make an online radio with java

    I want to make an online radio with java. Can someone point in the right direction in what I would need to know and do.

    you will have to learn about java media framework.
    And probably live audio streaming too

  • I just bought a new macair laptop and it doens't have idvd and I want to make a DVD slideshow with music.  I have an external CD drive. Is there an applicaation that apple has to do this?  IF I buy a used mac, which ones have idvd?

    I have a new macair laptop and it does not have idvd. It has a flashdirve instead, so no internal CD drive though I bought an external one. I'm wanted to make a DVD slide show with music and I was told I can't do that in order to play it on a dvd player. Does Mac have an appication to buy that can do the same thing? I thought I saw one for $39.95 but not sure if it will do this. The apple store did not know for sure. Also, if I bought a used mac laptop, which ones will have the idvd installed on it?
    Thanks,
    Phyllis

    It is now apparent that iWeb, and iDVD, will no longer be supported by Apple. This is evidenced by the fact that new Macs are shipping with iLife 11 installed but without iWeb and iDVD. 
    Other users have complained to Apple via Apple via http://www.apple.com/feedback/idvd.html and/or http://www.apple.com/contact/ and have received a boxed copy of iLIfe 11.  Give it a try. In the meantime the following maybe of interest:
    iWeb will still continue to work but without the following:
    Features No Longer Available Once MobileMe is Discontinued:
    ◼ Password protection
    ◼ Blog and photo comments
    ◼ Blog search
    ◼ Hit counter
    All of these issues can be replaced with 3rd party options.
    I found that if I published my site to a folder on my hard drive and then uploaded with a 3rd party FTP client subscriptions to slideshows and the RSS feed were broken.  If I published directly from iWeb to the FPT server those two features continued to work correctly.
    There's another problem and that's with iWeb's popup slideshows.  Once the MMe servers are no longer online the popup slideshow buttons will not display their images.
    Click to view full size
    However, Roddy McKay and I have figured out a way to modify existing sites with those slideshows and iWeb itself so that those images will display as expected once MobileMe servers are gone.  How to is described in this tutorial: #26 - How to Modify iWeb So Popup Slideshows Will Work After MobileMe is Discontinued.
    Apple has announced that iLife is now an unsupported product and those iApps will only be available thru the App Store from now on. However, the boxed iLife 11 at the online Apple Store (Store button at the top of the page) and those still on the shelves of retailers will include iWeb and iDVD. Those two apps were listed in small, gray text on the iLife 11 box that I bought. Personally, if I already didn't have a copy I would purchase one to have it for reinstallation purposes if ever needed.
    OT

  • How do I make a simple DVD with chapters?

    I have a quicktime sequence that is saved with chapter markers exported from Final Cut Pro. The sequence is about 1hr30 min long, and has about 70 chapter markers. I just need a simple DVD that can play through the whole sequence, or have the ability to have an index where I can jump to any chapter. How can I do this...especially without using one of Apple's pre-designed templates? Is this something I could also do in iDVD?

    How can I do this...especially without using one of Apple's pre-designed templates? Is this something I could also do in iDVD?
    If you don't want to use an Apple-designed template, I'm not sure why you would want to do it in iDVD, as you can only use templates there.
    You need to go through the tutorial, first of all, to get familiar with the program.
    Then, you would import your movie that was exported with DVD chapter markers. Create however many menus you want (I would say 7-10) with 7-10 buttons on each. Link each button to hop to the appropriate chapter marker. Also provide a "play all" button on the first menu, or each menu, that links to the beginning of the track.
    If you want video thumbnails, you'll need to size buttons accordingly and may need to have less buttons per menu.
    PS: with that many chapters I'm not sure I'd classify this project as "simple." Simple in design, maybe, but it'll be quite a bit of work.

  • CC wants to make changes - write your administrator code - no info on which changes it wants to make - keeps alerting me. I didn't ask for any changes.

    Every five seconds I get a notification that Adobe CC cannot install or uninstall Adobe add-ons without admin rights. I did'nt ask for any changes.
    If I press the upcoming alert, I get a window saying that CC wants to make changes, please write my admin code, but it doesn'r say which changes it is about to make.
    What do I do?

    Hi. I'm sure you've already tried this but are both you and your wife's accounts set as administrators?

  • Make a round button with image

    i have image 40x40
    i want to design a round button for it and when click no rectangle or squre is visible.
    how can i design it
    plz give me a line of code.
    thanks

    Put you image on a jlabel, then add a mouselistener to the label

  • Want to make a simple form

    I have no experience with making forms or using databases or
    anything like that.
    But all I want to do is make a form where the user can fill
    out info in a series of text fields, which gets sent to my email
    address when you hit "submit".
    Is this easy enough to do? Can i do this just using html?
    Is there just a command I need to put somewhere to tell the
    form to send as an email?
    If it's not that simple, does anyone know of a good tutorial
    for this?

    There are only two ways to process form data -
    1. Use mailto:[email protected] as the action of the form
    2. Use a server-side scripting method to a) harvest the
    form's data, b)
    process it in some manner, e.g., enter it into a database, c)
    formulate and
    send an email to one or more email recipients, and d)
    redirect the visitor
    to some ending page
    Method 1 is quite simple, and is also the least reliable. It
    depends both
    on your visitor having an email client already installed on
    their computer -
    this eliminates public computers, or home users without email
    clients
    installed (more and more it seems) - and on the installed
    email client
    responding to
    the mailto call. It is not possible to use this method *and*
    send the
    visitor to a
    thank you page as well.
    Method 2 is the preferred method, since it eliminates the
    problems of method
    1, but it means that you have to grapple with
    server-scripting somehow (ASP,
    CF, PHP, perl, etc.).
    You would have to decide which of these methods is best for
    your needs,
    but if it's Method 2, then start by asking your host what
    they provide for
    form
    processing.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "BullocksTroy" <[email protected]> wrote in
    message
    news:[email protected]...
    >I have no experience with making forms or using databases
    or anything like
    >that.
    > But all I want to do is make a form where the user can
    fill out info in a
    > series of text fields, which gets sent to my email
    address when you hit
    > "submit".
    >
    > Is this easy enough to do? Can i do this just using
    html?
    > Is there just a command I need to put somewhere to tell
    the form to send
    > as an
    > email?
    > If it's not that simple, does anyone know of a good
    tutorial for this?
    >

  • I want to make a simple PhotoBook

    I have 50 illustrations I want to turn into a 50 page book, thats it. One illustration (jpg) per page. There has to be an easy way to do this? Help please! I am a beginner, but I looked online and couldn't find anything. Thanks for the help in advance.

    I'd recommend that you use Pages instead and save as ePub. Drag the each picture in, center it, add a caption if you want, and insert a page break. When you are finished export as ePub. Using Pages rather than Author gives you the advantage of looking good in portrait mode, having larger pictures, working on different devices. I think this would work well on a simple project like yours. Use author if you want to do more complex things. Another problem is that your project will look awkward in portrait mode if you use Author.

  • I want to make a simple image editor by as

    I do not have any concept about how to scale the image in the
    editor.
    For example, when the user clicked one of the image in the
    editor then he/she can scale the selected image by mouse just like
    the scale function in MS Paint..
    thank so much~

    You can definitely use the technique I mentioned to order the columns to make it easy to chart:
    Here I created a table (the top one) to hold the original data and make a second table (the lower one) to pull data into two adjacent columns:
    The bottom table, as I said pulls data from the top data table:
    Then highlight the data in the table to chart, and selec the chart type from the menu (I suggest the bar chart which is the first item in the chart tool menu):
    I made up this data and mean it to be no reflection on your running ability 

  • Why when I want to make a simple purchase, am I asked for personal info? Like a phone number.

    Invasion of privacy. I left the item rather than give up the info

    Hello User486289, 
    Welcome to the Community Forums!
    I'm very sorry to hear that you left your item and walked out. I understand that you might not wanted to give us your phone number, but it is part of the information that we collect as per our Privacy Policy seen here. 
    Thank you for providing us your feedback, and I hope you will change your mind and consider shopping with us again soon. 
    Regards, 
    Justin|Community Connector | Best Buy® Corporate
     Private Message

  • What's with the hate against simple buttons with onclick?

    Just curious: why are page buttons designed to only "submit a page or redirect to a URL"? I wanted a button that simply opens a popup and it seems to require ridiculous workarounds. You ApEx insiders: why?

    Hello,
    You can simply call your Javascript via a URL location like -
    javascript:foo();John.
    http://jes.blogs.shellprompt.net
    http://www.apex-evangelists.com

  • I want to create a simple docuement with 2 pages?

    I want to my plugin to create a simple document as soon as My Plugin is loaded in Indesign. I have derived my class IStartupShutdownService  so that it's called in startup.
    But this is failing at line 23 below.
    What else do I need to include in my .fr file?
    class LTestStartupShutdownServiceImpl : public CPMUnknown<IStartupShutdownService>
    public:
        LTestStartupShutdownServiceImpl(IPMUnknown* boss);
        virtual ~LTestStartupShutdownServiceImpl();
        virtual void Startup();
        virtual void Shutdown();
    CREATE_PMINTERFACE(LTestStartupShutdownServiceImpl, kLTestStartupShutdownServiceImpl)
    LTestStartupShutdownServiceImpl::LTestStartupShutdownServiceImpl(IPMUnknown *boss):CPMUnknown<IStartupShutdownService>(boss)
        do
            const PMReal width=612, height=792;
            const int32 numPages=5, numPagesPerSpread=1;
            // Create the command.
            InterfacePtr<ICommand> newDocCmd(Utils<IDocumentCommands>()->CreateNewCommand());  //<-----this is coming null and failing
            ASSERT(newDocCmd);
            if (newDocCmd == nil)
                break;
            // Set the command's parameterised data.
            InterfacePtr<INewDocCmdData> newDocCmdData(newDocCmd, UseDefaultIID());
            ASSERT(newDocCmdData);
            if (newDocCmdData == nil)
                break;
            newDocCmdData->SetCreateBasicDocument(kFalse); // Override the following defaults.
            PMPageSize pageSize( width, height);
            newDocCmdData->SetNewDocumentPageSize(pageSize);
            bool16 bWide = kTrue; // landscape orientation.
            newDocCmdData->SetWideOrientation(bWide);
            // Size margin proportional to document width and height.
            PMReal horMargin = width / 20;
            PMReal verMargin = height / 20;
            newDocCmdData->SetMargins(horMargin, verMargin, horMargin, verMargin);
            newDocCmdData->SetNumPages(numPages);
            newDocCmdData->SetPagesPerSpread(numPagesPerSpread);
            // Create the new document.
            CmdUtils::ProcessCommand(newDocCmd);
        while (false);
    LTestStartupShutdownServiceImpl::~LTestStartupShutdownServiceImpl()
    void LTestStartupShutdownServiceImpl::Startup()
    void LTestStartupShutdownServiceImpl::Shutdown()
    Below is the .fr file:
    * Boss class definitions.
    resource ClassDescriptionTable(kSDKDefClassDescriptionTableResourceID)
    Class
      kLTestStartupShutdownServiceBoss,
      kInvalidClass,
      // Implementation of IStartupShutdownService
      IID_ISTARTUPSHUTDOWN, kLTestStartupShutdownServiceImpl,
      // Implementation to IK2ServiceProvider to identify the service type as startup-shutdown
      IID_IK2SERVICEPROVIDER, kLTestStartupShutdownServiceImpl,

    Hi maddy,
    I want to save the document to MyDocuments folder, I tried to look in IDocFileHandler but I can not get a function which takes path/name as input with docRef.
    Can u suggest how can my document to disk?
    I dont want user to enter any detail, the document just created should get saved on Disk with the use of some commands only.

  • PLEASE HELP THIS SIMPLE MAN WITH A VERY SIMPLE QUESTION

    Hi and thank you for looking.
    I am not musically inclined, challenged in fact. However I am making an iDVD and putting music to my slideshows but the program only lets me put 1 song for an entire group of pictures resulting in hearing the same song OVER AND OVER.
    My question for all you experienced garage band people is, is it possible to put a few songs together in garage band and then save them all as 1 song and then export it out to itunes so that I can put it into iDVD?
    Remember I have very little knowledge in using garage band so you may have to dumb it down for me but I am quite experienced with iDVD and iTunes now.
    Thanks for ANY and all help
    Mac

    Well, I won't explain all of GB in one post (look at the introductory videos on Apple's GB website), but yes, it's very easy to do that:
    • Create a new project and put your slide show video in the video track.
    • drag all the songs you want to use into the timeline, they will all get their own music track (note that you can't use DRM protected songs from the iTunes store that way).
    • Cut them wherever you want (using the Apple-T command) and move them around as you like.
    • If you want the songs to fade into each other, you'll have to use volume curves (look for "curves" in the Help menu).
    • When you like the result, share your project to iTunes (either the whole video, or just the audio which you later add in iPhoto or iDVD or iMovie).

  • Simple problem with  code

    whenever i try running my code i get a error message and it has to do with this part of the code
    public int cmd()
        footballer.footComp()=0;
        Collections.sort(xList);
        return  footballer.getFootComp();
    the method being called is in another class called Footballer, which has the the method footComp()
    public static int getFootComp()
        return footComp;
    where footComp has also been declared static in the Footballer class
    private static int footComp = 0;
    this is the error message i get :
    required: variable
    found : value
    thanks for ur help in advance

    pls how do i do that?You don't know how to pass a method to a parameter? You don't know how to use that parameter to set footComp?
    Sun's basic Java tutorial
    Sun's New To Java Center. Includes an overview of what Java is, instructions for setting up Java, an intro to programming (that includes links to the above tutorial or to parts of it), quizzes, a list of resources, and info on certification and courses.
    http://javaalmanac.com. A couple dozen code examples that supplement The Java Developers Almanac.
    jGuru. A general Java resource site. Includes FAQs, forums, courses, more.
    JavaRanch. To quote the tagline on their homepage: "a friendly place for Java greenhorns." FAQs, forums (moderated, I believe), sample code, all kinds of goodies for newbies. From what I've heard, they live up to the "friendly" claim.
    Bruce Eckel's Thinking in Java (Available online.)
    Joshua Bloch's Effective Java
    Bert Bates and Kathy Sierra's Head First Java.
    James Gosling's The Java Programming Language. Gosling is
    the creator of Java. It doesn't get much more authoratative than this.

Maybe you are looking for

  • How do I sync multiple email accounts on ipad

    So I'm now, dubiously, the lucky owner of iPad mini with up to date software and iMac with latest software. It now seems apple have decided they don't want me to use more than one email account and so have stopped me being able to sync them ? Even fo

  • Satellite Pro L450D - Slight ripple effect on external monitor

    I am hoping someone can help me. Have just bought a new Satellite Pro L450D and also bought a separate lcd screen (Viewsonic) to use with the laptop. When using the lcd screen there is a slight ripple effect across the background when you look at the

  • How do I change the paper size in an existing Pages document?

    How do I change the paper size on an existing Pages document?

  • How can i calcilate cost depreciation for assets

    Hi. can anybody tell me how can i calculate cost depreciation for an asset. i have used one function module DEPR_RECALCULATE. but it will allow only one date and it will calculate depreciation for total year . i want to pass the two date . how can i

  • Setting backups of enteprise portal on Oracle

    Hi, I want to know what optiones there are to schedule backus of a enterprise portal. In the abap part, It can scheduled with the db13 but in enterprise portal? And what can change the default path of the oraarch? I´ve seen the initsid.sap, and i don