How to create an grid of buttons.

Im trying to create a grid of buttons but for some reason i can see only 2 of them at the same time, but i know they are 9 on stage cause i trace numChildren
Currently i have this:
public class Main extends MovieClip
                    private var myBtn:SimpleButton = new SimpleButton();
                    private var img1:Bitmap=new Bitmap(new active_MouseOut());
                    private var img2:Bitmap=new Bitmap(new active_MouseOver());
                    private var img3:Bitmap=new Bitmap(new notActive_MouseOut());
                    private var img4:Bitmap=new Bitmap(new notActive_MouseOver());
                    private var myArrayContainer:Array = new Array();
                    public function Main()
                              for (var i :int = 0; i < 3; i++)
                                        for (var j:int = 0; j < 3; j++)
                                                  myArrayContainer[j] = new MyButton(img1, img2, img3, img4)
                                                  myArrayContainer[j].x = 0 + i * (myArrayContainer[j].width + 10)
                                                  myArrayContainer[j].y = 0 + j * (myArrayContainer[j].height + 10)
                                                  this.addChild(myArrayContainer[j])
                              trace(numChildren)
active_MouseOut, active_MouseOver, notActive_MouseOut and notActive_MouseOver are simple bitmap Images that have AS linkage
And MyButton class is this
package
          import flash.display.Bitmap;
          import flash.display.MovieClip;
          import flash.display.SimpleButton;
          import flash.events.MouseEvent;
          import flash.utils.getDefinitionByName;
          public class MyButton extends MovieClip
                    private var myBtn:SimpleButton = new SimpleButton();
                    private var image1:Bitmap
                    private var image2:Bitmap
                    private var image3:Bitmap
                    private var image4:Bitmap
                    public function MyButton(active_OutState:Bitmap, active_OverState:Bitmap, notActive_OutState:Bitmap, notActive_OverState:Bitmap)
                              image1 = active_OutState;
                              image2 = active_OverState;
                              image3 = notActive_OutState;
                              image4 = notActive_OverState
                              myBtn.upState = image1;
                              myBtn.overState = image2;
                              myBtn.downState = myBtn.upState;
                              myBtn.hitTestState = myBtn.overState;
                              addChild( myBtn );
                              myBtn.addEventListener(MouseEvent.CLICK, onClick);
                    private function onClick( ev:MouseEvent ):void
                              myBtn.upState = image3;
                              myBtn.overState = image4;
I also want to ask : Can I get the bitmapData to load in the MyButton class with this
private var image1:Bitmap
public function MyButton(mouseState:String)
                               image1_Data = Class(getDefinitionByName( mouseState ));
                              image1 = new Bitmap( image1_Data() )
and in the Main Class to send the name of the image in the library
myArrayContainer[j] = new MyButton( "notActive_MouseOver" )
or I can do this only in/from the Document Class
cause Im trying and it is giving me this
Error #1065: Variable notActive_MouseOver() is not defined.

well Im doing the button-making in the MyButton class cause im trying to create 9 buttons(and every button has a different image and that image has 4 states(clickable-Up, clickable-Over, notClickable-Up, notClickable-Over  )).
And this is the only way i figured out how to do it without writing alot of code ()

Similar Messages

  • How to create a grid

    Hi Friends,
    How to create a Grid, not a form or table.
    I want a grid to hold about 10 fields.
    so :-
    f1 v1 f2 v2
    f1 v1 f2 v2
    f--fields
    v--values
    I can get it using simple form ,but it doesnot look like a grid.
    I need the look and feel of a grid.
    Thanks!

    Hi Naveen,
    Check http://searchsap.techtarget.com/searchSAP/downloads/SAPPRESS.pdf Section "7.6 Layout managers"
    It will give you the most exhaustive description of how to build a grid in WD.
    Best tregards, Maksim Rashchynski.

  • How to create exchange grid in web entry form...

    Hi to all,
    I am new to HFM..my query is How to create exchange grid in web entry form...i try it a lot but it didn't get the solution...
    i did this exchange grid in web grid..any one can share the document or ppt or video clip related to this..which will be helpful for me...
    Thanks

    Hi...
    Its better to create the Exchange Rates in a Data Form than in an Data Grid, so that you can easily Import and Export the form and even can feed the values easily....
    Select the POV like in Scenario-Actual,Year-Your particular year,Period-In Period Dimension do not choose any option so that it can be selected in Columns and Rows,View--the same as Period Dimension,Entity-[None],Value-<Entity Currency>,Account-Do Not select ,ICP- [ICP None],Custom 1-[None], Custom 2-[None], Custom 3-[None], Custom 4-[None]...
    In Columns Select Scenario -Actual,Period-{[Fourth Generation]},Currency-#USD(Default Currency)
    In Rows Select-Account-A#AVGRATE,View-w#Periodic,Currency-C2#EUR
    A#AVGRATE.w#Periodic.C2#CFA and so on for rest of the currencies....
    and same in the below rows for the Closing Rates---- A#CLORATE.w#Periodic.C2#EUR
    A#CLORATE.w#Periodic.C2#CFA
    This might help you.....

  • How to create a new push button in application tool bar in GMGRANT thru BDT

    Dear SAP Gurus -
    We have a requirement in 'GMGRANT' transaction. We need to create a button in the application tool bar of 'GMGRANT' transaction. Once the button is activated, if the user clicks on the button then it will go to a new screen (external screen). User can input data in to the external sceeen and upon saving, the data will be stored in to a custom table and when user clicks on 'back ' button user should come back to the GMGRANT transaction.
    Just wanted to know, how to create / activate a new button on application tool bar of GMGRANT transaction and what are the configuration and detail steps to achieve the same through BDT.
    We went through a lot of documents on BDT but do not have a proper solution.
    Could you please help.
    Thanks in advance.
    Regards,
    Atul Mohanty

    hi,
    You can find user-exits (menu exits) to add new menu item.
    But, there is no possibility to add new buttons on application tool bar.
    Regards,
    Sailaja.

  • How to create dropdown box, radio button,check box in wad

    Hi,
    How to create dropdown box, radio button,check box in wad.
    Thanks,
    cheta.

    Cheta,
    This are all standard Web Items in the WAD. Drag them onto your template and then make the changes you need to them in their Properties.
    Regards
    Gill

  • How i create popup menu when button onclick

    how i create popup menu when button onclick

    You try adding a scrip tag in your jsp code, and calling the function in the onclick attribute.
    Example:
    <script><![CDATA[
                    function confirmDelete(){
                    if(confirm("Are you sure you want to delete selected user")){
                    return true;
                    } else{
    return false;
    ]]></script>
    <ui:button action="#{View.delete_action}" binding="#{View.delete}" id="delete" onclick="confirmDelete"/>
    Cheers
    Daniel
    null

  • How to create an On/Off button??

    I have tried now for a while (and searched the forum) to create an on/off button. I want to create a button in the library that I can drag onto the canvas in multiple instances (located in a grid for example) and the button should change appearance when clicked, AND also change back to the original appearance when it is clicked once more. How can I do this??

    I should add: the other buttons in the grid should not change when one of them is clicked...

  • How to create subpicture for a button?

    Hello!
    I have really tried to find the answer to this rather silly problem on my own, but without result. Please help someone!
    The situation:
    I have a menu with three choices: "Play Movie", "Scene Selection" and "Subtitles". Now, the text presenting these choices are part of the background image, created in Premiere (the program I know best). They are written with an old typewriter to get that gritty feeling.
    I want the user to scroll between these "menu items". The currently selected item should be indicated by a black circle/spot/dot before the text of the item. By default, when the menu appears, there is a black circle in front of (to the immediate left of) the item "Play Movie". The user should now be able to step with his/her remote to the other items, thereby making the black circle in front of "Play Movie" disappear and appearing instead before some of the other items. In short: the black circle is always showing before the currently selected item. OK, I got a bit verbose there, but the idea got across hopefully. One more thing: the background color is 100% white.
    Up to this point, my solution was this: I placed black circles (small images with gradation and all, very nice looking) in front of ALL THREE ITEMS. Then I convert these into buttons. Then I choose the color set for the menu so that the unselected state is 100% white, plain and simple, with 100% opacity, thereby covering the black circles that should not show. Only in the selected and activated states does opacity for the button subpicture drop to 0%, thereby revealing the black circle that should be seen.
    The problem? Well, on some DVD-players (not on the XBOX 360 though), when an item is activated, all three circles show for a brief moment before the selected action starts (for example playing the movie). It also happens in Encore Preview. This is not logical at all and looks amateurish. I don't know why it happens, but my guess is that it wouldn't if I did this the "correct" way: by creating subpictures fo the buttons in the shape of circles. I understand the nice looking gradations must go out the window but that is a price I'm willing to pay.
    But now I run into an unexpected problem: I don't understand how to create a subpicture for the button that is a black circle. It seems the documentation in Encore and on forums in general takes for granted that you know how to do this.
    What I tried ws this: I created a monochrome, small image in bmp format - a black circle on white background. But this image just shows up as a black rectangle in Encore.
    What should I do? I should add that I have no real experience with Photoshop, so go slow if you go there.
    Regards,
    Nikolaj

    Basically, when one realizes the limitations of the Sub-picture Highlights, as set by the DVD-specs., it's easy to see the "workaround."
    A couple of the aspects of Sub-picture Highlights are:
    1.) 2-bit color (either ON, or OFF), from a limited color palette, with degrees of Transparency (the opposite of PS's Opacity).
    2.) they will appear on top of anything else on the Menu, including things like Button text/graphics.
    By constructing your Sub-picture Highlight in PS, you can use Masking to define where it will be, and where it will not be. In the case that prompted my article, the poster had a series of Text Buttons, and the Sub-picture Highlights were formed from that Text. The poster did not like the look of those 2-bit jagged blocks of color overlying the Text in the Button. The workaround is to "punch a hole" in the Sub-picture Highlight, so that it is hollow, where the Button's Text appears. This is done in PS, by using the "outline" of that Text to create a Mask for the Sub-picture Highlight. The jagged aspect can be adjusted a bit, by using a degree of Transparency (set in the non-Auto Color Set back in Encore). We still have a 2-bit color Sub-picture Highlight, and it still overlays the Button's Text, but now there is a hole in it, right where the Button's Text is located, and it is seen through that hole. The introduction of Transparency has the visual effect of "softening" the look of the 2-bit color, even though the jagged edges are still there - they just look softer. I went on to show how one could even use a second Sub-picture Highlight, that is just a bit larger than the first, and with more Transparency to simulate a "glow." Now, we cannot have a real "glow," because we are limited to that 2-bit color for the Sub-picture Highlight, but we can simulate it.
    Much of what a designer does is really slight of hand - illusion. They all have to work within the limitations of the DVD (or BD) specs., but with a bit of creativity, planning and some work in PS and Encore, they can create enough smoke and use enough mirrors to fool the user into believing that what they think they see skirt the DVD-specs. They do not, but that's where the illusion comes in.
    We get a lot of questions from people, who claim that one commercial DVD, or another, has full-color Sub-picture Highlights and they complain that Encore cannot do that - only 2-bit Sub-picture Highlights. What they are seeing, but do not realize it, is a dupe Menu, with a full-color graphic, and no real Sub-picture Highlight visible. Jeff gives full details on doing this. Same for those who have seen a Button with a duo-tone thumbnail, that turns full-color, when the Button is navigated to. Wow, how did they do that, and why can't Adobe Encore do that? Well, what they saw was a dupe Menu, with a full-color thumbnail and no visible real Sub-picture Highlight.
    Jeff shows how to create what appears to be at least a 3-color Sub-picture Highlight. It's really just 3 regular 2-bit color Sub-picture Highlights, with Masking to create the illusion that he beat the DVD-specs. Neat! [Being from the USA, I also liked that he used the US flag, but he could have chosen the French "Tri-color," or any other flag, without artwork.]
    These are all just tricks, but if the user buys into the illusion, who's to know?
    Enjoy,
    Hunt
    PS - though many of the great, older posts were lost, when the forum changeover happened, I strongly suggest reading the posts here. You can bypass ones that do not offer you anything, but almost every possible illusion has been discussed at least one time, and likely many, with some different workflows offered by those, who replied. Great reading.

  • How to create a 3-state button (similar look as OK button) that toggles between 3 different colors.

    How do I create a 3-state button that looks similar to the OK button except it changes to 3 different colors every time it is pressed. Does anyone have such a control ready for use that I can just drop in my front panel?

    With a picture ring you can implement a 3 color button without any code. Look at the attached customized control.
    I have imported the picture of a boolean in three different items and
    colored them. I centered the text and hide/made transparent uneeded
    graphic elements. I set the size of the decrement arrow to cover all
    the picture and made it transparent so when you click on the control
    you decrement the value of the ring and change the picture/color
    Edit: you'll notice that the picture is not fullt covered by the
    decrement arrow so if you click near the bottom of the button, the
    picture ring will show its normal behavior displaying all 3 available
    items
    Message Edité par Jean-Pierre Drolet le 07-07-2005 10:07 PM
    LabVIEW, C'est LabVIEW
    Attachments:
    3COLORSBUTTON.vi ‏8 KB

  • How to create an "exit widget" button on iAd producer.

    I am creating a widget for a children's book and would like to create a simple "exit button" (an X the reader can touch to close the widget). Thus far I have created the object, but i can't seem to find an an 'action' to associate with the "activated" event that will close the widget and return to the iBook. I realise that a widget can alternatively be closed with a two-finger gesture, but for simplicity in view of my target audience prefer to have the "exit button". Note: I am relatively new to iBooks Author, and totally new to iAd producer. Unfortunately I don't know how to script in Java or HTML yet, but am willing to learn. Can anyone please give me some pointers?

    Thanks! The button didn't appear in the preview in iAd producer, so I didn't realize it was there. But I tried my widget in iBooks Author and the button is there. Thanks again!

  • Step how to create a duplicate record button in APEX

    HI,
    Where do i find out the document step by step with the code behind on how to create a button to copy a record with master and detail in APEX.  My email address is [email protected]  Thanks.
    Thu Tran

    If you are using ADF BC you can also try this
    http://adftips.blogspot.com/2010/10/adf-model-creating-duplicate-row.html
    Regards
    Nicolas

  • How to create web 2.0 buttons in CS4?

    Hi, i can't create web 2.0 buttons in CS4,all my buttons are very ugly... I'm trying for two days, but can't draw the beautiful button.
    How??
    Thank you!

    I recently wrote a tutorial on web 2.0 style buttons. It's not the best tutorial I've ever written, but it might get you started:
    http://joedasilva.com/easy-glossy-buttons-with-fireworks

  • How to create an open/close button

    Hello All
    I am endeavouring to create a button in InDesign that when it is tapped an image opens, and when it is tapped again the image closes, does anyone have any ideas how to achieve this please?
    Kind Regards
    Barb

    Create hot spot buttons. See this article: Hot Spot Button Workaround for InDesign Dig Pubs
    If you want to create a simple toggle button, create a button that points to an MSO (multi-state object) in which the first state is blank and the second state is the image. When you create the button, use the "Go To Next State" action.
    To create more advanced buttons, download the free DPS Tips app and look at Advanced Overlays > Hot Spot Toggle Button. Web viewer version is here: DPS Tips Advanced Overlays: Hot Spot Toggle Button

  • Help!!! How to create simple menu with buttons.

    I basically need help on how to create a menu with Up, Left, Next and Back buttons.
    Then it must have a submenus like Telephone, Lights, Fans and Television.
    and more sub sub menus of On and Off buttons.
    Ive jut started to learn Labview and a newbie at it.
    It could be really nice if someone could make an example.
    Would appreciate it if it could work like Ipod interface.
    Thanksssss! Pls help!

    Duplicate post.

  • How to create a grid like the sample of "profit Centre - Report" use sdk ?

    hi
    in the grid of "profit Centre - Report", it has a button,if you click it ,it can show the detaildata. it can implement many levels "Expand " and "Collaspe",but it's not implemented by group! i want to know how to implement it by ui dpi or udo .
    thanks!

    Hi,
    You need:
    - to know the relevant queries
    - to make copies (use GetAsXML) from the relevant system forms to mimick the standard functionality
    - to do it via UI API (use Grid and DataTable - then you don't need DI API at all)
    Here's some more information on DataTable / Grid:
    The UI sample no. 19 shows you how to load data into the Grid - via the DataTable...
    You can find an enhanced version of the sample (showing you how to get linked buttons, combo boxes etc) in the Education area on SAP Service Marketplace (SMP): http://service.sap.com/smb/education
    Or just try these links (need SMP user account for that...) to download the sample from the Archive of "Live Expert Sessions" (includes a few more things):
    http://service.sap.com/~sapidb/011000358700006282762006E.zip
    That's the link to the PDF for the session:
    http://service.sap.com/~sapidb/011000358700006282742006E.pdf
    ...and that's the recording:
    http://service.sap.com/~sapidb/011000358700006280182006E.wrf
    HTH,
    Frank

Maybe you are looking for

  • Help connecting macbook to monitor

    I am about to pick up a new 24" LCD display, but I can't decide between an HP with 2 DVI inputs, or the Dell with rave reviews. The monitor will be hooked up to my desktop G5, and to laptop when it's stationed. Will having the macbook hooked up via D

  • How do i make firefox my home page

    When I open firefox I get the support page. How do I get it to return to the search page. Sorry I'm sort of a novice. Thanks for your help!

  • Transfer opening balance for GL accounts and AR, AP accounts

    Dear all, How could I transfer opening balance for all GL. AR, AP accounts before system go libe ? Thank you very much, Kindly regards, Sylvecast.

  • SQL Server TG Query Optimization

    We are using Oracle Transparent Gateway 9.0.1.1.1 to connect an Oracle (Windows 2000) 9.1.7.4.0 database to a SQl Server 2000 SP2 database. When we use two simple queries to retrieve information from the gateway, the data is returned with a response

  • Macmini crashes while playing video

    My Mac Mini has crashes a few times and it only crashes while playing streaming video.  Any ideas of what is wrong? Thanks Crash Report from Console: 3/31/13 7:19:28.893 PM Firewall: Office365Service is listening from 127.0.0.1:1538 proto=6 3/31/13 7