It's as simple as

<mx:Script source="includes/Sample3Script.as"/>

All it does is include the AS file at that point. Everything inside the MXML 
file is available to the AS file - no custom events necessary.

See http://livedocs.adobe.com/flex/3/html/help.html?content=usingas_6.html

--- In flexcoders@yahoogroups.com, "Sells, Fred" <fred.sells@...> wrote:
>
> Embedding the ActionScript in the .mxml file is fine up to a point.  Now
> I've got quite a bit of logic dealing with the handling of DnD on an
> mx:DataGrid and I would like to move that code into a .as file just to
> keep my sanity and to take advantage of the outline feature of the IDE.
> I may also be able to use it (or subclass it) to handle the similar
> actions on a List.
> 
>  
> 
> I'm not really certain of the "right" way to go about that and to be
> able to reference all the id's within the remaining mxml.  Similarly, I
> would like to be able to listen for the events from the mxml without
> having to define and dispatch custom events.
> 
>  
> 
> This is probably basic stuff for those of you who are really into the
> technology, but I could use a jump start - even a link to a reasonable
> tutorial would be fine.
> 
>  
> 
> FWIW I'm using 4.1 and plan to upgrade to 4.5 as soon as I get some
> breathing room in my deadlines.
> 
>  
> 
> Thanks in Advance,
> 
>  
> 
> Fred.
>


Reply via email to