You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Logibérica - Paulo Esgaio <pe...@logiberica.com> on 2014/05/27 17:48:52 UTC

[FLEXJS] Creating new TextButton in RunTime

Dear (ex?)Flexers,

I'm having a problem while compiling a simple app that uses antipatterns.

Here's a partial sample:

<fx:Script>
<![CDATA[
import org.apache.flex.createjs.TextButton;
private var obj:TextButton = new TextButton();

(...)

]]>
</fx:Script>

Error when compiling with FlexJS (FalconJX Release )
When I try to compile into JS the following error occurs:

\bin\js-debug\org\apache\flex\createjs\core\UIBase.js:53: ERROR - variable createjs is undeclared
  this.element = new createjs.Container();

Removing both the lines it Works like a charm. Any ideas, anyone?

TIA,

Paulo Esgaio


RE: [FLEXJS] Creatina new TextButton in RunTime

Posted by Logibérica - Paulo Esgaio <pe...@logiberica.com>.
Peter and Alex,

Thank you for your help, and for the quick answer.
Working perfectly now.

var my_btn:TextButton = new TextButton();
my_btn.width = 100;
my_btn.height = 50;
my_btn.text = "Run Time Btn"
my_btn.className = "btnClass";
this.addElement(my_btn);

my_btn implements org.apache.flex.html.TextButton.

Best Regards,
Paulo Esgaio	 

-----Mensagem original-----
De: Peter Ent [mailto:pent@adobe.com] 
Enviada: 27 de maio de 2014 17:12
Para: dev@flex.apache.org
Cc: Logibérica - Jaime Martin; Logibérica - Marco Peixoto
Assunto: Re: [FLEXJS] Creating new TextButton in RunTime

Take a look at Application in the org.apache.flex.creatjs project. There's a note about bringing in the createJS package.


Peter Ent
Adobe Systems


On 5/27/14 11:48 AM, "Logibérica - Paulo Esgaio" <pe...@logiberica.com>
wrote:

>Dear (ex?)Flexers,
>
>I'm having a problem while compiling a simple app that uses antipatterns.
>
>Here's a partial sample:
>
><fx:Script>
><![CDATA[
>import org.apache.flex.createjs.TextButton;
>private var obj:TextButton = new TextButton();
>
>(...)
>
>]]>
></fx:Script>
>
>Error when compiling with FlexJS (FalconJX Release ) When I try to 
>compile into JS the following error occurs:
>
>\bin\js-debug\org\apache\flex\createjs\core\UIBase.js:53: ERROR - 
>variable createjs is undeclared
>  this.element = new createjs.Container();
>
>Removing both the lines it Works like a charm. Any ideas, anyone?
>
>TIA,
>
>Paulo Esgaio
>





Re: [FLEXJS] Creating new TextButton in RunTime

Posted by Peter Ent <pe...@adobe.com>.
Take a look at Application in the org.apache.flex.creatjs project. There's
a note about bringing in the createJS package.


Peter Ent
Adobe Systems


On 5/27/14 11:48 AM, "Logibérica - Paulo Esgaio" <pe...@logiberica.com>
wrote:

>Dear (ex?)Flexers,
>
>I'm having a problem while compiling a simple app that uses antipatterns.
>
>Here's a partial sample:
>
><fx:Script>
><![CDATA[
>import org.apache.flex.createjs.TextButton;
>private var obj:TextButton = new TextButton();
>
>(...)
>
>]]>
></fx:Script>
>
>Error when compiling with FlexJS (FalconJX Release )
>When I try to compile into JS the following error occurs:
>
>\bin\js-debug\org\apache\flex\createjs\core\UIBase.js:53: ERROR -
>variable createjs is undeclared
>  this.element = new createjs.Container();
>
>Removing both the lines it Works like a charm. Any ideas, anyone?
>
>TIA,
>
>Paulo Esgaio
>


Re: [FLEXJS] Creating new TextButton in RunTime

Posted by Alex Harui <ah...@adobe.com>.
Are you trying to build a CreateJS application?  Otherwise, try using
org.apache.flex.html.TextButton.

One of the differences in FlexJS is that there can be multiple
implementations of a component.  The createjs.TextButton wraps the button
used in CreateJS.  There is one for Jquery, hopefully other ones for other
JS frameworks some day.

To use the CreateJS TextButton you probably need to make sure you are
using the other CreeateJS components like Container and Application.
We're currently expecting you to use entire sets of components: mixing
CreateJS and Jquery component is not supported and may never be supported.

HTH,
-Alex


On 5/27/14 8:48 AM, "Logibérica - Paulo Esgaio" <pe...@logiberica.com>
wrote:

>Dear (ex?)Flexers,
>
>I'm having a problem while compiling a simple app that uses antipatterns.
>
>Here's a partial sample:
>
><fx:Script>
><![CDATA[
>import org.apache.flex.createjs.TextButton;
>private var obj:TextButton = new TextButton();
>
>(...)
>
>]]>
></fx:Script>
>
>Error when compiling with FlexJS (FalconJX Release )
>When I try to compile into JS the following error occurs:
>
>\bin\js-debug\org\apache\flex\createjs\core\UIBase.js:53: ERROR -
>variable createjs is undeclared
>  this.element = new createjs.Container();
>
>Removing both the lines it Works like a charm. Any ideas, anyone?
>
>TIA,
>
>Paulo Esgaio
>