Trying to get an Action Script 3.0 class to work

Ask a Question related to Macromedia Flex General Discussion, Design and Development.

  1. #1

    Default Trying to get an Action Script 3.0 class to work

    I have been trying to get this example that comes with the flash CS3
    documentation to work. In step 1, when it says to add the List and Button
    components to the library, does that mean to open 'components' and drop a List
    control and a Button control to the library. If so, do I need to do anything
    with these controls after I do this? Also, when it says to create an Icon
    symbol and name it 'myIcon'. Does this mean that I drop a square onto the
    canvas in the .fla file and then convert it to a symbol. Do I name the new
    symbol 'myIcon' or do I name the instance, which is in the property inspector
    to 'myIcon'. Sammy


    To run the example, follow these steps:

    Add the List and Button components to the library.
    Create an icon symbol and name it MyIcon.
    In the symbol properties for MyIcon, toggle the option "Export for
    ActionScript".
    Save this code as LabelButtonExample.as in the same directory as your FLA
    file.
    Set the Document class in the FLA file to LabelButtonExample.


    package
    {
    import flash.display.Sprite;
    import flash.events.Event;
    import fl.data.DataProvider;
    import fl.controls.List;
    import fl.controls.ComboBox;
    import fl.core.UIComponent;
    import fl.events.ListEvent;

    public class LabelButtonExample extends Sprite
    {
    public function LabelButtonExample() {
    var myIcon:IconWithToolTip = new IconWithToolTip();
    myIcon.setStyle("icon", MyIcon);
    myIcon.iconDescription = "Icon Description";
    myIcon.move(50,50);
    addChild(myIcon);
    }
    }
    }

    sammy545 Guest

  2. Similar Questions and Discussions

    1. CF Grid / Java Script / Action Script
      Hi, Does anyone know of a good reference for the attributes CFgrid exposes in a flash form? eg. I would like to select the first row on load. ...
    2. Another M$ Class Action Suit Settled
      Microsoft Corp. A $31.5 million settlement has been granted preliminary approval in the class action lawsuit filed on behalf of consumers and...
    3. is freehand a class action waiting to happen?
      I wonder if there are as many ship-jumpers on the Adobe forums as there always seem to be on Macromedia's? I manage to get around in Freehand 10...
    4. Class Action Lawsuit against Macromedia?
      sometimes, I wish.... How many Flash developers have imagined suing Macromedia for countless hours of wasted time due to bugs and inadequate...
    5. Action Script Class text box
      I was doing a tutorial in flash Pro mx 2004 but i was unable to find the Action Script Class text box... does any one knows where is it??? The...
  3. #2

    Default Re: Trying to get an Action Script 3.0 class to work

    I don't know anything about FLA.

    what are trying to achieve in Flex? An icon with a tool tip? Have you looked into Image class and it's toolTip property?
    atta707 Guest

  4. #3

    Default Re: Trying to get an Action Script 3.0 class to work

    I would like to be able to create pure action script class files to be used in
    Flex 3. The problem I've
    been having is getting even documented sample code (classes), such as the one
    above, to run properly
    in both, flex and flash. I would prefer running classes such as the one
    listed strictly in flex,
    but figured that for learning purposes it would be easier to use flash. I am
    unsure if I would be better off
    testing all of my action script classes through flex. I am hoping that once I
    get these sample code (classes)
    to display properly, I can start dissecting them, in order to fully understand
    how they work. I'll also look into
    the image class and the tool tip property to see if I can find any addtional
    information. Sammy

    sammy545 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139