Center label instance inside VGroup in Flex

Hi all I am trying to center my labels below my image inside my VGroup.
The labels are align to left now and it seems like HorizontalAlign is not working on spark component.
Anyone knows how to fix it? Thanks a lot.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <s:VGroup width="800">
        <mx:Image source="images/big/city1.jpg"/>
        <s:Label text="test1" horizontalCenter="0" /> //doesn't work....:(
        <s:Label text="test2" />
    </s:VGroup>
</s:Application>

horizontalAlign="center"
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"               
               xmlns:s="library://ns.adobe.com/flex/spark"               
               xmlns:mx="library://ns.adobe.com/flex/mx"
               minWidth="955" minHeight="600">   
  <fx:Declarations>       
  <!-- Place non-visual elements (e.g., services, value objects) here -->   
  </fx:Declarations>   
  <s:VGroup horizontalAlign="center" width="100%">       
    <s:Label text="test1"/>
    <s:Label text="test2" />   
  </s:VGroup>
</s:Application>
If this post answers your question or helps, please mark it as such.
Greg Lafrance - Flex 2 and 3 ACE certified
www.ChikaraDev.com
Flex Training and Support Services

Similar Messages

  • How do I center an image inside a CSS div tag using dreamweaver?

    I know this may seem like a very silly queston to ask because it should seem so simple but how do I do that? I am having trouble being able to center an image inside of a div tag. Here is the code I have come up with so far. Thanks in advance for your help.
    </style>
    </head>
    <body>
    <div id="PageContainer">
      <div id="PageHeader"> img.centered{display:block; margin-left:auto; margin-right:auto; }<img src="Untitled-5.jpg" alt="rowland" class="centered" /></div>
    <div id="PageMenu">Content for  id "PageHeader" Goes Here</div>
    <div id="PageBody">Content for  id "PageHeader" Goes Here</div>
    <div id="PageFooter">Content for  id "PageHeader" Goes Here</div>
    </body>
    </html>
    Also you can ignore the other div tags after the first div id. The first div id that has my image link is the one I am trying to get to center my image. The image is in there just not centering.

    Centering Pages, Images and other elements with CSS:
    http://cookbooks.adobe.com/post_Centering_web_pages_and_other_elements_with_CSS-16640.html
    Nancy O.

  • Instantiate an instance inside its class

    I always read codes like following:
    Class A {
    A a = new A( );
    Could anybody tell me why a class is able to instantiate its instance inside itself.
    Another example:
    Class A {
    B b = new B( );
    Class B{
    A a = new A( )
    When Class A is running, it calls Class B, but when Class B is instantiated
    , it needs to call Class A. I am always puzzled about this kind of codes.

    Everything in the world is an object - not only the building, but also the blueprint for this building is some kind of sheet of paper.
    In Java, the Class Objects are loaded as soon as you go into runtime. The VM recognizes all necessary classes, and creates one single instance of them. So, static attributes are indeed a singleton pattern on class level...
    A class even has an own constructor. This constructor looks like this:
    class ClassA{
          // Insert Class Constructor input here
    }All static attributes are implicitly constructed in this class constructor.
    However, what you have written, is just a simple Form of:
    class ClassA{
       ClassA a;
       public ClassA(){
         a = new ClassA();
    }This is indeed a neverending loop, so this doesn't make sense. But it isn't unusual to hold a reference to another object of the same type.

  • How to insert a background image in VGroup in Flex Mobile

    I want to insert a background image for this VGroup. Help me out. I'm new to Flex !!
    I'm using this code in Flex Mobile Application
    <s:VGroup height="100%" width="100%"
              paddingTop="10" paddingBottom="10" paddingLeft="10" paddingRight="10">   
        <s:List id="homeList" height="100%"
                labelField="title"
                dataProvider="{homeNews}">
            <s:layout>
                <s:TileLayout requestedColumnCount="1"
                              verticalGap="5"/>
            </s:layout>
            <s:itemRenderer>
                <fx:Component>
                    <s:ItemRenderer>
                        <s:VGroup>
                            <s:BitmapImage source="{data.source}"/>
                            <s:Label text="{data.title}" />
                        </s:VGroup>
                    </s:ItemRenderer>
                </fx:Component>
            </s:itemRenderer>
        </s:List>
    </s:VGroup>

    I don't think you can add a background image to a VGroup directly, nor can VGroup be skinned.
    As far as I am aware there are probably 2 solutions
    1) use a SkinnableContainer instead skin the container to have a background image and set its layout to VerticalLayout
    2) enclose the VGroup in a Group with a BasicLayout. you can then add a background image to the Group and overlay the VGroup

  • Referencing a instance inside a Class

    Hi --
    I am working on converting a movie clip to a Class so that I
    can more easily
    reuse it in later projects.
    I have pretty succesfully converted my AS code from my
    include file to a
    Class file. However, I have two objects on the stage, topBG
    and botBG and
    whenever I reference these items inside my code, such as
    botBG._y I get an
    error at compile time saying "There is no property with the
    name 'botBG'"
    How can I set it so these assets can be referred to inside my
    code?
    The code worked fine when it was just a movie.. Also, this is
    ActionScript
    2.0.
    Thanks
    Rich

    Hi --
    Thanks for responding. What I had created was this:
    I have a movie clip, "MainClip" with two movie clips ("ClipA"
    and "ClipB")
    inside that clip.
    I put MainClip on the stage (_root) and had Actionscript code
    in the main
    time line. I referenced ClipA & ClipB this way:
    MainClip.ClipA
    MainClip.ClipB
    Now, I want to turn MainClip into a class, "classMainClip".
    However, having
    moved the Actionscript into the class AS file and changed the
    above
    reference to just
    ClipA
    ClipB
    I get an error at compile time.
    How do I refer to the movie clips, "ClipA" and "ClipB" inside
    the
    actionscript that is the over lying class of which I want
    these clips to be
    a part?
    Hopefully I've explained this right.
    Thanks,
    Rich
    "kglad" <[email protected]> wrote in message
    news:gibuh8$qbh$[email protected]..
    > you want class instances to be able to reference each
    other?

  • Plz help on this .... Images inside Tree IN FLEX ?

    Hi All,
    I'm trying to do some application, here i require Images in
    Tree format. I need to insert Images instead of Labels inside Tree
    Component.
    Thanks in Advance.
    Bachi...

    Custom itemRenderer? FB3 help or livedocs.

  • Browser inside a Flash/FLex/Air-App with WebGL-Support?

    Hello,
    I´m using Adobe Air/Flex to build a Desktop App. Inside the App the user should be able to access an Internet Browser. This part is actually working so far.
    BUT:   THE ADOBE AIR BROWSER IS NOT SUPPORTING WEBGL.
    Is there any method to activate the WebGL Support so I could open WebGL-Dependent URLs from Inside my Desktop App?
    Sure, I could tell the User he should Alt+Tab to switch to an WebGL-Compatible Browser, but it would so much better if this all would work from inside my Application.
    Thanks for answering!
    Stefan

    The syntax for the update is incorrect, you can use the update statement as
    sqls.text = "UPDATE videos SET thumb = 'ram' + '''s' where id = 2";
    Let me know if this worked.

  • "java.lang.ClassNotFoundException" when creating a CFC instance inside a webservice

    This question is also up on stack overflow: http://stackoverflow.com/questions/10089962/coldfusion-web-service-failing-to-see-componen t
    I've got a CFC that I'm going to access with ?wsdl as a SOAP webservice.
    If I call the CFC directly in a browser, my results render fine:
        http://server/webservice/calc.cfc?method=doStuff&foo=bar
    If I try to access it as a web service:
        ws = CreateObject("webservice", 'http://server/webservice/calc.cfc?wsdl');
        result = ws.doStuff('bar');
    I get an error:
    Cannot perform web service invocation doStuff.
    The fault returned when invoking the web service operation is:
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: coldfusion.xml.rpc.CFCInvocationException:
    [coldfusion.xml.rpc.CFCInvocationException : [java.lang.ClassNotFoundException :
    com.calculations.calc][java.lang.NullPointerException : null]]
    faultActor:
    faultNode:
    faultDetail:
        {http://xml.apache.org/axis/}stackTrace:coldfusion.xml.rpc.CFCInvocationException:          [coldfusion.xml.rpc.CFCInvocationException : [java.lang.ClassNotFoundException :    
    com.calculations.calc][java.lang.NullPointerException : null]]
        at     coldfusion.xml.rpc.CFComponentSkeleton.__createCFCInvocationException(CFComponentSkeleton.java:733)
        at coldfusion.xml.rpc.CFComponentSkeleton.__convertOut(CFComponentSkeleton.java:359)
        at webservice.calc.doStuff(/var/www/vhosts/server/httpdocs/webservice/calc.cfc)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.r... ''
    The problem is because the doStuff function is declaring an instance of a CFC inside it:
    remote struct function doStuff(foo) {
      var objReturn = {};
        objReturn.msg = 'A message';
        // do a calculation
        var objCalc = new com.calculations.calc(foo);
        objReturn.calc = objCalc;
      return objReturn;
    So my CFC that I'm using as a webservice has got another CFC being declared inside a function. Browsing directly to my webservice CFC works fine, but trying to call it using the CreateObject/webservice route fails, as it can't create an instance of the **com.calculations.calc** component.
    It doesn't error, wierdly, if I comment out the objReturn.calc = objCalc line. So it seems I can create the instance, but the error isn't thrown till I assign it to my return struct.
    Also I've found, If I refresh the page a few times, sometimes the error changes to:
    AxisFault
    faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode:
    faultString: coldfusion.xml.rpc.CFCInvocationException:
        [coldfusion.xml.rpc.CFCInvocationException : [java.lang.ClassNotFoundException :    
        com.calculations.calc][coldfusion.xml.rpc.CFCInvocationException :
        returnType must     be defined for remote CFC functions.]]
         faultActor:
         faultNode:
         faultDetail:
        {http://xml.apache.org/axis/}stackTrace:coldfusion.xml.rpc.CFCInvocationException:
        [coldfusion.xml.rpc.CFCInvocationException : [java.lang.ClassNotFoundException :
        com.calculations.calc][coldfusion.xml.rpc.CFCInvocationException :
        returnType must be defined for remote CFC functions.]]
        at coldfusion.xml.rpc.CFComponentSkeleton.__createCFCInvocationException(CFComponentSkeleton.java:733)
    at coldfusion.xml.rpc.CFComponentSkeleton.__convertOut(CFComponentSkeleton.java:359)
    at webservices.TaxCalc.feed.getTaxCalc(/var/www/vhosts/server/httpdocs/webservice/calc.cfc)
    at sun.reflect.Nat... ''
    Message was edited by: PeteComcar - impvoed code formatting and added returntype update

    Dear All Technology Expert's,
    I have a query related to Coldfusion SOAP services, that is most commonly asked in all the forum's but NONE of them has got answer.
    If there is NO solution so I think Adobe has to come up with some patches so developer can able to do some customization.
    I like to share with you all, in all other language ( PHP, JAVA, .NET etc) this option is available and you can customize the error.
    Ok let me again explain the very basic error:
    SOAP Request:
    <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
       <soapenv:Header/>
       <soapenv:Body>
       </soapenv:Body>
    </soapenv:Envelope>
    SOAP Response:
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Body>
          <soapenv:Fault>
             <faultcode>soapenv:Server.userException</faultcode>
             <faultstring>java.lang.Exception: Body not found.</faultstring>
             <detail>
                <ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">java.lang.Exception: Body not found.
      at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:121)...</ns1:s tackTrace>
                <ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">Coldfusion Error</ns2:hostname>
             </detail>
          </soapenv:Fault>
       </soapenv:Body>
    </soapenv:Envelope>
    HOW we can customize the error, in all other languages you can simple customize the error like
    Other languages SOAP response:
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Body>
          <soapenv:Fault>
             <faultcode>BODY_NOT_FOUND</faultcode>
             <faultstring>Body is missing in your request</faultstring>
          </soapenv:Fault>
       </soapenv:Body>
    </soapenv:Envelope>
    But the same is NOT possible in Coldfusion, right?
    AS you know it is vulnerability to display exception messages in the response.
    We are developing this web service to access  from other language website (PHP, .NET).
    We are also planning to upgrade server the Coldfusion 11, but do you think there is any solution with latest Coldfusion version.
    Please response only if you know about these issue's or solution. 
    Thanks
    Niyaz

  • How can I center the chart inside the portlet?

    Hi,
    I created a bar chart and published it as a portlet.
    The chart is left-positioned inside the portlet which doesn't
    look good. How can I center it?
    Thank you in advance for your help.

    Hi,
    There is no way of centering your chart within a portlet.
    Thanks,
    Anu

  • Singleton instance inside a doGet() is safe by default?

    Reading "Servlets and JavaServer Pages: The J2EE Technology Web Tier" book from Jayson Falker and Kevin Jones page, at page 414, "State and Thread Safety", says that executing a local variable inside a doGet() method is thread safe.
    So, can I create a first instance of a singleton class inside a doGet() those this means that the singleton is automatically thread safe and syncronization is not really necesary?
    Thanks,
    Lorenzo Jim�nez

    I am not sure of this, but to make it thread safe, you'd need to synchronize the data access methods in the singleton.
    I hope I am wrong and get enlightened.
    Regards,
    $ Carol.

  • Using placed/named instances inside another movieclip

    I'm trying to be good and make all my movieclips linked to a
    class file, but I'd still like the convenience of placing and
    naming other instances instead of having to declare a variable,
    instantiating it and addChild-ing it in the class file. Is this
    possible?
    Here's the situation: I've created a library.fla with
    components, for example LCARSButton and LCARSElbow. But now I want
    to build movie clips (inside of library.fla) that use these
    components, for example LCARSPrefs.
    I can create a frame script inside of LCARSPrefs that
    positions the instances of LCARSButton and LCARSElbows that I
    placed and named on the stage of LCARSPrefs. But if I try linking
    LCARSPrefs to a class file, say LCARSPrefs.as, I'll get an 1120
    error telling me that I haven't declared the variables that
    correspond to the instances of LCARSButton and LCARSElbow that I
    placed on the stage.
    Is it impossible to mix these two approaches? If you link to
    a class, are you forced to use code to declare and add instances of
    components?
    I would prefer to have a mix of these approaches because I'm
    trying to create a runtime shared library of components and the
    movies that incorporate these components. For instance, I want
    logs.fla to import LCARSPrefs from the library and I want to see a
    visual representation of that imported instance. But if I can't
    place instances of the components into the LCARSPrefs movieclip
    back in library.fla, I will see nothing when I import it into
    logs.fla.
    I could make LCARSPrefs yet another component, thus giving it
    a livePreview, but that seems overkill to me.
    I'd appreciate any help.
    Thanks,
    Jennifer

    OK, I've attached one solution that just seems horribly
    convoluted to me. I have to create a new variable that's just a
    reference to the placed instance: _square_mc =
    SquareComponent(getChildByName("square_mc"));
    Or is there a simpler method?
    Again, thanks, Jennifer

  • Trouble accessing a property of an instance inside a dynamically created MC.

    I’m dynamically creating an instance of a movieclip, call it a game piece. This game piece has 4 frames, each with a movieclip called “base” (although one is red, one blue, one green, one yellow). When the game piece is created I set the frame to indicate player color. I’m also changing the alpha of “base” to 1.0 when it’s being dragged, 0.5 when it’s dropped.
    Using the following code, everything works fine if the game piece color is set to the base in frame 1 (red). If the game piece is created and the timeline moved to a frame other than 1, I throw an error when trying to access base.alpha (this would be the second, third, and fourth instances of base in the game piece timeline). Here’s the strange part, this is only a problem when the game piece is first created and added to the display list. Once created, even after the error has been thrown, I can access the alpha of bases 2, 3, and 4 in the drag start/stop listeners. Here’s a link to the work in progress, and the relevant sections of code (shortened for brevity, t1 is the top left piece on the pallet, others just repeat the same code):
    http://www.appliedcd.com/stormbringergrey/cw/CW_Combat_Sim.html
    var gUnitArray:Array = new Array();
    function initUnitPallet():void {
         t1.addEventListener(MouseEvent.MOUSE_DOWN,popNewUnit);
         // other pieces the same as above
         clanSelect.addEventListener(Event.CHANGE,changeClan);
    function popNewUnit(e:MouseEvent):void {
         var isBase:String = e.target.name;
         var unitType:String = e.target.parent.name;
         if (isBase=="base") {
              var classRef:Class = getDefinitionByName(unitType + "master") as Class;
              var newUnit:MovieClip = new classRef();
              gUnitArray.push(newUnit);
              var newUnitIndex:uint = gUnitArray.length-1;
              this.addChild(gUnitArray[newUnitIndex]);
              gUnitArray[newUnitIndex].gotoAndPlay(clanSelect.selectedItem.data);
              // the following line is a problem if the above gotoAndPlay is anything other than frame 1
              gUnitArray[newUnitIndex].base.alpha = 1.0;
              gUnitArray[newUnitIndex].x = e.stageX;
              gUnitArray[newUnitIndex].y = e.stageY;
              gUnitArray[newUnitIndex].addEventListener(MouseEvent.MOUSE_DOWN,startUnitDrag);
              gUnitArray[newUnitIndex].addEventListener(MouseEvent.MOUSE_UP,stopUnitDrag);
              gUnitArray[newUnitIndex].startDrag();
    function startUnitDrag(e:MouseEvent):void {
         e.currentTarget.base.alpha = 1.0;
         e.currentTarget.startDrag();
    function stopUnitDrag(e:MouseEvent):void {
         e.currentTarget.base.alpha = 0.5;
         e.currentTarget.stopDrag();
    function changeClan(e:Event):void {
         var myClanColor:String = e.target.selectedItem.data
         t1.gotoAndPlay(myClanColor);
         // other pieces the same as above

    Thanks, pointed me in the right direction. I tried implementing a RENDER listener (see commented code below), and it worked, but unreliably. In my case the RENDER event fired before the entire frame was instantiated in about 1 out of 10 tries. I found a bunch of old posts (2007 or so) implying the RENDER event is buggy in Flash at best (apparently it has a better history in Flex). I couldn’t find more recent posts indicating better behavior, but I was unable to eliminate the residual errors in my project.
    Fortunately, while reading I was reminded of the EXIT_FRAME event which seems to work perfectly (but forces me to player 10, not a big deal). Final code below along with proper Z-order control.
    (BTW: I really miss the old forum's code box)
    function initUnitPallet():void {
         t1.addEventListener(MouseEvent.MOUSE_DOWN,popNewUnit);
         clanSelect.addEventListener(Event.CHANGE,changeClan);
    function changeClan(e:Event):void {
         var myClanColor:String = e.target.selectedItem.data
         t1.gotoAndPlay(myClanColor);
    function popNewUnit(e:MouseEvent):void {
         var isBase:String = e.target.name;
         var unitType:String = e.currentTarget.name;
         if (isBase=="base") {
              var classRef:Class = getDefinitionByName(unitType + "master") as Class;
              var newUnit:MovieClip = new classRef();
              gUnitArray.push(newUnit);
              var newUnitIndex:uint = gUnitArray.length-1;
              this.addChild(gUnitArray[newUnitIndex]);
              gUnitArray[newUnitIndex].gotoAndPlay(clanSelect.selectedItem.data);
              gUnitArray[newUnitIndex].x = e.stageX;
              gUnitArray[newUnitIndex].y = e.stageY;
              gUnitArray[newUnitIndex].addEventListener(MouseEvent.MOUSE_DOWN,startUnitDrag);
              gUnitArray[newUnitIndex].addEventListener(MouseEvent.MOUSE_UP,stopUnitDrag);
              gUnitArray[newUnitIndex].addEventListener(Event.EXIT_FRAME,renderUnit);
              // gUnitArray[newUnitIndex].addEventListener(Event.RENDER,renderUnit);
              // stage.invalidate();
              gUnitArray[newUnitIndex].startDrag();
    function renderUnit(e:Event):void {
         e.currentTarget.removeEventListener(Event.EXIT_FRAME,renderUnit);
         // e.currentTarget.removeEventListener(Event.RENDER,renderUnit);
         e.currentTarget.base.alpha = 1.0;
    function startUnitDrag(e:MouseEvent):void {
         if(this.numChildren > 1){
              e.currentTarget.parent.setChildIndex(e.currentTarget,this.numChildren-1);
         e.currentTarget.base.alpha = 1.0;
         e.currentTarget.startDrag();
    function stopUnitDrag(e:MouseEvent):void {
         e.currentTarget.base.alpha = 0.5;
         e.currentTarget.stopDrag();

  • How do you center an oval inside an oval CS5

    I made an oval.  Then I copies and pasted an oval.  I selected the lower right had corner of the square around the oval.  I drag the corner inward to keep it porportional (I hope this is correct) to the first oval.  Now I want to center the smaller oval inside the larger oval.  I want to have the distance the same all around the smaller oval.  I then plan to type in the area between the two ovals.
    thanks
    Mike

    You can also use a combination of SmartGuides and Rulers as well as default objects such as the Rectangle Tool which have Center Points to get the center once you apply the rulers using smart guides.
                        +   <----------------------------------------centerpoint of rectangle

  • Notification center label display problem

    Is anyone else having poor label display in Notification Center?  More importantly anyone have a solution?

    I don't think I did anything but it works now on all 4 sides.
    Very wierd.

  • Access to Class Instance inside TileList and DataProvider?

    I have a TileList that is fed by a DataProvider.  The DataProvider places a source Class (and corresponding MovieClip) into the TileList as visual and interactive objects.
         dpChords.addItem({ label:tt, source:ChordUnit, data:i, scaleContent:true }); 
    How do I pass unique values to the instances of the "ChordUnit" within the TileList?
    public function setChordBin(song:int):void {
              var dpChords:DataProvider = new DataProvider();
              var i:uint;
              // determine chord set
              if (song == -1) {
                        activeChords = allChords;
               else {
                        activeChords = songChordSets[song];
              // fill dataProvider
              for(i=0; i<activeChords.length; i++) {
                        var tt = activeChords[i];
              dpChords.addItem({ label:tt, source:ChordUnit, data:i, scaleContent:true }); 
              chordBin.dataProvider = dpChords;
         // FORMATTING
              chordBin.columnWidth = 105;
         chordBin.rowHeight = 115; 
              chordBin.direction = ScrollBarDirection.HORIZONTAL;
              chordBin.setStyle("contentPadding", 5); 
              chordBin.setRendererStyle("imagePadding", 0);
              chordBin.scrollPolicy  = ScrollPolicy.ON;
              // set style for labels
              chordBin.setRendererStyle("textFormat", textFormat2);
              // set the background skin
              chordBin.setStyle("skin", lightBackground);
              //set the cell renderer
              chordBin.setStyle("cellRenderer", MyTileListRenderer);
        // EVENTS
              chordBin.addEventListener(ListEvent.ITEM_ROLL_OVER, chordBinItemOVER);
              chordBin.addEventListener(ListEvent.ITEM_ROLL_OUT, chordBinItemOUT);
              chordBin.addEventListener(ListEvent.ITEM_CLICK, chordBinItemCLICK);

    Here is the "" Class:
    package {
              // associates to "ChordUnit" MC graphic in library
              import flash.display.*;
              import flash.events.*;
              import flash.net.URLRequest;
              public class ChordUnit extends MovieClip {
                   public var imagePath:String;
                   public function ChordUnit():void {
                        loadDiagramImage(imagePath);
                   public function loadDiagramImage(imagePath:String) {
                        trace (imagePath)
                        var request:URLRequest = new URLRequest(imagePath);
                       this.diagramView.scaleContent = true;
                        // this.diagramView.addEventListener(Event.COMPLETE,loadComplete);
                        // this.diagramView.addEventListener(ProgressEvent.PROGRESS,loadProgress);           
                        this.diagramView.load(request);
    Of course, without being able to pass a unique "imagePath" value into the Class instance, the trace is "null".

Maybe you are looking for