Two ways to solve this one
var dir:Directions = event.directions as Directions;
or
var dir:IDirections = event.directions;

it's saying event.directions is actually an IDirections the object
you're assuming it is is Directions (probably a right assumption but
an assumption all the same), the first solution says #$@ you compiler
treat instance x as Directions whatever it is and if it's not a
Directions object come runtime then it'll be null (run into null
pointer exception error if you do this incorrectly).  The second
solution is better, since event.directions is defined only as
IDirections and not necessarily the Directions implmentation of the
IDirections interface so just assume you have something that
implements that interface and nothing more, this way if the class that
implements the interface gets changed from Directions to
AdvancedDirections you don't get null pointer exceptions (assuming
AdvancedDirections which I'm making up here also implements
IDirections).
Let me know if that helps at all or if you'd like more clarification.
Shaun

On Dec 24, 2:54 pm, Jerry <[email protected]> wrote:
> This is the compile time error i'm getting in the code area of
>
> var dir:Directions = event.directions;
>
> under Flex 4.0
>
> i'm a newbi so if u need any more info kindly revert to me

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API For Flash" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api-for-flash?hl=en.

Reply via email to