you can do the following

> In Flex 1.5 I had this:
>
> Parent
>
> DesignView[0].addEventListener("selectionChanged",
> mx.utils.Delegate.create(this, valueChanged))
>
>
> function valueChanged(event)
> {
>       currentSelection = event.selection
>       adjustControls(event.style)
> }

Flex2B2
Parent

DesignView[0].addEventListener("selectionChanged", valueChanged)

function valueChanged(event:SelectionChangedEvent):void
{
currentSelection = event.selection;
adjustControls(event.style);
}

create a class called SelectionChangedEvent as follows

package
{
import flash.events.Event;

public class SelectionChangedEvent extends flash.events.Event
{
    public var selection:String;
    public var style:Object(not sure what type style settings is)
   
    public function SelectionChangedEvent(_selection:String,
_style:String);
    {
       super("selectionChanged");
       selection = _selection;
       style = _style;
    }
}
}

>
> Child
>
> <mx:Metadata>
>       [Event("showBorders")]
>       [Event("selectionChanged")]
> </mx:Metadata>
>
> dispatchEvent({type: 'selectionChanged', selection:
> event.target.getChildAt(0).id, style: styleSettings});
>

Child
<mx:Metadata> is the same

dispatchEvent(new Event(event.target.getChildAt(0).id,
styleSettings));


my suggestion is based on the flex2 samples example

regards
bod






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to