How do I convert a shape to a button programmatically in actionscript 3?

Hello,
    I am passed all the information I need to draw a shape in FlashVars. After I draw the shape, how can I convert this shape to a button using actionscript? Thanks in advance for your help.
Regards,
Nilang

u can directly draw in  a Sprite or add the Shpe as child of a Sprite,like this
var shape:Shape= new Shape();
shape.graphics.beginFill(0xff3345);
shape.graphics.drawRect(0,0,100,30);
var btn:Sprite=new Sprite();
btn.buttonMode=true;
btn.addChild(shape)
addChild(btn)

Similar Messages

  • How to add convert traditional chinese / simplied chinese button?

    After installing Microsoft Office 2010 Proofing Tools Kit Service Pack 1 (SP1), the button of Traditional Chinese to Simplied Chinese
    or vice versa still cannot be seen in the "Review" of Word.  How can I install it?

    Hi,
    As per below thread, looks like you might need to install both Simplified and Traditional language pack to enable that feature in Office 2010:
    http://social.technet.microsoft.com/Forums/en-US/82bbb91f-2ead-4efd-92d9-eb0fe2d3838d/how-to-convert-traditional-chinese-to-simplified-chinese-with-excel-2010-?forum=officesetupdeployprevious
    Buy and download language pack for Office 2010:
    http://www.microsoftstore.com/store/msusa/en_US/pdp/productID.253665800?cdid=en-us
    Thanks,

  • How is width measured for shapes and strokes converted?

    How is width and height calculated in the transform panel for an object? Does it use an average? An example can be seen in the first image. The lines are not a uniformed width.
    Also, how are strokes converted from pts to pxls? For instance, if I make a stroke that is 2.3 pt, when I expand the object the width in the transform panel will say 2.3px ; however, I thought the point to pixel conversion (even for a 72 dpi screen resolution) was different. An example can be seen in the last two images, where a line was made with a specified stroke width and then expanded.

    Hmm, I'm a bit confused. If I have a 1 pt stroke and Preview Bounds is unchecked in preferences, I recieve a width of 2.56px as seen in Figure 1. With preview checked I get the width of the bounding box at 3.56 px. However, I still put down a 1 pt stroke. Also when I change the angle of that stroke the widths change as seen in Figure 3 (same thing when expanded or Preview Bounds is checked or unchecked.)
    I'm really looking at trying to find the width of an object (such as the engraved lines below) and the width of distance between each; however, if I measure from point to point the angle should not matter, which is not the case as seen in Figure 3. Also, the width changes between various points of the jagged lines. Is an average used which is then displayed in the Transform or info panel?
    Thanks!
    FIGURE 1
    FIGURE 2
    FIGURE 3

  • How do I turn a shape layer into a mask in After Effects?

    How do I turn a shape layer into a mask in After Effects?

    I should also mention that if you create the shape with any of the shape tools (rectangle, Polly star, eclipse) instead of the pen tool you will have to convert the shape to a bezier path before you can copy the path and paste it to a mask. Easy to do if you have the recent version of AE, not so easy if you're using an older version.
    when you have trouble figuring things out simply type something like track matte in the Search After Effects help field at the top right corner of the AE application frame. You will get these resources: http://www.adobe.com/cfusion/search/index.cfm?cat=support&term=Track%20matte&loc=en_US&sel f=1&lr=en_US&site=aftereffects…

  • How do I convert stroke from pt to px?

    In my preferences, my font and rulers are set to px, but when I use my shape/pen tools, all of my strokes are set in pt. How do I convert stroke pt to px?

    When you type in "px" and press enter, that unit stays through Tool switching and Photoshop close/open, at least for Photoshop CC.

  • I need to convert PDF file to Word Document, so it can be edited. But the recognizing text options do not have the language that I need. How I can convert the file in the desired of me language?

    I need to convert PDF file to Word Document, so it can be edited. But the recognizing text options do not have the language that I need. How I can convert the file in the desired of me language?

    The application Acrobat provides no language translation capability.
    If you localize the language for OS, MS Office applications, Acrobat, etc to the desired language try again.
    Alternative: transfer a copy of content into a web based translation service (Bing or Google provides a free service).
    Transfer the output into a word processing program that is localized to the appropriate language.
    Do cleanup.
    Be well...

  • How can I convert an int to a string?

    Hi
    How can I convert an int to a string?
    /ad87geao

    Here is some the code:
    public class GUI
        extends Applet {
      public GUI() { 
        lastValue = 5;
        String temp = Integer.toString(lastValue);
        System.out.println(temp);
        showText(temp);
      private void showText(final String text) {
        SwingUtilities.invokeLater(new Runnable() {
          public void run() {
            tArea2.setText(text + "\n");
    }

  • How can I convert an InputStream to a FileInputStream ???

    How can I convert an InputStream to a FileInputStream ???

    Thanks for you reply, however, I am still stuck.
    I am trying to convert my application (which runs smoothly) to a signed applet. The following is the original (application) code:
    private void loadConfig() {
    String fileName = "resources/groupconfig";
    File name = new File(fileName);
    if(name.isFile()) {
    try {
         ObjectInputStream in = new ObjectInputStream(new FileInputStream(fileName));
         pAndGConfig = (PAGroupsConfig)in.readObject();
         in.close();
         return;
    } catch(ClassNotFoundException e) {
         System.err.println("++ERROR: "+e);
    } catch(IOException e) {
         System.err.println("++ERROR: "+e);
    System.out.println("Can't find file: " + fileName);
    Because all code and resources now reside in a Jar file (for the signed applet), I must use the following line to access the resources:
    InputStream is = this.getClass().getResourceAsStream(fileName);
    I then need to convert the 'InputStream' to 'ObjectInputStream' or 'FileInputStream' so that I can work with it.
    I would be very grateful if you could help shed some light on the matter - Cobram

  • How can I convert an audio file (speech) into a text?

    Hello everybody!
      Can someone explain how I can convert a garageband file (voice speech) into a text? My Mac is a Mac OS X 10.5.8 version, so I don't have programs such as mountain Lion. I thought to use googlevoice. Is this option available? If yes, how can I use it?
    Thanks.

    Hello, I only find google voice available for Abdroid!?
    http://www.ehow.com/info_10033225_google-voice-system-requirements-android.html
    Some possibilitities, not sure if they have 10.5.8 compatble versions anymore...
    http://atmac.org/speech-to-text-dictation-software-for-os-x
    Some reviews of later Dragon Speak...
    http://www.finetunedmac.com/forums/ubbthreads.php?ubb=showflat&Number=22962

  • How do I convert my existing iTunes account to a .mac account?

    I am trying to convert my existing iTunes account which uses an Earthlink address. The following is the INSTRUCTIONS from the Apple web site on how to do this.
    "I just signed up for .Mac. How do I convert my existing iTunes account to
    my new .Mac account?
    We'll be happy to convert your account for you. Please provide your old account name, your new .Mac account name and your billing address in your email. We will also need your explicit permission to reset your password to complete the conversion."
    This is the URL where I found those INSTRUCTIONS:
    http://www.apple.com/support/itunes/musicstore/email/
    I FOLLOWED THE INSTRUCTIONS ABOVE!
    I am now on my fifth exchange of emails with iTunes support.
    HAS ANYBODY SUCCESSFULLY EXECUTED THESE INSTRUCTIONS? I don't want to lose the ability to play my existing purchased music, but I want to close down Earthlink as my ISP.
    17" G4 Powerbook   Mac OS X (10.4.6)  
    17" G4 Powerbook   Mac OS X (10.4.6)  

    On any page in the iTunes Store, click the flag icon at the lower right.  This brings up a page saying "Choose your country or region."  Click Canada.
    Before you can buy anything, you will need to enter your Canadian credit card.

  • How can I convert an OVM vm (.img) to VDI (virtualbox)?

    Hi,
    how can I convert an OVM vm (.img) to VDI (virtualbox)?
    Is .img format a raw image? If yes can I use "VBoxManage convertdd" to convert from .img to vdi?
    tnx & regards,
    S.

    Hi,
    "VBoxManage convertdd" solved.
    Regards,
    S.

  • How can I convert an AUDIO MPEG-4 to an MPEG3 format? I need it for a Powerpoint Presentation

    How can I convert an AUDIO  MPEG-4 to another type of file, such as MPEG3  or mp3

    Use Handbrake.
    You can download it for free from this site:
    http://www.macupdate.com/info.php/id/12987/handbrake
    Good luck

  • How do I convert a pdf in Adobe Acrobat 9 to Microsoft Word document?

    How do I convert a pdf in Acrobat 9 to a Microsoft Word document?

    Hi fireatty,
    In Acrobat 9, you can use the Export command (File > Export) to export your PDF to Word format.
    Please let us know if you need additional assistance.
    Best,
    Sara

  • I changed from i iphone 5 back to a iphone 4.. now my itunes does not recognise that i have a iphone 4! how do i convert my last back up (on iphone 5) to my new iphone 4?

    i changed from i iphone 5 back to a iphone 4.. now my itunes does not recognise that i have a iphone 4! how do i convert my last back up (on iphone 5) to my new iphone 4?

    In your case you can only restore from a backup that has been created with the same iOS version. An iPhone 4 can only run 7.1.2, and, unless your iPhone 5 did not run the same version, you can't use a newer iOS backup of the 5 on the iPhone 4

  • How do I convert my Voice Memo from iPhone 5s to a text file?

    How do I convert my Voice Memo from iPhone 5s to a text file?

    If you have Evernote, you could try quicktate.   http://www.quicktate.com
    I convert voice memos on my Mac using the Dictation feature:
    Open TextEdit on a new document
    Enable  Dictation & Speech enabled the System Preferences.
    Press the fn-key twice
    Play the voice memo on the iPhone and let the  Mac listen to it using the internal microphone with TextEdit open on a new document.
    Press the fn-key twice, to finish Dictation.  You will only see the transcribed text, when Dictation has finished.

Maybe you are looking for