Jump to content
Fórum Script Brasil
  • 0

Criar componente no Flex com AS3


chamuska

Question

Pessoal, não sei se aqui é o local correto para perguntar sobre Flex mas como envolve AS3 então vou postar!

Estou usando Flex 4 e preciso criar um componente usando AS3 mas não estou conseguindo e quero saber se vocês podem me ajudar!?

O codigo que fiz pra tenta é esse:

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                           xmlns:s="library://ns.adobe.com/flex/spark" 
                           xmlns:mx="library://ns.adobe.com/flex/mx" 
                           minWidth="955" minHeight="600"
                           creationComplete="inicio()" >
        <fx:Declarations>
                <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        
        
        <fx:Script>
                <![CDATA[
                        import mx.controls.Alert;
                        import mx.controls.Button;
                        
                        
                        public function inicio():void
                        {
                                var botao:Button = new Button();
                                botao.x = 300;
                                botao.y = 250;
                                this.addChild(botao);
                        }
                        
                ]]>
        </fx:Script>
</s:Application>

Esse codigo deveria adicionar um botao na tela, mas não esta dando certo.

Ta certo o que fiz?? É +- isso ??

Vi na internet um exemplo assim, mas não ta dando certo aqui :(

Valeu!

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...