I now have the following, but I get the same error:

 import flash.display.Sprite;
 import flash.events.*;
    import flash.net.XMLSocket;
 public class socket extends UIComponent
 {
...

----- Original Message ----
From: Jim Robson <[EMAIL PROTECTED]>
To: flexcoders@yahoogroups.com
Sent: Tuesday, January 9, 2007 10:58:54 AM
Subject: [flexcoders] Re: Referring to created AS class from within MXML

David,

DisplayObjects (Sprite, Shape, Bitmap) can't generally be used
directly in MXML. To be able to add a child using an MXML tag, you
need to extend UIComponent.

-Jim

--- In [EMAIL PROTECTED] ups.com, David Steele <[EMAIL PROTECTED]> wrote:
>
> I apologize for what must be an obvious question, but why when I try
to create a class in the inline code of an mxml page do I get the
'Classes must not be nested' error?
> 
> I'm trying to test a socket connection. I've got the socket code
(which is a class); I know how to create mxml buttons etc. What I
don't know is how to put the two together. I've created a new
actionscript class file: 
> package {
> import flash.display. *;
> import flash.events. *;
> import flash.net.XMLSocket ;
> 
> public class socket extends Sprite
> {
> ...
> 
> I've also got a document called socketTest.mxml. How do I refer to
to my AS class from within socketTest.mxml? Do I need to explicitly
place the two files somewhere?
> 
> Thanks.
> 
> ____________ _________ _________ _________ _________ __
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around 
> http://mail. yahoo.com
>




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to