--- In [email protected], "caruso_canepari" 
<[EMAIL PROTECTED]> wrote:
>
> Hi, now I get three compiler errors:
> the fact is that I'm trying to learn as3 by using Flex and the
> presence of MXML is getting me crazy... Is there a way to compile 
swf
> without mxml? 
> 
> On with the errors:
> 
> 1047  Parameter initializer unknown or is not a compile-time 
constant.
> 
> 1180  Call to a possibly undefined method
> 
> - The prefix "mx" for element "mx:Application" is not bound
> 
> 
> The code used:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
> layout="absolute" creationComplete="drawer()">
>       <mx:Script>
>       <![CDATA[
>       import flash.display.*;
>       import flash.events.*;
>       import flash.ui.*;
>       
>       public function drawer():void{
>               var mySprite:Sprite = new Sprite();
>               mySprite.graphics.beginFill(0xffcc00);
>               mySprite.graphics.drawCircle(30,30,30);
>               var lab:TextField = new TextField();
>               lab.text = "hello";
>               lab.x = 300;
>               lab.y = 300;
>               mySprite.addChild(lab);
> var wrapper:UIComponent = new UIComponent();
> wrapper.addChild(mySprite);
> addChild(wrapper);
>               }
>       
>       ]]>
> </mx:Script>
> </mx:Application>
>
Just do not get crazy pls, what about this:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute" creationComplete="drawer()">
<mx:Script>
<![CDATA[
import flash.display.*;
import flash.events.*;
import flash.ui.*;
import mx.core.UIComponent;

public function drawer():void{
var mySprite:Sprite = new Sprite();
mySprite.graphics.beginFill(0xffcc00);
mySprite.graphics.drawCircle(30,30,30);
var lab:TextField = new TextField();
lab.text = "hello";
lab.x = 300;
lab.y = 300;
mySprite.addChild(lab);
var wrapper:UIComponent = new UIComponent();
wrapper.addChild(mySprite);
addChild(wrapper);
}

]]>
</mx:Script>
<mx:Canvas>
</mx:Canvas>
</mx:Application>






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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to