Need help with Buttons with ActionScript

I am trying to create a button that will go to a different
scene in my flash project using
on (press) { gotoAndPlay(about,1);
I have done this several times before, however, for some
reason every time I try to put actions on my buttons it says that
actions can't be applied to it. I have even tried switching them to
movie clips. I can't figure out what is wrong.
Any help would be greatly appreciated!
Thanks

Thanks for you help!!!! That worked!

Similar Messages

  • Need help about button

    Hi everybody!
    I'm from Italy, so I need help regarding button
    I create an animation, I put a button to replay the movie by this code:
    on (release) {
    gotoAndPlay(1);
    but in AS3 doesn't work. Can you help me pls?
    Another problem...I need a very simple preloader that display only percentage, stop.
    Anybody knows a template or tutorial about this?
    Thx in advance!

    What do you mean by scene2?. You can only preload external content like a picture, another swf, etc...a much simpler example:
    var myLoader:Loader = new Loader();
    addChildAt(myLoader,0)
    myLoader.load(new URLRequest("http://www.snowman-jim.org/science/images/north-pole-sun-moon.jpg"))
    myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, loading)
    myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, finishLoading)
    function loading(e:ProgressEvent):void{
        info_txt.text="Loading.."Math.floor(e.currentTarget.bytesLoaded/1024)" Kb";//e.currentTarget is referring to myLoader.contentLoaderInfo
    function finalizado(e:Event):void{
        info_txt.text="I'm done!";
    Just change myLoader.load(new URLRequest("http://www.snowman-jim.org/science/images/north-pole-sun-moon.jpg")) path for the relevant path to the file you want to preload.

  • Java Help on buttons with counter

    public Keypad(Display myMonitor)
            // initialise instance variables
            monitor = myMonitor;
            JPanel p = new JPanel();
            p.setLayout(new GridLayout(5,4));
            String [] buttonLabels={"One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve",
            "Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen","Twenty"};
            JButton [] buttons = new JButton[buttonLabels.length];
            for(int i = 0; i < buttonLabels.length; i++)
                buttons[i] = new JButton( buttonLabels[ i ] );
                buttons[i].addActionListener(this);
                p.add(buttons[i]);
                setFont(new Font("SansSerif",Font.BOLD,18));
              add("Center",p);
    I need help on using the buttons to have a counter for example when someone clicks  the button "One" 5 times it display something like this : [5] One. So far the buttons work, but I cannot get a counter associate with them. Big Help is extremely needed.  Also the buttons need to be reset to zero; I dont want the counter to keep increasing forever.
    Thanks Cheikh

    You should create two new integer variables.
    count and lastPressed
    let lastPressed be set to a different numeric value for each button you have (button1 = 0, button2 = 1, and etc)
    you set lastPressed each time a button is pressed (in the handler) to its specific associated value, and then set count to 1. If lastPressed is = to the integer button index of the current button, then you pressed the button last time, so we increment count (count++).
    I hope this helps. I might not be explaining it well enough.
    example:
    if( lastPressed == 0 )
    count++
    else // we're in button 0, and lastPressed != to it.
    count = 1;
    lastPressed = 0;
    // handle other stuff ,and return

  • Need help to start with some file and text manipulation

    Hello script mavens,
    I need help with starting a script that does the following:
    -within a base folder it takes an inventory (list?) of all the files (which happen to be image files).
    -creates a new folder inside the base folder and calls it imagesX where X increases by one every time the script is run
    -moves all the files into the images folder
    -within the base folder it creates a new text file and calls it imagesX.js
    -writes a "//-" into imagesX.js
    -then writes the list of filenames into the imagesX.js twice, separated by an empty line, and adds a semicolon to the end of each filename and saves imagesX.js
    -from a folder a level above the base folder it copies a file called index.html into the base folder and renames in indexX.html
    -in indexX.html it replaces a string "replaceThis" with "imagesX.js"
    The task is more complex but this would help me tremendously do the rest.
    If I am asking for too much on this forum please let me know

    This should get you started.
    The description of how you want to write the data isn't clear, but the rest should work (untested):
    property imageNum : 0 -- last used ImageNumber
    -- within a base folder it takes an inventory (list?) of all the files (which happen to be image files).
    -- get the folder:
    set baseFolder to (choose folder)
    -- now get the files within it:
    tell application "Finder"
    set fileList to every file of folder baseFolder as alias list
    end tell
    --creates a new folder inside the base folder and calls it imagesX where X increases by one every time the script is run
    tell application "Finder"
    set imageNum to imageNum + 1
    set newImageFolder to make new folder at baseFolder with properties {name:"images" & imageNum}
    -- moves all the files into the images folder
    move every file of folder baseFolder to newImageFolder
    --within the base folder it creates a new text file and calls it imagesX.js
    set textFile to (open for access file (baseFolder as text) & "images" & imageNum & ".js" with write permission)
    --writes a "//-" into imagesX.js
    write "//-" to textFile
    -- then writes the list of filenames into the imagesX.js twice, separated by an empty line, and adds a semicolon to the end of each filename and saves imagesX.js
    -- need more info here
    -- a blank line between each instance of the file name? or all file names, blank line, all file names again?
    -- an example, please
    close access textFile
    --from a folder a level above the base folder it copies a file called index.html into the base folder
    --and renames in indexX.html
    --in indexX.html it replaces a string "replaceThis" with "imagesX.js"
    -- the easiest way of doing this is to read the file and write a new copy with the changes - that's easier than changing it in situ:
    set indexHTML to (read file "index.html" of folder (container of baseFolder))
    set {oldTIDs, my text item delimiters} to {my text item delimiters, "replaceThis"}
    set indexHTML to text items of indexHTML
    set my text item delimiters to "imagesX.js"
    set indexHTML to indexHTML as text
    set my text item delimiters to oldTIDs
    set indexFile to (open for access file ("index" & imageNum & ".html") with write permission)
    write indexHTML to indexFile
    close access indexFile
    end tell

  • NEED HELP IN MATRIX WITH GROUP REPORT

    Dear All,
    I need small help in MATRIX WITH GROUP REPORT In Report Builder Test Report
    In my report, having periods as rows and location as columns as shown below,
    1) LOC-A
    JAN-10 FEB-10
    ITEM-GROUP -1 1 2
    ITEM-GROUP-2 3 4
    ITEM-GROUP 3 5 6
    2) LOC- B
    MAR-10 APR-10
    ITEM-GROUP -1 7 8
    ITEM-GROUP-2 9 10
    ITEM-GROUP-3 11 12
    But comming to my requirement, the periods should be in fix in matrix as shown below
    1) JAN-10 FEB-10 MAR-10 APR-10
    LOC-A
    ITEM-GROUP -1 1 2
    ITEM-GROUP-2 3 4
    ITEM-GROUP 3 5 6
    LOC- B
    ITEM-GROUP -1 0 0 7 8
    ITEM-GROUP-2 0 0 9 10
    ITEM-GROUP-3 0 0 11 12
    I am unable to get this kind of output format
    Please kindly waiting for reply from our team....
    Regards
    krishna.P

    For the periods, create a seperate dummy query and then use it as column group in the multi query matrix.

  • Need help  Pagination Suppourt with DataGrid

    Hi ,
    When i do a search Operation , the data from Database is huge and i think if i display all of them at a Time it will be a performance and response Time issue .
    So the question i am asking is that , can any body please give me a basic idea as how to implement Pagination with DataGrid Results ??
    Need help with Datgrid and Pagination suppourt .
    Thnaks in advnace .

    Hi Kiran,
    Try referring to the below link...
    http://www.flexicious.com/
    Thanks,
    Bhasker Chari.S

  • Help creating buttons with actions

    I am looking for a way to program buttons with actions and conditional outputs. As an example: After populating a set number of cells, I would like to be able to program a button to copy the contents of those cellsto another set of cells. Also, a button programmed to clear the contents of the cellswould be nice.
    anyone?

    Buttons are typically associated to macros (VBA or other). As Numbers 1.0 does not support any macros, I am afraid that you are out of look.
    To copy values is very simple with formulas of course (=a1 and so on), but you probably know that, and need something more powerful.

  • Replaced hard drive in compaq presario cq62, need help recovering it with out disks

    Recently replaced the hard drive in my notebook due to failure of original.  Need help recovering it without disks

    If you are wanting to install the original copy of Windows it came with, you will need a set of recovery disks.
    Otherwise, you can purchase a copy of Windows to install and download the appropriate drivers from http://goo.gl/hOm3. Just make sure the copy of Windows that is installed is at least the same family of Windows to ensure that drivers are available.
    What is the exact model of the notebook and product number?
    NOTE: Do not provide the serial number.
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • Need help from somebody with the "MSI KT6 Delta-FIS2R" motherboard

    Hi everybody!
    I really need some help from somebody with the MSI KT6 Delta-FIS2R motherboard (the one with onboard LAN, Audio, RAID, S-ATA and IEEE1394 firewire). You see. I've got this board myself but it's been destroyd. Some values for the onboard devices in my board has been overwritten so that windows no longer recognizes the onboard LAN and Audio controller anymore. I really need some help from somebody with this board.
    I need to see what the values for the onboard devices should be. I hope someone can help me by sending me a repport from the Everest home edition: http://www.lavalys.com/products/overview.php?pid=1&lang=en
    If anyone could do me this favour, I would be VERRY thankfull

    Quote from: HYSTERIAH on 12-November-05, 06:24:20
    I really need some help from somebody with the MSI KT6 Delta-FIS2R motherboard
    HYSTERIAH,
    With 76 Replies and 277 Views on your original thread, it looks to me like people have been trying to help you.
    So there is no confusion, I am locking this thread so all your help and advice you receive will be in the same place, so people do not need to jump between threads to keep track of what has already been suggested for this mobo of yours.
    Richard

  • Need help for button actions

    Hi, can someone help me please? I like to put a invisable
    button over a picture (movie) with two actions. 1. rollover will
    show a title, 2. release will get new URL. I succeed in one or the
    other action but not on both of them combined. What can I do? I use
    action script 2. Thanks. Sarosa

    You could achieve the same result putting code in the
    button...
    1 - Open example.fla
    2 - Save it as example2.fla
    3 - Layer Actions --> frame 1, delete all the code leaving
    only:
    testing._visible = false;
    stop();
    4 - Layer button: select the bt button instance
    5 - in the Actions Panel (by the way, attached to the
    button), put this code:
    on (rollOver) {
    testing._visible = true;
    on (rollOut) {
    testing._visible = false;
    on (release) {
    getURL("
    http://www.google.com", _blank);
    6 - Test your movie: it works too!
    If you are totally new to Flash, always remember to name
    things in an appropriate way using the "official" names.
    (read again the beginner's tutorials)
    For example, it's wrong to say "I put the action script on
    the button not on a separate layer".
    This is completely ununderstandable...
    More: I didn't "convert" a graphic symbol to a button but I
    changed the behavior of a graphic symbol into the behavior of a
    button.
    Doing so, the graphic symbol is recognized as a button with
    all the properties attached to a button.
    The main difference between a graphic symbol acting as a
    button and a real Button is that the Button has four frames (Up,
    Over, Down and Hit) and the graphic symbol has not.

  • Help with Buttons in Actionscript 2

    Help!! I am creating a Flash movie with 5 scenes. I have
    buttons for each that I have added actionscript to, but they still
    do not work. I am not getting any error messages. I am using
    actionscript 2 and have gone step by step. here is what i have :
    on (release) {
    gotoAndStop("main", 1);
    on (release) {
    gotoAndStop("blackboard", 1);
    etc for the rest of the buttons. Any help would save me much
    stress as I am trying to finish a project for school!!! thanks
    ah

    Try adding _root. before the gotoAndStop command. If you have
    the code on the buttons that is.

  • Need help displaying images with List component for Flash CS4 (ActionScript 3.0)

    Hi folks:
    I am an inexperienced user of Flash CS4 Pro (v10.0.2). I am attempting to use the List component with ActionScript 3.0 to make a different image display when a user clicks each item in a list.
    I did find a tutorial that showed me how to make different text display using a dynamic text box and the following ActionScript:
    MyList.addEventListener(Event.CHANGE, ShowSelectedItem);
    function ShowSelectedItem(event:Event):void {
        ListText.text=MyList.selectedItem.data;
    ...where My List is the instance of the List component and ListText is the dynamix text box. In this case, the user clicks an item in the list, defined by the label value in the dataProvider parameter of the List component, and text displays as defined in the data value in the dataProvider parameter.
    However, as I mentioned to start, what I really want to do is make images display instead of text. Can anyone provide me the steps to do this?
    I appreciate your help (in advance)!!
    Cindy

    Hi...thanks for responding! I was planning on using images from the Library, but if there is a better way to do it, I'm open. So far, I just have text in the data property. This is part of my problem. I don't know what I need to put in the data value for an image to display. Do I just put the image file name and Flash will know to pull it from the Library? Do I need to place the images on the stage on different frames? I apologize for the "stupid user" questions, but as you can tell, I'm a newbie.
    Appreciate your patience and any help you can offer!
    Cindy

  • Need help big time with pop-up window!

    This is probably an easy answer, I'm not a programmer or a back end guy whatsoever, I'm a graphic designer trying to make his way through a project for a client.
    I'm working up a Flash template, and I need to make a simple pop up window that will view a more detailed version of an image.  The template has a pop up window system where you add your photo to a certain frame of a movie clip.  The problem is, the pop ups have scroll bars built in, and for the life of me I couldn't figure out how to get rid of them, so I duplicated one of the movie clips that looked like it housed the framework of the pop up and deleted the scroll bar (I didn't delete any of the scroll bar code because I had no idea what I was doing).  It actually kind of worked, but the pop up window is a bit too wide and doesn't look right.
    You can view my hack job here...
    http://truetilldeathhq.com/main8_v7/main8_v7.html
    Stay on the "Print" page and click the first "01" button and an ad for Ford will come up.  Click the "Detailed View" button in the description to see the pop up window.
    My question is, there MUST be an easier way to make a pop up window than the workaround I'm using with the template.  What I'm trying to do is have a pop up for each sample of the work (all images would be the same size) for the first four buttons, and then for the "Online Banners" page, have the pop up open up to the dimensions of the particular banner ad and play the swf.  The pop ups shouldn't have scroll bars, only a title and the button to close the window.
    To view the template files, you can download them at:
    http://truetilldeathhq.com/main8_v7/main8_v7.fla
    The "descripton" movie clips have the descriptions and the "Detailed View" links in the frames, and the movie clips I not so gracefully butchered to get the pop up to work were TM_page_content_scroll (where you're supposed to put an image in a certain frame and then put the # of that frame in the Actionscript of the "Detailed View" button), and the TM_main_cont_page2 and TM_pop_up_main3, which were the ones I duplicated.
    If ANYONE can offer even the slightest bit of help, I gratefully appreciate it.  I've been working on this thing for like 15 hours a day and I can't even think straight at this point, thanks!

    I admit to not having read everything you wrote... there's just too much of it. But...
    Hashtable (and HashMap, which you should really be using unless you have some external constraint requiring the use of Hashtable) map each key to a single value object.
    That is, you can map from the key string "4996" to one single other object. And then you can also map from a different key to a different object.
    In you put() method, you add a mapping from "4996" to "good", and then you replace that mapping with one from "4996" to "home". There is only ever one value associated with a given key.
    To map multiple values to a single key, you need the value object to be a collection of some kind (or an array). So, you could map your string "4996" to a List, and that list could contain the strings "good", "home", etc.

  • Need help integrating flash with asp

    i am creating a dynamic site that pulls all of its content
    from and access database. i would like to make the entire page in
    flash. i have never used flash to pull any content from a datbase
    before. does any one know how to do this ? or know of a good
    tutorial? i can only seem to find tutorials for flash 8 or flash 5,
    nothing for mx2004.
    it seems like every thing i try doesnt work and no one knows
    how to help me.
    feeling very discouraged,
    -furley

    Flash has nothing to do with getting data from an Access
    database.
    You need to focus on either ASP or ASP.Net, a scripting
    language for the
    server script either JScript or VBScript, middleware usually
    ADO or ADO.Net
    and finally SQL. All of these items go together in a server
    side script that
    could work with non-Flash or Flash client interfaces. You
    should find many
    tutorials on the internet with these items as it has been
    done for nearly a
    decade.
    You also can use ColdFusion.
    For Flash, you need to learn LoadVars Actionscript class if
    you plan to
    communicate data in the URL Variables format or XML
    Actionscript class if
    you want to use XML data format. It will not really matter to
    Flash what is
    on the server side as it will only be sending and receiving
    data in either
    of those two data formats (URL Variables or XML).
    If you want to look at some Using VBScript, ASP, ADO and an
    OLEDB Connection
    examples I use for seminars in Web database you can take a
    look here:
    http://www.hosfordusa.com/ClickSystems/courses/webdb/.
    However they lack
    Flash example but would work "as is" with a Flash example.
    Once you look at some of those options, you can then form
    more specific
    questions for this forum and especially with using the
    LoadVars and XML
    Actionscript classes or the XML connector Flash component.
    Lon Hosford
    www.lonhosford.com
    Flash, Actionscript and Flash Media Server examples:
    http://flashexamples.hosfordusa.com
    May many happy bits flow your way!
    "professorfurley" <[email protected]> wrote
    in message
    news:[email protected]...
    i am creating a dynamic site that pulls all of its content
    from and access
    database. i would like to make the entire page in flash. i
    have never used
    flash to pull any content from a datbase before. does any one
    know how to do
    this ? or know of a good tutorial? i can only seem to find
    tutorials for
    flash
    8 or flash 5, nothing for mx2004.
    it seems like every thing i try doesnt work and no one knows
    how to help
    me.
    feeling very discouraged,
    -furley

  • Need help for filterFunction with special char

    Hi,
    I'm doing a simple search/filter process to a dataGrid collection upon text inputs with filterFunction. What I'm facing problem is, in one of my column field (on which I'm filtering) has dot "." as a suffix and it doesn't includes in the search process.
    Say I've a few values like - i_24., i_245., i_256.
    Now with the present filterfunction when an user inputs i_24. it shows the other record as well - i_245., where the expected entry should only be i_24. (since i_245. is not i_24.5)
    But it seems the search function is not taking the dot "." as a character in the search process, or at least when it is stays as suffix.
    I thouht maybe some RegExp could overcome the problem, but I'm not good in that either.
    Please, help.
    Thank you.
    Regards,
    Santanu

    aSuitableBoy,
    Use the String's "indexOf" method.  (http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/String.html#indexOf()).
    The syntax would be: "String(<YOUR_COLLECTION>.<FIELD_TO_FILTER_ON>).indexOf(<COMPARE_STRING_FROM_TEXT_INPUT>)
    Here's a really small code snippet that I just wrote up, that works:
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="cc();">
              <mx:Script>
                        <![CDATA[
                             import mx.controls.Alert;
                             import mx.collections.ArrayCollection;
                             [Bindable] private var ac:ArrayCollection = new ArrayCollection();
                        private function cc():void
                                       var o:Object = new Object();
                                       o.field1 = "Value 1:";
                                       o.field2 = "i_24.";
                                       o.field3 = "Some other value...";
                                       ac.addItem(o);
                                       o = new Object();
                                       o.field1 = "Value 2:";
                                      o.field2 = "i_245.";
                                       o.field3 = "Some other value...";
                                       ac.addItem(o);
                                       o = new Object();
                                      o.field1 = "Value 3:";
                                       o.field2 = "i_256.";
                                       o.field3 = "Some other value...";
                                       ac.addItem(o);
                        private function filterFunc(o:Object):Boolean
                                       return String(o.field2).indexOf("i_24.") != -1;
                        ]]>
              </mx:Script>
              <mx:HBox width="100%" height="100%">
                             <mx:DataGrid id="dg" height="100%" width="100%" dataProvider="{ac}">
                                            <mx:columns>
                                                           <mx:DataGridColumn headerText="Column 1" dataField="field1" />
                                                           <mx:DataGridColumn headerText="Column 2" dataField="field2" />
                                                           <mx:DataGridColumn headerText="Column 3" dataField="field3" />
                                            </mx:columns>
                             </mx:DataGrid>
                             <mx:Button id="b1" label="Filter" click="{ac.filterFunction = filterFunc; ac.refresh();}" />
              </mx:HBox>
    </mx:Application>

Maybe you are looking for

  • 320N Freezes when trying to transfer data over wifi

    I have the 320N and I am very frusterated.  I would just take it back, but I bought it brand new on Amazon.com, meaning I will have to pay shipping because I threw out the box and the return shipping form for RMA's!  I don't even know if Amazon will

  • OWA 2010 send/reply window does not close on IE10/11

    Hi, We've been experiencing issues with OWA on Exchange 2010 for several of our users after rolling out Internet Explorer 11, and this was also an issue with IE10. The issue occurs when a user tries to reply (does not happen when sending out a new ma

  • To call a bean function to set a property value with hx:ajaxRefreshRequest

    I have an input box I need to output some text onto an output box,When the input box value changes I am using Ibm jsf implementation and RSA 7.0,JSF 1.1 implementation I know how to call a bean property's setter method using this hx:refresh submit an

  • Streaming video via Itunes to ATV2

    Just got my ATV2 and it's all working great. Ther's only one thing that I can't seem to figure out how to do. I manage to play video when I select them on the ATV, but I can't seem to be able to start playing a video on itunes on my computer and then

  • Need 2 disable "Checking the Status of the Embedded Security Chip"

    This takes ages. Tried going into the BIOS and setting Client Security to both Disabled and Inactive. I also disabled cssauth in my startup and that didn't work either. Solved! Go to Solution.